From c8f086e22608401dadb6052018e4e7829d0eb9f0 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:43:33 +0200 Subject: [PATCH 1/5] Pz/types 010 (#465) * in progress * Update OpenAPI.json * Update Changelog.md * fix * Update .gitignore * naming * naming * in progress * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * changelog * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json --- Changelog.md | 98 ++- reference/OpenAPI.json | 1809 +++++++++++++++++++++++++++++++++++----- 2 files changed, 1692 insertions(+), 215 deletions(-) diff --git a/Changelog.md b/Changelog.md index 1feed63fe..63744fade 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,57 @@ # Changelog +## 20231009 + +#### New schemas: +- LoyaltiesListMemberRewardsRequestQuery +- LoyaltiesGetPointsExpirationRequestQuery +- LoyaltiesGetPointsExpirationResponseBody +- LoyaltiesListCardTransactionsRequestQuery +- LoyaltiesListCardTransactionsResponseBody +- LoyaltyCardTransactionsType +- SimpleLoyaltyVoucher +- LoyaltyCardTransaction +- LoyaltyCardTransactionsFields +- LoyaltiesExportCardTransactionsRequestBody +- LoyaltiesExportCardTransactionsResponseBody +- RewardAssignment +- Reward +- RewardTypeCoin +- RewardTypeMaterial +- RewardTypeCampaign +- RewardType +- LoyaltiesAddOrRemoveCardBalanceResponseBody +- LoyaltiesTransferPointsResponseBody +- LoyaltiesTransferPoints +- LoyaltiesTransferPointsRequestBody +- LoyaltiesListMemberRewardsResponseBody +- LoyaltiesAddOrRemoveCardBalanceRequestBody +- PointsExpirationTypes + +#### Schemas changes +- /v1/loyalties/{campaignId}/members/{memberId}/balance + - new request schema `LoyaltiesAddOrRemoveCardBalanceRequestBody` (old `8_req_add_remove_points_balance`) + - new response schema `LoyaltiesAddOrRemoveCardBalanceResponseBody` (old `8_res_add_remove_points_balance`) +- /v1/loyalties/members/{memberId}/balance + - new request schema `LoyaltiesAddOrRemoveCardBalanceRequestBody` (old `8_req_add_remove_points_balance`) + - new response schema `LoyaltiesAddOrRemoveCardBalanceResponseBody` (old `8_res_add_remove_points_balance`) +- /v1/loyalties/{campaignId}/members/{memberId}/transfers + - new request schema `LoyaltiesTransferPointsRequestBody` (old `8_req_transfer_loyalty_points`) + - new response schema `LoyaltiesTransferPointsResponseBody` (old `8_obj_loyalty_card_object_non_expanded_categories`) +- /v1/loyalties/{campaignId}/members/{memberId}/transactions + - new request schema `LoyaltiesListCardTransactionsRequestBody` (old `8_res_get_loyalty_card_transactions`) +- /v1/loyalties/members/{memberId}/transactions + - new request schema `LoyaltiesListCardTransactionsResponseBody` (old `8_res_get_loyalty_card_transactions`) +- /v1/loyalties/members/{memberId}/transactions/export + - new request schema `LoyaltiesExportCardTransactionsRequestBody` (old `8_req_create_loyalty_card_transactions_export`) + - new response schema `LoyaltiesExportCardTransactionsResponseBody` (old `8_obj_export_transactions_object`) +- /v1/loyalties/{campaignId}/members/{memberId}/transactions/export + - new request schema `LoyaltiesExportCardTransactionsRequestBody` (old `8_req_create_loyalty_card_transactions_export`) + - new response schema `LoyaltiesExportCardTransactionsResponseBody` (old `8_obj_export_transactions_object`) +- /v1/loyalties/{campaignId}/members/{memberId}/points-expiration + - new response schema `LoyaltiesGetPointsExpirationResponseBody` (old `8_res_get_points_expiration`) + + ## 20231005 - Earning rule **New models** @@ -23,11 +75,11 @@ **Endpoint changes** - GET /v1/loyalties/{campaignId}/earning-rules - - New response schema: LoyaltiesGetEarningRuleResponseBody (old one: `8_res_list_earning_rules`) + - New response schema: LoyaltiesGetEarningRuleResponseBody (old one: `8_res_list_earning_rules`) - POST /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable - - New response schema: LoyaltiesEnableEarningRulesResponseBody (old one: 8_obj_earning_rule_object_no_validation_rule) + - New response schema: LoyaltiesEnableEarningRulesResponseBody (old one: 8_obj_earning_rule_object_no_validation_rule) - POST /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable - - New response schema: LoyaltiesDisableEarningRulesResponseBody (old one: 8_obj_earning_rule_object_no_validation_rule) + - New response schema: LoyaltiesDisableEarningRulesResponseBody (old one: 8_obj_earning_rule_object_no_validation_rule) ## 20230829 @@ -39,20 +91,19 @@ **Endpoints changes** - `/v1/customers/{customerId}/permanent-deletion` - - POST - - Response schema was replaced with `customers_permanent_deletion_response_body` (old `9_res_customers_customerId_permanent-deletion`) - - `status` default value was set to `DONE` - - `data_json.customer` default value was set to 1 - - Added `required` to response properties + - POST + - Response schema was replaced with `customers_permanent_deletion_response_body` (old `9_res_customers_customerId_permanent-deletion`) + - `status` default value was set to `DONE` + - `data_json.customer` default value was set to 1 + - Added `required` to response properties - `v1/customers/bulk/async` - - POST - - Request schema was replaced with `customers_update_in_bulk_request_body` (old `9_req_update_customers_bulk-deletion`) - - Set as `required`: `async_action_id` property in `a_res_async_actions` model + - POST + - Request schema was replaced with `customers_update_in_bulk_request_body` (old `9_req_update_customers_bulk-deletion`) + - Set as `required`: `async_action_id` property in `a_res_async_actions` model - `v1/customers/metadata/async` - POST - - Request schema was replaced with `customers_update_metadata_in_bulk_request_body` (old `9_req_customers_metadata_async`) - - Set as `required`: `async_action_id` property in `a_res_async_actions` model - + - Request schema was replaced with `customers_update_metadata_in_bulk_request_body` (old `9_req_customers_metadata_async`) + - Set as `required`: `async_action_id` property in `a_res_async_actions` model ## 20230929 - Order references/guides script - Changes on Performance and Qualification guidelines pages @@ -81,20 +132,11 @@ Added script, located in `docs/script/` directory to quickly update order of ref | **API** | **Endpoint** | **New Slug** | |---|---|---| -| **Locations** | Location Object | location-object | -| | Get Location | get-location | -| | List Locations | list-locations | -| **Qualifications** | Qualification Object | qualification-object | -| | Examine Qualification | examine-qualification --> changed to check-eligibility | -| | Examine Qualification (cient-side) | examine-qualification-client-side --> changed to check-eligibility-client-side | - -### Removed document explaining deprecated qualifications - -- Added a redirect to the new document so that we eliminate 404 - -| **Category** | **Guide** | **Previous Slug** | **New Slug** | -|:---|:---|:---|:---| -| Campaigns Recipes | Qualification - Checking eligibility for promo codes | checking-eligibility-for-coupons | checking-eligibility | +| **Locations** | Location Object | location-object | true | +| | Get Location | get-location | true | +| | List Locations | list-locations | true | +| **Qualifications** | Qualification Object | qualification-object | true | +| | Examine Qualification | examine-qualification | true | ## 20230809 - Deprecated Endpoints diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 907e4524b..9d7264973 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39336,9 +39336,6 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", - "x-stoplight": { - "id": "w4ci1ljqva0r1" - }, "type": "object", "properties": { "id": { @@ -39476,9 +39473,6 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", - "x-stoplight": { - "id": "6vxql7fnzg2zp" - }, "type": "string", "enum": [ "order.paid", @@ -39493,9 +39487,6 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", - "x-stoplight": { - "id": "r5o8m0sdli7fq" - }, "type": "object", "properties": { "type": { @@ -39527,9 +39518,6 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", - "x-stoplight": { - "id": "1z7lk7z1lp5af" - }, "type": "object", "properties": { "type": { @@ -39581,9 +39569,6 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", - "x-stoplight": { - "id": "ekudxr430edgk" - }, "type": "object", "properties": { "type": { @@ -39635,9 +39620,6 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", - "x-stoplight": { - "id": "4ccw4gz8b47u5" - }, "type": "object", "properties": { "type": { @@ -39695,9 +39677,6 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", - "x-stoplight": { - "id": "pqsn9otpzyot9" - }, "type": "object", "properties": { "type": { @@ -39764,9 +39743,6 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", - "x-stoplight": { - "id": "8pg4o23daepkb" - }, "type": "object", "properties": { "type": { @@ -39833,9 +39809,6 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", - "x-stoplight": { - "id": "duxy5qw36h5ph" - }, "type": "object", "properties": { "type": { @@ -39852,199 +39825,1661 @@ ], "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": { + "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." + }, + "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." + } + } + } + } + } + }, + "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" + } + } + }, + "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." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "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" + } + } + }, + "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", + "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." + } + } + }, + "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 + } + } + } + } + } + } + } + } + } + }, + "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" + }, + "reward_id": { + "type": "string" + }, + "related_object_id": { + "type": "string" + }, + "related_object_type": { + "type": "string" + }, + "parameters": { + "type": "object", + "properties": { + "loyalty": { + "type": "object", + "properties": { + "points": { + "type": "integer" + } + }, + "required": [ + "points" + ] + } + } + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "object": { + "type": "string" + } + }, + "required": [ + "id", + "reward_id", + "created_at", + "object" + ] + }, + "Reward": { + "title": "Reward", + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "stock": { + "type": "integer" + }, + "redeemed": { + "type": "integer" + }, + "attributes": { + "type": "object", + "properties": { + "image_url": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "object": { + "type": "string", + "default": "reward", + "pattern": "reward" + } + }, + "required": [ + "id", + "created_at", + "object" + ] + }, + { + "$ref": "#/components/schemas/RewardType" + } + ] + }, + "RewardTypeCoin": { + "title": "Reward Type Coin", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "COIN" + ] + }, + "parameters": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "object", + "required": [ + "exchange_ratio" + ], + "properties": { + "exchange_ratio": { + "type": "number" + }, + "points_ratio": { + "type": "integer" + } + } + } + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + "RewardTypeMaterial": { + "title": "Reward Type Material", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "MATERIAL" + ] + }, + "parameters": { + "type": "object", + "required": [ + "product" + ], + "properties": { + "product": { + "type": "object", + "required": [ + "id", + "sku" + ], + "properties": { + "id": { + "type": "string" + }, + "sku": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + "RewardTypeCampaign": { + "title": "Reward Type Campaign", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CAMPAIGN" + ] + }, + "parameters": { + "type": "object", + "required": [ + "campaign" + ], + "properties": { + "campaign": { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "balance": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "DISCOUNT_COUPONS", + "PROMOTION", + "GIFT_VOUCHERS", + "REFERRAL_PROGRAM" + ] + } + } + } + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + "RewardType": { + "title": "Reward Type", + "anyOf": [ + { + "$ref": "#/components/schemas/RewardTypeCampaign" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + } + ] + }, + "LoyaltiesAddOrRemoveCardBalanceResponseBody": { + "title": "Loyalties Add Or Remove Card Balance Response Body", + "type": "object", + "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", - "required": [ - "subtotal_amount" - ], + "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": { - "subtotal_amount": { + "qr": { "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.", + "description": "Stores Quick Response (QR) representation of encrypted code.", "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": { + "id": { "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] + "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", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." + "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", - "calculation_type", - "order_items" + "loyalty_card", + "start_date", + "expiration_date", + "validity_timeframe", + "validity_day_of_week", + "active", + "additional_info", + "metadata", + "is_referral_code", + "created_at" ] }, - "EarningRuleProportionalCustomerMetadata": { - "title": "Customer Metadata", + "LoyaltiesTransferPoints": { + "title": "Loyalties Transfer Points", "type": "object", "properties": { - "type": { + "code": { "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." + "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source)." }, - "calculation_type": { + "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", - "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)" + "description": "Reason for the transfer." }, - "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." - } - } - } - } + "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": [ - "type", - "calculation_type", - "customer" + "code", + "points", + "source_id" ] }, - "EarningRuleProportionalCustomEvent": { - "title": "Custom Event", - "x-stoplight": { - "id": "jpkgjc35zrtxj" - }, + "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": { - "type": { + "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", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "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`." }, - "calculation_type": { + "reason": { "type": "string", - "enum": [ - "CUSTOM_EVENT_METADATA" - ], - "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." + "description": "Reason for the transfer." }, - "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." - } - } - } - } + "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": [ - "type", - "calculation_type", - "custom_event" + "points" ] }, - "EarningRuleProportional": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrder" + "PointsExpirationTypes": { + "title": "Points Expiration Types", + "type": "string", + "enum": [ + "PROGRAM_RULES", + "CUSTOM_DATE", + "NON_EXPIRING" + ] + }, + "Category": { + "title": "Category", + "x-stoplight": { + "id": "4l87q60w8ta36" + }, + "type": "object", + "description": "This is an object representing a category.", + "properties": { + "id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" + "name": { + "type": "string", + "description": "Category name." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" - } - ], - "title": "Calculate points proportionally" - }, - "EarningRuleProportionalOrderItems": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" + "object": { + "type": "string", + "enum": [ + "category" + ], + "description": "The type of object represented by the JSON. This object stores information about the category." } - ], - "title": "Order Items" + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object" + ] }, "a_req_importCSV": { "type": "object", @@ -63800,7 +65235,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" }, "examples": { "Add points": { @@ -63825,7 +65260,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" }, "examples": { "Add balance": { @@ -63914,7 +65349,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" }, "examples": { "Subtract points": { @@ -63939,7 +65374,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" }, "examples": { "Subtract Points": { @@ -64023,7 +65458,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_transfer_loyalty_points" + "$ref": "#/components/schemas/LoyaltiesTransferPointsRequestBody" }, "examples": { "Example": { @@ -64048,7 +65483,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + "$ref": "#/components/schemas/LoyaltiesTransferPointsResponseBody" }, "examples": { "Example": { @@ -64160,7 +65595,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" }, "examples": { "Example": { @@ -64501,7 +65936,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" }, "examples": { "Example": { @@ -64834,7 +66269,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" }, "examples": { "Example": { @@ -64867,7 +66302,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" }, "examples": { "Example": { @@ -65000,7 +66435,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" }, "examples": { "Example": { @@ -65033,7 +66468,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" }, "examples": { "Example": { @@ -65175,7 +66610,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_points_expiration" + "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" }, "examples": { "Example": { From b5a4a174e893d7c127bee38676deff72d7b9add1 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:15:17 +0200 Subject: [PATCH 2/5] Pz/types 005 - Exports API (#486) * Update OpenAPI.json * changelog and fix for openAPI * fix * Update OpenAPI.json * fix * Update OpenAPI.json * naming * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update Changelog.md * Update OpenAPI.json * tables * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * markdown table generator update * Merge branch 'pz/types-005' into ms/types-005 * updated table * Update schema-to-md-table.ts * Revert "Update schema-to-md-table.ts" This reverts commit 4a466cc68a804b262712369d1a3e1c28a6b4cf2c. * Update schema-to-md-table.ts * script fix * Update schema-to-md-table.ts * ready to merge 005 --------- Co-authored-by: Marcin Slezak --- Changelog.md | 55 + .../EXPORTS-API-Export-Object.md | 450 +++-- ...COUNTS-API-Stackable-Redemptions-Object.md | 378 +++- .../VALIDATIONS-API-Validation-Object.md | 126 +- reference/OpenAPI.json | 1734 ++++++++++++++++- scripts/md-tables.ts | 8 +- scripts/src/schema-to-md-table.ts | 149 +- 7 files changed, 2701 insertions(+), 199 deletions(-) diff --git a/Changelog.md b/Changelog.md index 63744fade..7418bcfe8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,6 @@ # Changelog + ## 20231009 #### New schemas: @@ -52,6 +53,60 @@ - new response schema `LoyaltiesGetPointsExpirationResponseBody` (old `8_res_get_points_expiration`) + +## 20230831 - Exports API + +**New models** +- ExportsCreateRequestBody +- ExportBase +- Export +- ExportsCreateResponseBody +- ExportVoucher +- FieldConditions +- FiltersCondition +- ExportVoucherFilters +- Junction +- ExportRedemption +- ExportRedemptionFilters +- ExportCustomer +- ExportCustomerFilters +- ExportPublication +- ExportPublicationFilters +- ExportOrder +- ExportOrderFilters +- ExportPointsExpiration +- ExportPointsExpirationFilters +- ExportVoucherTransactionsExpiration +- ExportVoucherTransactionsFilters +- ExportsGetResponseBody +- ExportsListResponseBody +- ExportCustomerFields +- ExportCustomerOrder +- ExportPublicationFields +- ExportPublicationOrder +- ExportRedemptionFields +- ExportRedemptionOrder +- ExportVoucherFields +- ExportVoucherOrder +- ExportOrderFields +- ExportOrderOrder +- ExportPointsExpirationFields +- ExportPointsExpirationOrder +- ExportVoucherTransactionsFields +- ExportVoucherTransactionsOrder +- Any + +**Endpoint changes** +- v1/exports + - POST + - New request schema: `ExportsCreateRequestBody` + - New response schema: `ExportsCreateResponseBody` + - GET + - New response schema: `ExportsListResponseBody` +- v1/exports/{exportId} + - GET + - New response schema: `ExportsGetResponseBody` + ## 20231005 - Earning rule **New models** diff --git a/docs/reference-docs/EXPORTS-API-Export-Object.md b/docs/reference-docs/EXPORTS-API-Export-Object.md index 4d8d379a5..204062922 100644 --- a/docs/reference-docs/EXPORTS-API-Export-Object.md +++ b/docs/reference-docs/EXPORTS-API-Export-Object.md @@ -8,214 +8,302 @@ hidden: false order: 1 --- -## Export Object -| Attributes | Description | -|:-----|:--------| -| id
`string` |

Unique export ID.

**Example:**

exp_FFfp9o7daWuJqJCKp5xqqli4

| -| object
`string` |

The type of object being represented. This object stores information about the export.

| -| created_at
`string` |

Timestamp representing the date and time when the export was scheduled in ISO 8601 format.

**Example:**

2022-04-28T11:23:20.922Z

| -| status
`string` |

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.

Available values: `SCHEDULED`, `IN_PROGRESS`, `DONE`, `ERROR` | -| channel
`string` |

The channel through which the export was triggered.

Available values: `API`, `WEBSITE` | -| exported_object
`string` |

The type of exported object.

Available values: `order`, `voucher`, `publication`, `redemption`, `customer`, `points_expiration`, `voucher_transactions` | -| parameters | Any of: [order](#order), [voucher](#voucher), [publication](#publication), [redemption](#redemption), [customer](#customer), [points expiration](#points-expiration), [gift card transactions](#gift-card-transactions), [loyalty card transactions](#loyalty-card-transactions) | -| result
`object` |

Contains the URL of the CSV file.

AttributesDescription
url
string

URL of the CSV file location. It contains the token used for authorization in the Download export method.

| -| user_id
`string` |

Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE.

**Example:**

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

| - -## order -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `-created_at`, `created_at`, `updated_at`, `-updated_at`, `status`, `-status` | -| fields
`array` |

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:

FieldDefinitionExample Export
idUnique order ID.ord_A69RIxEdRsPuC6i8gFGVHUft
source_idUnique order source ID.8638
created_atTimestamp in ISO 8601 format representing the date and time when the order was created.2022-03-09T09:16:32.521Z
updated_atTimestamp in ISO 8601 format representing the date and time when the order was last updated.2022-03-09T09:16:33.331Z
statusOrder status.PAID, CREATED, FULFILLED, CANCELED
amountTotal amount of order items.7700
discount_amountRepresents total amount of the discount applied to whole cart.500
items_discount_amountRepresents total amount of the discount applied to order line items.100
total_discount_amountAll discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart.600
total_amountTotal order amount after applying all discounts.7100
customer_idCustomer unique ID.cust_2G4fUQdCXUqp35nXNleav7bO
referrer_idReferrer unique ID.cust_IkrTR674vvQvr9a4rDMiqglY
metadataReturns all order metadata.Response will include all order metadata.
metadata.XWhere 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.
Available values: `id,source_id,created_at,updated_at,status,amount,discount_amount,items_discount_amount,total_discount_amount,total_amount,customer_id,referrer_id,metadata` | -| filters | Any of: [Filter by status](#filter-by-status), [Filter by order source ID](#filter-by-order-source-id), [Filter by order amount](#filter-by-order-amount), [Filter by order total amount](#filter-by-order-total-amount), [Filter by order discount amount](#filter-by-order-discount-amount), [Filter by order total discount amount](#filter-by-order-total-discount-amount), [Filter by order items discount amount](#filter-by-order-items-discount-amount) | - -## voucher -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `created_at`, `-created_at`, `updated_at`, `-updated_at`, `code`, `-code` | -| fields
`array` |

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:

FieldDefinitionExample Export
idUnique voucher ID.v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD
codeUnique voucher code.WELCOME100
voucher_typeType of voucher.DISCOUNT_VOUCHER, GIFT_VOUCHER, LOYALTY_CARD
valueValue of voucher.DISCOUNT_VOUCHER : amount, percent, unit
GIFT_VOUCHER: amount left to spend
LOYALTY_CARD: available usable points
discount_typeThe type of discount for a DISCOUNT_VOUCHER.AMOUNT, PERCENT, UNIT, FIXED
campaignUnique campaign name.Summer Discounts 20% off
categoryTag defining the category that this voucher belongs to.
start_dateStart 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
expiration_dateExpiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is inactive after this date.2023-12-31T23:00:00.000Z
gift_balanceAmount left to spend.1000
loyalty_balanceAvailable usable points.2000
redemption_quantityMaximum number of times a voucher can be redeemed.2
redemption_countTotal redemptions.59
activeBoolean indicating whether the voucher is available for use.true, false
qr_codeURL to QR representation of encrypted code.
bar_codeURL to barcode representation of encrypted code.
is_referral_codeBoolean indicating whether the voucher is a referral code.true, false
created_atTimestamp in ISO 8601 format representing the date and time when the voucher was created.2022-04-14T09:55:46.814Z
updated_atTimestamp in ISO 8601 format representing the date and time when the voucher was last updated.2022-04-14T10:02:18.036Z
validity_timeframe_intervalDefines 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
validity_timeframe_durationDefines 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
validity_day_of_weekArray corresponding to the particular days of the week in which the voucher is valid."1,2,3,4,5"
discount_amount_limitFor PERCENT discount type, this is the maximum threshold allowed to be deducted.50
campaign_idParent campaign ID.camp_7s3uXI44aKfIk5IhmeOPr6ic
additional_infoAn optional field to keep any extra textual information about the code such as a code description and details.
customer_idUnique customer ID of the assigned owner to whom the voucher was published.cust_7iUa6ICKyU6gH40dBU25kQU1
discount_unit_typeFor UNIT discount type, either a shipping or product ID for a UNIT discount with one product.prod_5h1pp1ng, prod_0a9f9aeddb019a42db
discount_unit_effectUNIT discount effect.ADD_MANY_ITEMS, ADD_MISSING_ITEMS,ADD_NEW_ITEMS
customer_source_idUnique customer source id of the assigned owner to whom the voucher was published.name.lastname@email.com
metadataReturns all voucher metadata.Response will include all voucher metadata.
metadata.XWhere 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.
Available values: `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` | -| filters
`object` |

Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:

| - -## publication -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `id`, `-id`, `voucher_code`, `-voucher_code`, `tracking_id`, `-tracking_id`, `customer_id`, `-customer_id`, `created_at`, `-created_at`, `channel`, `-channel` | -| fields
`array` |

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:

FieldDefinitionExample Export
voucher_codeUnique voucher code.WELCOME100
customer_idCustomer unique ID.cust_7iUa6ICKyU6gH40dBU25kQU1
customer_source_idUnique customer source id of the assigned owner to whom the voucher was published.name.lastname@email.com
dateTimestamp in ISO 8601 format representing the date and time when the voucher was published.2022-04-28T10:19:30.792Z
channelPublication channel.voucherify-website
campaignUnique campaign name.Summer Discounts 20% off
is_winner
metadataReturns all publication metadata.Response will include all publication metadata.
metadata.XWhere 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
Available values: `voucher_code,customer_id,customer_source_id,date,channel,campaign,is_winner,metadata` | -| filters |

Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:

Any of: [Filter by failure code](#filter-by-failure-code), [Filter by result](#filter-by-result), [Filter by customer ID](#filter-by-customer-id), [Filter by campaign name](#filter-by-campaign-name), [Filter by voucher type](#filter-by-voucher-type), [Filter if the code is a referral code](#filter-if-the-code-is-a-referral-code), [Filter by parent object ID](#filter-by-parent-object-id), [Filter by related object ID](#filter-by-related-object-id), [Filter by publication source ID](#filter-by-publication-source-id) | - -## redemption -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `id`, `-id`, `voucher_code`, `-voucher_code`, `tracking_id`, `-tracking_id`, `customer_id`, `-customer_id`, `created_at`, `-created_at` | -| fields
`array` |

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:

FieldDefinitionExample Export
idUnique redemption ID.r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8
objectObject being exported; by default redemption.redemption
dateTimestamp in ISO 8601 format representing the date and time when the voucher was redeemed.2022-03-23T08:52:24.867Z
voucher_codeUnique voucher code redeemed.WELCOME100
campaignParent campaign name of voucher if applicable.Summer Discounts 20% off
promotion_tier_idpromo_Mwy9XpA0TLctSGriM5kum0qp
customer_idUnique customer ID of redeeming customer.cust_nk0N1uNQ1YnupAoJGOgvsODC
customer_source_idUnique source ID of redeeming customer.name.lastname@email.com
customer_nameCustomer name.John Smith
tracking_idtrack_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy
order_amountTotal order amount before applying all discounts.1000
gift_amountGift credits used for redemption.10
loyalty_points12
resultTells you whether the redemption succeeded.SUCCESS, FAILURE
failure_codeInternal Voucherify code for reason why redemption failed.invalid_customer
failure_messageA human-readable message providing a short description explaining why the redemption failed.Customer must be a holder of a loyalty card.
metadataReturns all redemption metadata.Response will include all redemption metadata.
metadata.XWhere 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
Available values: `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` | -| filters
`object` |

Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:

| - -## customer -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `name`, `-name`, `id`, `-id`, `email`, `-email`, `source_id`, `-source_id`, `created_at`, `-created_at`, `updated_at`, `-updated_at` | -| fields
`array` |

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:

FieldDefinitionExample Export
nameCustomer name.John Smith
idUnique customer ID.cust_J1CDUdbqn5Exva8ASWk1Fq0j
descriptionAn arbitrary string that you can attach to a customer object.Customer requesting to be added to VIP tier.
emailCustomer's email.name.lastname@email.com
source_idUnique custom customer identifier.name.lastname@email.com
created_atTimestamp in ISO 8601 format representing the date and time when the customer was created.2022-02-03T13:10:11.928Z
address_cityCityHouston
address_stateStateTX
address_line_1First line of customer's address.72738 Main St
address_line_2Second line of customer's address.Bld 2, Apt 4
address_countryCountryUnited States of America
address_postal_codePostal code (ZIP code)77042-4143
redemptions_total_redeemedTotal customer redemptions.5
redemptions_total_failedTotal customer failed redemptions.2
redemptions_total_succeededTotal customer succeeded redemptions.3
redemptions_total_rolled_backTotal customer redemptions that were rolled back.3
redemptions_total_rollback_failedTotal customer redemptions that were unsuccessfully rolled back.2
redemptions_total_rollback_succeededTotal customer redemptions that were successfully rolled back.1
orders_total_amountTotal sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places.10000 (represents $100)
orders_total_countTotal number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places.2
orders_average_amountAverage amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places.50
orders_last_order_amountHow much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places.50
orders_last_order_dateWhen was the last customer order; timestamp in ISO 8601 format representing the date and time.2022-02-03T13:17:30.630Z
loyalty_pointsSum of customer's loyalty points to go across all loyalty cards.
loyalty_referred_customersHow many customers were referred by this customer.
updated_atTimestamp in ISO 8601 format representing the date and time when the customer was updated.2022-02-14T14:10:14.305Z
phoneCustomer's phone number.+1 (294) 752-1846
birthdayCustomer's birthday.2022-01-01
birthdateCustomer's birthdate.2022-04-29
metadataReturns all customer metadata.Response will include all customer metadata.
metadata.XWhere 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
Available values: `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` | -| filters
`object` |

Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:

| - -## points expiration -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `expires_at`, `-expires_at` | -| fields
`array` |

Array of strings containing the data that was exported. These fields define the headers in the CSV file.

The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
idLoyalty points bucket ID.lopb_Wl1o3EjJIHSNjvO5BDLy4z1n
campaign_idCampaign ID of the parent loyalty campaign.camp_7s3uXI44aKfIk5IhmeOPr6ic
voucher_idVoucher ID of the parent loyalty card.v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655
statusStatus of the loyalty points bucket.ACTIVE or INACTIVE
expires_atTimestamp in ISO 8601 format representing the date when the points expire.2022-06-30
pointsNumber of points.1000
Available values: `id,campaign_id,voucher_id,status,expires_at,points` | -| filters |

Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:

Any of: [Filter by campaign ID](#filter-by-campaign-id), [Filter by voucher ID](#filter-by-voucher-id) | - -## gift card transactions -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `-created_at`, `created_at` | -| fields
`array` |

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:

FieldDefinitionExample Export
idUnique transaction ID.vtx_0cb7811f1c07765800
typeTransaction type.- CREDITS_REMOVAL
- CREDITS_ADDITION
- CREDITS_REFUND
- CREDITS_REDEMPTION
source_idUnique transaction source ID.8638
reasonContains the reason for the transaction if one was included originally.
balanceThe gift card balance after the transaction.
amountThe 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.
created_atTimestamp in ISO 8601 format representing the date and time when the transaction was created.2022-03-09T09:16:32.521Z
voucher_idUnique Voucher ID.v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
campaign_idParent campaign ID.camp_FNYR4jhqZBM9xTptxDGgeNBV
sourceChannel through which the transaction was initiated.API
detailsMore detailed information stored in the form of a JSON.Provides more details related to the transaction in the form of an object.
Available values: `id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details` | -| filters | See: [Filter by voucher ID](#filter-by-voucher-id) | - -## loyalty card transactions -| Attributes | Description | -|:-----|:--------| -| order
`string` |

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

Available values: `-created_at`, `created_at` | -| fields
`array` |

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:

FieldDefinitionExample Export
idUnique transaction ID assigned by Voucherify.vtx_0cb7811f1c07765800
typeTransaction type.- POINTS_EXPIRATION
- POINTS_ADDITION
- POINTS_REMOVAL
- POINTS_TRANSFER_OUT
- POINTS_ACCRUAL
- POINTS_REFUND
- POINTS_REDEMPTION
source_idCustom source ID of the transaction if one was included originally.source_id_custom
reasonContains the reason for the transaction if one was included originally.
balanceThe loyalty card balance after the transaction.
amountThe amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction.
created_atTimestamp in ISO 8601 format representing the date and time when the transaction was created.2022-03-09T09:16:32.521Z
voucher_idUnique Voucher ID.v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
campaign_idParent campaign ID.camp_FNYR4jhqZBM9xTptxDGgeNBV
sourceChannel through which the transaction was initiated.- API
- voucherify-web-ui
- Automation
detailsMore detailed information stored in the form of a JSON.Provides more details related to the transaction in the form of an object.
related_transaction_idUnique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card.vtx_0c9afe802593b34b80
Available values: `id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,details,related_transaction_id` | -| filters | See: [Filter by voucher ID](#filter-by-voucher-id) | - -## Filter by status -| Attributes | Description | -|:-----|:--------| -| status | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by order source ID -| Attributes | Description | -|:-----|:--------| -| source_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by order amount -| Attributes | Description | -|:-----|:--------| -| amount | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +## Export +All of: -## Filter by order total amount -| Attributes | Description | -|:-----|:--------| -| total_amount | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by order discount amount -| Attributes | Description | -|:-----|:--------| -| discount_amount | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by order total discount amount -| Attributes | Description | -|:-----|:--------| -| total_discount_amount | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by order items discount amount -| Attributes | Description | -|:-----|:--------| -| items_discount_amount | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by failure code -| Attributes | Description | -|:-----|:--------| -| failure_code | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by result -| Attributes | Description | -|:-----|:--------| -| result | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by customer ID -| Attributes | Description | -|:-----|:--------| -| customer_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by campaign name -| Attributes | Description | -|:-----|:--------| -| campaign_name | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter by voucher type -| Attributes | Description | -|:-----|:--------| -| voucher_type | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | - -## Filter if the code is a referral code -| Attributes | Description | -|:-----|:--------| -| is_referral_code | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +1. [ExportBase](#exportbase) +2. Any of: [Export Vouchers](#export-vouchers), [Export Redemptions](#export-redemptions), [Export Customers](#export-customers), [Export Publications](#export-publications), [Export Orders](#export-orders), [Export Points Expirations](#export-points-expirations), [Export Vouchers Transactions Expiration](#export-vouchers-transactions-expiration) -## Filter by parent object ID +## ExportBase | Attributes | Description | |:-----|:--------| -| parent_object_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| id
`string` |

Unique export ID.

| +| object
`string` |

The type of object being represented. This object stores information about the export.

Available values: `export` | +| created_at
`string` |

Timestamp representing the date and time when the export was scheduled in ISO 8601 format.

| +| status
`string` |

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.

Available values: `SCHEDULED`, `IN_PROGRESS`, `DONE`, `ERROR` | +| channel
`string` |

The channel through which the export was triggered.

| +| result
`object,null` |

Contains the URL of the CSV file.

| +| user_id
`string,null` |

Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE.

| -## Filter by related object ID +## Export Vouchers | Attributes | Description | |:-----|:--------| -| related_object_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| exported_object
`string` |

The type of object to be exported.

Available values: `voucher` | +| parameters
`object` |
AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Voucher Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Voucher Fields
filters

Filter conditions.

See: Export Voucher Filters
| -## Filter by publication source ID +## Export Redemptions | Attributes | Description | |:-----|:--------| -| source_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| exported_object
`string` |

The type of object to be exported.

Available values: `redemption` | +| parameters
`object` |

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Redemption Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Redemption Fields
filters

Filter conditions.

See: Export Redemption Filters
| -## Filter by campaign ID +## Export Customers | Attributes | Description | |:-----|:--------| -| campaign_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| exported_object
`string` |

The type of object to be exported.

Available values: `customer` | +| parameters
`object` |

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Customer Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Customer Fields
filters

Filter conditions.

See: Export Customer Filters
| -## Filter by voucher ID +## Export Publications | Attributes | Description | |:-----|:--------| -| voucher_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| exported_object
`string` |

The type of object to be exported.

Available values: `publication` | +| parameters
`object` |

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Publication Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Publication Fields
filters

Filter conditions.

See: Export Publication Filters
| -## Filter by voucher ID +## Export Orders | Attributes | Description | |:-----|:--------| -| voucher_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| exported_object
`string` |

The type of object to be exported.

Available values: `order` | +| parameters
`object` |

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Order Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Order Fields
filters

Filter conditions.

See: Export Order Filters
| -## Filter by voucher ID +## Export Points Expirations | Attributes | Description | |:-----|:--------| -| voucher_id | See: [Filter by conditions](#filter-by-conditions) | -| junction | See: [Logical Operator Between Filters](#logical-operator-between-filters) | +| exported_object
`string` |

The type of object to be exported.

Available values: `points_expiration` | +| parameters
`object` |

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Points Expiration Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Points Expiration Fields
filters

Filter conditions.

See: Export Points Expiration Filters
| -## Filter by conditions +## Export Vouchers Transactions Expiration | Attributes | Description | |:-----|:--------| -| conditions
`object` |

Data filters used to narrow the data records to be returned in the result.

AttributesDescription
$in
array

Array of resource values that should be included in the results. (multiple values)

$not_in
array

Array of resource values that should be included in the results. (multiple values)

$is
string

Value is exactly this value. (single value)

$is_not
string

Results omit this value. (single value)

$has_value
string

Value is NOT null. The value for this parameter is an empty string.

$is_unknown
string

Value is null. The value for this parameter is an empty string.

$starts_with
string

Value starts with the specified string.

$ends_with
string

Value ends with the specified string.

| +| exported_object
`string` |

The type of object to be exported.

Available values: `voucher_transactions` | +| parameters
`object` |

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

AttributesDescription
order

How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.

See: Export Voucher Transactions Order
fields
array

Array of strings containing the data in the export. These fields define the headers in the CSV file.

Array of Export Voucher Transactions Fields
filters

Filter conditions.

See: Export Voucher Transactions Filters
| -## Logical Operator Between Filters -

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.

+## Export Voucher Order +Available values: `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` + +## Export Voucher Fields +Available values: `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` + +## Export Voucher Filters +| Attributes | Description | +|:-----|:--------| +| junction |

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.

See: [Junction](#junction) | +| code | See: [Field Conditions](#field-conditions) | +| voucher_type | See: [Field Conditions](#field-conditions) | +| value | See: [Field Conditions](#field-conditions) | +| discount_type | See: [Field Conditions](#field-conditions) | +| campaign | See: [Field Conditions](#field-conditions) | +| category | See: [Field Conditions](#field-conditions) | +| start_date | See: [Field Conditions](#field-conditions) | +| expiration_date | See: [Field Conditions](#field-conditions) | +| gift_balance | See: [Field Conditions](#field-conditions) | +| loyalty_balance | See: [Field Conditions](#field-conditions) | +| redemption_quantity | See: [Field Conditions](#field-conditions) | +| redemption_count | See: [Field Conditions](#field-conditions) | +| active | See: [Field Conditions](#field-conditions) | +| qr_code | See: [Field Conditions](#field-conditions) | +| bar_code | See: [Field Conditions](#field-conditions) | +| metadata | See: [Field Conditions](#field-conditions) | +| id | See: [Field Conditions](#field-conditions) | +| is_referral_code | See: [Field Conditions](#field-conditions) | +| created_at | See: [Field Conditions](#field-conditions) | +| updated_at | See: [Field Conditions](#field-conditions) | +| validity_timeframe_interval | See: [Field Conditions](#field-conditions) | +| validity_timeframe_duration | See: [Field Conditions](#field-conditions) | +| validity_day_of_week | See: [Field Conditions](#field-conditions) | +| discount_amount_limit | See: [Field Conditions](#field-conditions) | +| campaign_id | See: [Field Conditions](#field-conditions) | +| additional_info | See: [Field Conditions](#field-conditions) | +| customer_id | See: [Field Conditions](#field-conditions) | +| discount_unit_type | See: [Field Conditions](#field-conditions) | +| discount_unit_effect | See: [Field Conditions](#field-conditions) | +| customer_source_id | See: [Field Conditions](#field-conditions) | -Available values: `AND`, `OR` - -## Filter by conditions -| Attributes | Description | -|:-----|:--------| -| conditions
`object` |

Data filters used to narrow the data records to be returned in the result.

AttributesDescription
$in
array

Array of resource values that should be included in the results. (multiple values)

$not_in
array

Array of resource values that should be included in the results. (multiple values)

$is
integer

Value is exactly this value. (single value)

$is_not
integer

Results omit this value. (single value)

$has_value
string

Value is NOT null. The value for this parameter is an empty string.

$is_unknown
string

Value is null. The value for this parameter is an empty string.

$more_than
integer

Value is more than the specified number.

$more_than_equal
integer

Value is more than or equal to the specified number.

$less_than
integer

Value is less than the specified number.

$less_than_equal
integer

Value is less than or equal to the specified number.

| - -## Filter by conditions -| Attributes | Description | -|:-----|:--------| -| conditions
`object` |

Data filters used to narrow the data records to be returned in the result.

AttributesDescription
$is
string

Value is exactly this value. (single value)

$is_not
string

Results omit this value. (single value)

$has_value
string

Value is NOT null. The value for this parameter is an empty string.

$is_unknown
string

Value is null. The value for this parameter is an empty string.

| +## Export Redemption Order +Available values: `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` + +## Export Redemption Fields +Available values: `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` + +## Export Redemption Filters +| Attributes | Description | +|:-----|:--------| +| junction | See: [Junction](#junction) | +| id | See: [Field Conditions](#field-conditions) | +| object | See: [Field Conditions](#field-conditions) | +| date | See: [Field Conditions](#field-conditions) | +| voucher_code | See: [Field Conditions](#field-conditions) | +| campaign | See: [Field Conditions](#field-conditions) | +| promotion_tier_id | See: [Field Conditions](#field-conditions) | +| customer_id | See: [Field Conditions](#field-conditions) | +| customer_source_id | See: [Field Conditions](#field-conditions) | +| customer_name | See: [Field Conditions](#field-conditions) | +| tracking_id | See: [Field Conditions](#field-conditions) | +| order_amount | See: [Field Conditions](#field-conditions) | +| gift_amount | See: [Field Conditions](#field-conditions) | +| loyalty_points | See: [Field Conditions](#field-conditions) | +| result | See: [Field Conditions](#field-conditions) | +| failure_code | See: [Field Conditions](#field-conditions) | +| failure_message | See: [Field Conditions](#field-conditions) | +| metadata | See: [Field Conditions](#field-conditions) | + +## Export Customer Order +Available values: `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` + +## Export Customer Fields +Available values: `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` + +## Export Customer Filters +| Attributes | Description | +|:-----|:--------| +| junction | See: [Junction](#junction) | +| name | See: [Field Conditions](#field-conditions) | +| id | See: [Field Conditions](#field-conditions) | +| description | See: [Field Conditions](#field-conditions) | +| email | See: [Field Conditions](#field-conditions) | +| source_id | See: [Field Conditions](#field-conditions) | +| created_at | See: [Field Conditions](#field-conditions) | +| address_city | See: [Field Conditions](#field-conditions) | +| address_state | See: [Field Conditions](#field-conditions) | +| address_line_1 | See: [Field Conditions](#field-conditions) | +| address_line_2 | See: [Field Conditions](#field-conditions) | +| address_country | See: [Field Conditions](#field-conditions) | +| address_postal_code | See: [Field Conditions](#field-conditions) | +| redemptions_total_redeemed | See: [Field Conditions](#field-conditions) | +| redemptions_total_failed | See: [Field Conditions](#field-conditions) | +| redemptions_total_succeeded | See: [Field Conditions](#field-conditions) | +| redemptions_total_rolled_back | See: [Field Conditions](#field-conditions) | +| redemptions_total_rollback_failed | See: [Field Conditions](#field-conditions) | +| redemptions_total_rollback_succeeded | See: [Field Conditions](#field-conditions) | +| orders_total_amount | See: [Field Conditions](#field-conditions) | +| orders_total_count | See: [Field Conditions](#field-conditions) | +| orders_average_amount | See: [Field Conditions](#field-conditions) | +| orders_last_order_amount | See: [Field Conditions](#field-conditions) | +| orders_last_order_date | See: [Field Conditions](#field-conditions) | +| loyalty_points | See: [Field Conditions](#field-conditions) | +| loyalty_referred_customers | See: [Field Conditions](#field-conditions) | +| updated_at | See: [Field Conditions](#field-conditions) | +| phone | See: [Field Conditions](#field-conditions) | +| birthday | See: [Field Conditions](#field-conditions) | +| metadata | See: [Field Conditions](#field-conditions) | +| birthdate | See: [Field Conditions](#field-conditions) | + +## Export Publication Order +Available values: `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` + +## Export Publication Fields +Available values: `voucher_code`, `customer_id`, `customer_source_id`, `date`, `channel`, `campaign`, `is_winner`, `metadata` + +## Export Publication Filters +| Attributes | Description | +|:-----|:--------| +| junction | See: [Junction](#junction) | +| voucher_code | See: [Field Conditions](#field-conditions) | +| customer_id | See: [Field Conditions](#field-conditions) | +| customer_source_id | See: [Field Conditions](#field-conditions) | +| date | See: [Field Conditions](#field-conditions) | +| channel | See: [Field Conditions](#field-conditions) | +| campaign | See: [Field Conditions](#field-conditions) | +| is_winner | See: [Field Conditions](#field-conditions) | +| metadata | See: [Field Conditions](#field-conditions) | + +## Export Order Order +Available values: `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` + +## Export Order Fields +Available values: `id`, `source_id`, `created_at`, `updated_at`, `status`, `amount`, `discount_amount`, `items_discount_amount`, `total_discount_amount`, `total_amount`, `customer_id`, `referrer_id`, `metadata` + +## Export Order Filters +| Attributes | Description | +|:-----|:--------| +| junction | See: [Junction](#junction) | +| id | See: [Field Conditions](#field-conditions) | +| source_id | See: [Field Conditions](#field-conditions) | +| created_at | See: [Field Conditions](#field-conditions) | +| updated_at | See: [Field Conditions](#field-conditions) | +| status | See: [Field Conditions](#field-conditions) | +| amount | See: [Field Conditions](#field-conditions) | +| discount_amount | See: [Field Conditions](#field-conditions) | +| items_discount_amount | See: [Field Conditions](#field-conditions) | +| total_discount_amount | See: [Field Conditions](#field-conditions) | +| total_amount | See: [Field Conditions](#field-conditions) | +| customer_id | See: [Field Conditions](#field-conditions) | +| referrer_id | See: [Field Conditions](#field-conditions) | +| metadata | See: [Field Conditions](#field-conditions) | + +## Export Points Expiration Order +Available values: `id`, `-id`, `campaign_id`, `-campaign_id`, `voucher_id`, `-voucher_id`, `points`, `-points`, `status`, `-status`, `expires_at`, `-expires_at` + +## Export Points Expiration Fields +Available values: `id`, `campaign_id`, `voucher_id`, `points`, `status`, `expires_at` + +## Export Points Expiration Filters +| Attributes | Description | +|:-----|:--------| +| junction | See: [Junction](#junction) | +| id | See: [Field Conditions](#field-conditions) | +| campaign_id | See: [Field Conditions](#field-conditions) | +| voucher_id | See: [Field Conditions](#field-conditions) | +| points | See: [Field Conditions](#field-conditions) | +| status | See: [Field Conditions](#field-conditions) | +| expires_at | See: [Field Conditions](#field-conditions) | + +## Export Voucher Transactions Order +Available values: `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` + +## Export Voucher Transactions Fields +Available values: `id`, `campaign_id`, `voucher_id`, `type`, `source_id`, `reason`, `source`, `balance`, `amount`, `related_transaction_id`, `created_at`, `details` + +## Export Voucher Transactions Filters +| Attributes | Description | +|:-----|:--------| +| junction | See: [Junction](#junction) | +| id | See: [Field Conditions](#field-conditions) | +| campaign_id | See: [Field Conditions](#field-conditions) | +| voucher_id | See: [Field Conditions](#field-conditions) | +| type | See: [Field Conditions](#field-conditions) | +| source_id | See: [Field Conditions](#field-conditions) | +| reason | See: [Field Conditions](#field-conditions) | +| source | See: [Field Conditions](#field-conditions) | +| balance | See: [Field Conditions](#field-conditions) | +| amount | See: [Field Conditions](#field-conditions) | +| related_transaction_id | See: [Field Conditions](#field-conditions) | +| created_at | See: [Field Conditions](#field-conditions) | +| details | See: [Field Conditions](#field-conditions) | + +## Junction +Available values: `and`, `AND`, `or`, `OR` + +## Field Conditions +| Attributes | Description | +|:-----|:--------| +| conditions |

Data filters used to narrow the data records to be returned in the result.

See: [Filters Condition](#filters-condition) | + +## Filters Condition +| Attributes | Description | +|:-----|:--------| +| $in | See: [Any](#any) | +| $not_in | See: [Any](#any) | +| $is | See: [Any](#any) | +| $is_days_ago | See: [Any](#any) | +| $is_days_in_future | See: [Any](#any) | +| $is_not | See: [Any](#any) | +| $has_value | See: [Any](#any) | +| $is_unknown | See: [Any](#any) | +| $contains | See: [Any](#any) | +| $not_contain | See: [Any](#any) | +| $starts_with | See: [Any](#any) | +| $ends_with | See: [Any](#any) | +| $more_than | See: [Any](#any) | +| $less_than | See: [Any](#any) | +| $more_than_ago | See: [Any](#any) | +| $less_than_ago | See: [Any](#any) | +| $more_than_future | See: [Any](#any) | +| $less_than_future | See: [Any](#any) | +| $more_than_equal | See: [Any](#any) | +| $less_than_equal | See: [Any](#any) | +| $after | See: [Any](#any) | +| $before | See: [Any](#any) | +| $count | See: [Any](#any) | +| $count_less | See: [Any](#any) | +| $count_more | See: [Any](#any) | + +## Any +Any of: + + 1. Array any of: string, number, object + 2. string + 3. number + 4. object [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 bc8014711..30b3ff6b7 100644 --- a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md +++ b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md @@ -11,10 +11,88 @@ order: 3 ## Stackable Redemptions Response Body | Attributes | Description | |:-----|:--------| -| redemptions
`array` | | +| redemptions
`array` | Array any of: [Discount Voucher](#discount-voucher), [Loyalty Card Voucher](#loyalty-card-voucher), [Gift Card](#gift-card), [Promotion Tier](#promotion-tier) | | parent_redemption
`object` |

This is an object representing a stacked redemption.

Stacked Redemption

AttributesDescription
id
string

Unique redemption ID.

Example:

r_0bc92f81a6801f9bca

object
string

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

date
string

Timestamp in ISO 8601 format indicating when the redemption occured.

Example:

2022-10-03T12:24:58.008Z

customer_id
string

Unique customer ID of the redeeming customer.

Example:

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

tracking_id
string

Hashed customer source ID.

Example:

track_fxEMFiLowFHg==

metadata
object

The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.

result
string

Redemption result.

Available values: SUCCESS, FAILURE
order

Defines the details of the order that is related to the redemption.

See: Order
customer
object

Defines the customer making the stacked redemption.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

related_object_type
string

Defines the related object.

Available values: redemption
related_object_id
string

Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption.

voucher
null
| | order |

Contains the order details associated with the redemption.

See: [Order](#order) | +## Discount Voucher +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique redemption ID.

**Example:**

r_0bc92f81a6801f9bca

| +| object
`string` |

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

| +| date
`string` |

Timestamp in ISO 8601 format indicating when the redemption occured.

**Example:**

2022-10-03T12:24:58.008Z

| +| customer_id
`string` |

Unique customer ID of the redeeming customer.

**Example:**

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

| +| tracking_id
`string` |

Hashed customer source ID.

**Example:**

track_fxEMFiLowFHg==

| +| metadata
`object` |

The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.

| +| redemption
`string` |

Unique redemption ID of the parent redemption.

**Example:**

r_0c656311b5878a2031

| +| result
`string` |

Redemption result.

Available values: `SUCCESS`, `FAILURE` | +| order |

Defines the details of the order that is related to the redemption.

See: [Order object](#order-object) | +| channel
`object` |

Defines the details of the channel through which the redemption was issued.

AttributesDescription
channel_id
string

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.

Example:

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

channel_type
string

The source of the channel for the redemption. A USER corresponds to the Voucherify Dashboard and an API corresponds to the API.

Available values: USER, API
| +| customer
`object` |

Defines the customer that is related to the redemption.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| related_object_type
`string` |

Defines the related object.

Related ObjectDefinition
voucherEither a discount voucher, gift card, or loyalty card.
Available values: `voucher` | +| related_object_id
`string` |

Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.

| +| voucher |

Defines the details of the voucher being redeemed.

See: [Voucher Object](#voucher-object) | + +## Loyalty Card Voucher +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique redemption ID.

**Example:**

r_0bc92f81a6801f9bca

| +| object
`string` |

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

| +| date
`string` |

Timestamp in ISO 8601 format indicating when the redemption occured.

**Example:**

2022-10-03T12:24:58.008Z

| +| customer_id
`string` |

Unique customer ID of the redeeming customer.

**Example:**

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

| +| tracking_id
`string` |

Hashed customer source ID.

**Example:**

track_fxEMFiLowFHg==

| +| metadata
`object` |

The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.

| +| amount
`integer` |

Number of points being redeemed for a reward.

| +| redemption
`string` |

Unique redemption ID of the parent redemption.

**Example:**

r_0c656311b5878a2031

| +| result
`string` |

Redemption result.

Available values: `SUCCESS`, `FAILURE` | +| order |

Defines the details of the order that is related to the redemption.

See: [Order object](#order-object) | +| channel
`object` |

Defines the details of the channel through which the redemption was issued.

AttributesDescription
channel_id
string

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.

Example:

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

channel_type
string

The source of the channel for the redemption. A USER corresponds to the Voucherify Dashboard and an API corresponds to the API.

Available values: USER, API
| +| customer
`object` |

Defines the customer redeeming the reward.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| related_object_type
`string` |

Defines the related object. i.e. voucher.

Available values: `voucher` | +| related_object_id
`string` |

Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.

| +| voucher |

Defines the details of the voucher being redeemed.

See: [Voucher Object](#voucher-object) | +| reward |

Defines the reward being redeemed.

Any of: [Pay with Points Reward](#pay-with-points-reward), [Product Material Reward](#product-material-reward), [SKU Material Reward](#sku-material-reward), [Digital Reward](#digital-reward) | +| loyalty_card
`object` |

Stores the number of points being subtracted from the loyalty card for the reward redemption.

AttributesDescription
points
integer

Number of points being subtracted from the loyalty card for the reward redemption.

| + +## Gift Card +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique redemption ID.

**Example:**

r_0bc92f81a6801f9bca

| +| object
`string` |

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

| +| date
`string` |

Timestamp in ISO 8601 format indicating when the redemption occured.

**Example:**

2022-10-03T12:24:58.008Z

| +| customer_id
`string` |

Unique customer ID of the redeeming customer.

**Example:**

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

| +| tracking_id
`string` |

Hashed customer source ID.

**Example:**

track_fxEMFiLowFHg==

| +| metadata
`object` |

The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.

| +| amount
`integer` |

The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00).

| +| redemption
`string` |

Unique redemption ID of the parent redemption.

**Example:**

r_0c656311b5878a2031

| +| result
`string` |

Redemption result.

Available values: `SUCCESS`, `FAILURE` | +| order |

Defines the details of the order that is related to the redemption.

See: [Order object](#order-object) | +| channel
`object` |

Defines the details of the channel through which the redemption was issued.

AttributesDescription
channel_id
string

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.

Example:

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

channel_type
string

The source of the channel for the redemption. A USER corresponds to the Voucherify Dashboard and an API corresponds to the API.

Available values: USER, API
| +| customer
`object` |

Defines the customer redeeming the gift card.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| related_object_type
`string` |

Defines the related object.

Related ObjectDefinition
voucherEither a discount voucher, gift card, or loyalty card.
Available values: `voucher` | +| related_object_id
`string` |

Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.

| +| voucher |

Defines the details of the voucher being redeemed.

See: [Voucher Object](#voucher-object) | +| gift
`object` |

Contains the amount being subtracted from the gift card for the redemption.

AttributesDescription
amount
integer

The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00).

| + +## Promotion Tier +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique redemption ID.

**Example:**

r_0bc92f81a6801f9bca

| +| object
`string` |

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

| +| date
`string` |

Timestamp in ISO 8601 format indicating when the redemption occured.

**Example:**

2022-10-03T12:24:58.008Z

| +| customer_id
`string` |

Unique customer ID of the redeeming customer.

**Example:**

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

| +| tracking_id
`string` |

Hashed customer source ID.

**Example:**

track_fxEMFiLowFHg==

| +| metadata
`object` |

The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.

| +| redemption
`string` |

Unique redemption ID of the parent redemption.

**Example:**

r_0c656311b5878a2031

| +| result
`string` |

Redemption result.

Available values: `SUCCESS`, `FAILURE` | +| order |

Defines the details of the order that is related to the redemption.

See: [Order object](#order-object) | +| channel
`object` |

Defines the details of the channel through which the redemption was issued.

AttributesDescription
channel_id
string

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.

Example:

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

channel_type
string

The source of the channel for the redemption. A USER corresponds to the Voucherify Dashboard and an API corresponds to the API.

Available values: USER, API
| +| customer
`object` |

Defines the customer that is related to the redemption.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| related_object_type
`string` |

Defines the related object.

Available values: `promotion_tier` | +| related_object_id
`string` |

Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier.

| +| voucher
`null` | | +| promotion_tier |

Contains details of the promotion tier and the parent campaign.

See: [Promotion Tier Object](#promotion-tier-object) | + ## Order | Attributes | Description | |:-----|:--------| @@ -40,11 +118,309 @@ order: 3 | object
`string` |

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

| | redemptions |

Lists details related to the redemption

See: [Stacked Redemption](#stacked-redemption) | +## Order object +

This is an object representing an order with calculated discounts applied using the voucher code.

+ +One of: + +[Order object - Effect: Apply to order](#order-object---effect:-apply-to-order), [Order object - Effect: Apply to items](#order-object---effect:-apply-to-items) + +## Voucher Object +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Assigned by the Voucherify API, identifies the voucher.

**Example:**

v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV

| +| code
`string` |

A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.

**Example:**

WVPblOYX

| +| campaign
`string` |

A unique campaign name, identifies the voucher's parent campaign.

**Example:**

Gift Card Campaign

| +| campaign_id
`string` |

Assigned by the Voucherify API, identifies the voucher's parent campaign.

**Example:**

camp_FNYR4jhqZBM9xTptxDGgeNBV

| +| category
`string` |

Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.

| +| category_id
`string` |

Unique category ID assigned by Voucherify.

**Example:**

cat_0bb343dee3cdb5ec0c

| +| categories
`array` |

Contains details about the category.

Array of [Category Object](#category-object) | +| type
`string` |

Defines the type of voucher.

Available values: `GIFT_VOUCHER`, `DISCOUNT_VOUCHER`, `LOYALTY_CARD` | +| discount | One of: [Amount](#amount), [Percentage](#percentage), [Fixed](#fixed), [Unit, single item](#unit-single-item), [Unit, multiple items](#unit-multiple-items), [Shipping](#shipping) | +| gift
`object` |

Object representing gift parameters. Child attributes are present only if type is GIFT_VOUCHER. Defaults to null.

AttributesDescription
amount
integer

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.

Example:

10000

balance
integer

Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

Example:

500

effect
string

Defines how the credits are applied to the customer's order.

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
| +| loyalty_card
`object` |

Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD. Defaults to null.

AttributesDescription
points
integer

Total points incurred over lifespan of loyalty card.

Example:

7000

balance
integer

Points available for reward redemption.

Example:

6970

next_expiration_date
string

The next closest date when the next set of points are due to expire.

Example:

2023-05-30

next_expiration_points
integer

The amount of points that are set to expire next.

| +| start_date
`string` |

Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is inactive before this date.

**Example:**

2021-12-01T00:00:00.000Z

| +| expiration_date
`string` |

Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date.

**Example:**

2021-12-31T00:00:00.000Z

| +| validity_timeframe
`object` |

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.

AttributesDescription
duration
string

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.

Example:

PT1H

interval
string

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.

Example:

P2D

| +| validity_day_of_week
`array` |

Integer array corresponding to the particular days of the week in which the voucher is valid.

Available values: `0`, `1`, `2`, `3`, `4`, `5`, `6` | +| active
`boolean` |

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.

| +| additional_info
`string` |

An optional field to keep any extra textual information about the code such as a code description and details.

| +| metadata
`object` |

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
`object` |

Stores links to images of QR and barcode that correspond to an encrypted voucher code.

AttributesDescription
qr
object

Stores Quick Response (QR) representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==

url
string

URL to QR code

Optional: Attach query parameters to base URL to customize the image of the encrypted voucher code.

  • size: integer value from 1 to 100
  • format: string, either png (default) or svg
Example:

https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D

barcode
object

Stores barcode representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==

url
string

URL to barcode

Optional: Attach query parameters to base URL to customize the image of the encrypted voucher code.

  • size: integer value from 1 to 100
  • format: string, either png (default) or svg
Example:

https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D

| +| is_referral_code
`boolean` |

Flag indicating whether this voucher is a referral code.

| +| created_at
`string` |

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

**Example:**

2021-12-22T10:13:06.487Z

| +| updated_at
`string` |

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

**Example:**

2021-12-22T10:14:45.316Z

| +| holder_id
`string` |

Unique customer ID of voucher owner.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| +| validation_rules_assignments
`object` |

Stores information about validation rules assigned to the voucher.

AttributesDescription
object
string

The type of object represented is by default list.

data_ref
string

Identifies the name of the attribute that contains the array of validation rule assignments.

data
array

Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule.

Array of:
AttributesDescription
id
string

Assigned by the Voucherify API, identifies the validation rule assignment.

Example:

asgm_N7t39epaQR2SkQcW

rule_id
string

Assigned by the Voucherify API, identifies the validation rule.

Example:

val_ssbxf1L9aKri

related_object_id
string

ID of the object from which the rule originates, can be the ID of the voucher itself or its parent campaign.

Example:

camp_AaP9MC1Y0GpBII84UTIuasvb

related_object_type
string

Which object does the rule originate from: the voucher itself or inherited from its parent campaign.

Example:

campaign

created_at
string

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

Example:

2022-02-14T15:12:06.817Z

object
string

The type of resource represented by the object. Default is validation_rules_assignment.

total
integer

Total number of validation rules assigned to the voucher.

| +| redemption
`object` |

Stores a summary of redemptions that have been applied to the voucher.

AttributesDescription
quantity
integer

How many times a voucher can be redeemed. A null value means unlimited.

redeemed_quantity
integer

How many times a voucher has already been redeemed.

Example:

1

redeemed_amount
integer

Total amount redeemed. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 balance is written as 10000.

Example:

100000

redeemed_points
integer

Total loyalty points redeemed.

Example:

100000

object
string

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
string

The endpoint where this list of redemptions can be accessed using a GET method. /v1/vouchers/{voucher_code}/redemptions

Example:

/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10

| +| publish
`object` |

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.

RequiredOptional
type:LOYALTY_CARDtype:DISCOUNT_VOUCHER
is_referral_code:truetype:GIFT_VOUCHER
AttributesDescription
object
string

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
integer

Publication events counter.

Example:

0

url
string

The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications

Example:

/v1/vouchers/WVPblOYX/publications?page=1&limit=10

| +| object
`string` |

The type of object represented by JSON. Default is voucher.

| + +## Pay with Points Reward +| Attributes | Description | +|:-----|:--------| +| customer
`object` |

Defines the customer redeeming the reward.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| assignment_id
`string` |

Unique reward assginment ID assigned by Voucherify.

**Example:**

rewa_YAIuU7AY6LNJVlUbRxSbNgiD

| +| id
`string` |

Unique reward ID assigned by Voucherify.

**Example:**

rew_INt3fGH3n7xIr3ZQcq4kkUZ1

| +| object
`string` |

Type of object represented is reward.

| +| name
`string` |

Reward name.

| +| created_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was created.

**Example:**

2022-10-03T12:24:58.008Z

| +| updated_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was updated.

**Example:**

2022-10-03T12:24:58.008Z

| +| parameters
`object` |

These are parameters representing a Pay with Points (COIN) reward.

AttributesDescription
coin
object

Defines the ratio by mapping the number of loyalty points in points_ratio to a predefined cash amount in exchange_ratio.

AttributesDescription
exchange_ratio
integer

The cash equivalent of the points defined in the points_ratio property.

points_ratio
integer

The number of loyalty points that will map to the predefined cash amount defined by the exchange_ratio property.

| +| type
`string` |

Reward type

Available values: `COIN` | + +## Product Material Reward +| Attributes | Description | +|:-----|:--------| +| customer
`object` |

Defines the customer redeeming the reward.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| assignment_id
`string` |

Unique reward assginment ID assigned by Voucherify.

**Example:**

rewa_YAIuU7AY6LNJVlUbRxSbNgiD

| +| product |

Details of the product redeemed as a reward.

See: [Product Object](#product-object) | +| id
`string` |

Unique reward ID assigned by Voucherify.

**Example:**

rew_INt3fGH3n7xIr3ZQcq4kkUZ1

| +| object
`string` |

Type of object represented is reward.

| +| name
`string` |

Reward name.

| +| created_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was created.

**Example:**

2022-10-03T12:24:58.008Z

| +| updated_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was updated.

**Example:**

2022-10-03T12:24:58.008Z

| +| parameters
`object` |

These are parameters representing a material reward.

AttributesDescription
product
object

Defines the product redeemed as a reward.

AttributesDescription
id
string

Unique product ID assignedy by Voucherify of the product.

Example:

prod_0b2c2ddf35150b83bb

sku_id
null
| +| type
`string` |

Reward type

Available values: `MATERIAL` | + +## SKU Material Reward +| Attributes | Description | +|:-----|:--------| +| customer
`object` |

Defines the customer redeeming the reward.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| assignment_id
`string` |

Unique reward assginment ID assigned by Voucherify.

**Example:**

rewa_YAIuU7AY6LNJVlUbRxSbNgiD

| +| product |

Details of the SKU's parent product redeemed as a reward.

See: [Product Object](#product-object) | +| sku |

Details of the SKU redeemed as a reward.

See: [SKU Object](#sku-object) | +| id
`string` |

Unique reward ID assigned by Voucherify.

**Example:**

rew_INt3fGH3n7xIr3ZQcq4kkUZ1

| +| object
`string` |

Type of object represented is reward.

| +| name
`string` |

Reward name.

| +| created_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was created.

**Example:**

2022-10-03T12:24:58.008Z

| +| updated_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was updated.

**Example:**

2022-10-03T12:24:58.008Z

| +| parameters
`object` |

These are parameters representing a material reward.

AttributesDescription
product
object

Defines the SKU redeemed as a reward.

AttributesDescription
id
string

Unique product ID assignedy by Voucherify of the SKU's parent.

sku_id
string

Unique SKU ID assigned by Voucherify of the SKU redeemed as a reward.

| +| type
`string` |

Reward type

Available values: `MATERIAL` | + +## Digital Reward +| Attributes | Description | +|:-----|:--------| +| customer
`object` |

Defines the customer redeeming the reward.

AttributesDescription
id
string

The unique ID of a customer that is assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

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
object

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
string

Type of object represented is customer.

| +| assignment_id
`string` |

Unique reward assginment ID assigned by Voucherify.

**Example:**

rewa_YAIuU7AY6LNJVlUbRxSbNgiD

| +| voucher |

Voucher object.

See: [Voucher Object](#voucher-object) | +| id
`string` |

Unique reward ID assigned by Voucherify.

**Example:**

rew_INt3fGH3n7xIr3ZQcq4kkUZ1

| +| object
`string` |

Type of object represented is reward.

| +| name
`string` |

Reward name.

| +| created_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was created.

**Example:**

2022-10-03T12:24:58.008Z

| +| updated_at
`string` |

Timestamp in ISO 8601 format indicating when the reward was updated.

**Example:**

2022-10-03T12:24:58.008Z

| +| parameters
`object` |

These are parameters representing a digital reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.

AttributesDescription
campaign

Defines the source of the digital reward.

Any of: Discount Voucher, Gift Card, Loyalty Card
| +| type
`string` |

Reward type

Available values: `CAMPAIGN` | + +## Promotion Tier Object +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique promotion tier ID.

**Example:**

promo_63fYCt81Aw0h7lzyRkrGZh9p

| +| created_at
`string` |

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

**Example:**

2021-12-15T11:34:01.333Z

| +| updated_at
`string` |

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

**Example:**

2022-02-09T09:20:05.603Z

| +| name
`string` |

Name of the promotion tier.

| +| banner
`string` |

Text to be displayed to your customers on your website.

| +| action
`object` |

Contains details about the discount applied by the promotion tier.

AttributesDescription
discount

The type of discount that will be applied to a customer's order.

Any of: Amount, Percentage, Fixed, Unit, single item, Unit, multiple items, Shipping
| +| metadata
`object` |

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
`integer` |

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
`object` |

Contains details about promotion tier's parent campaign.

AttributesDescription
id
string

Unique campaign ID.

start_date
string

Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.

Example:

2022-09-22T00:00:00.000Z

expiration_date
string

Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.

Example:

2022-09-30T00:00:00.000Z

validity_timeframe
object

Recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.

AttributesDescription
interval
string

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
string

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
array

Integer array corresponding to the particular days of the week in which the campaign is valid.

  • 0 Sunday
  • 1 Monday
  • 2 Tuesday
  • 3 Wednesday
  • 4 Thursday
  • 5 Friday
  • 6 Saturday
active
boolean

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 endpoint.

  • true indicates an active campaign
  • false indicates an inactive campaign
category_id
string

Unique category ID that this campaign belongs to.

Example:

cat_0b688929a2476386a6

object
string

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

| +| campaign_id
`string` |

Promotion tier's parent campaign's unique ID.

| +| active
`boolean` |

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.

| +| start_date
`string` |

Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is inactive before this date.

**Example:**

2022-09-23T00:00:00.000Z

| +| expiration_date
`string` |

Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is inactive after this date.

**Example:**

2022-09-26T00:00:00.000Z

| +| validity_timeframe
`object` |

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.

AttributesDescription
interval
string

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
string

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
`array` |

Integer array corresponding to the particular days of the week in which the promotion tier is valid.

| +| summary
`object` |

Contains statistics about promotion tier redemptions and orders.

AttributesDescription
redemptions
object

Contains statistics about promotion tier redemptions.

AttributesDescription
total_redeemed
integer

Number of times the promotion tier was redeemed.

orders
object

Contains statistics about orders related to the promotion tier.

AttributesDescription
total_amount
integer

Sum of order totals.

total_discount_amount
integer

Sum of total discount applied using the promotion tier.

| +| object
`string` |

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

| +| validation_rule_assignments | See: [Validation Rule Assignments](#validation-rule-assignments) | +| category_id
`string` |

Promotion tier category ID.

**Example:**

cat_0c9da30e7116ba6bba

| +| categories |

Details about the category assigned to the promotion tier.

See: [Category Object](#category-object) | + ## Stacked Redemption | Attributes | Description | |:-----|:--------| | redemption_ID
`object` |

The property name is the unique parent redemption ID; i.e. r_0ba186c4824e4881e1. This object contains information about the redemption of multiple incentives.

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.

related_object_id
string

Unique ID of the parent redemption.

Example:

r_0ba186c4824e4881e1

stacked
array

Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.

| +## Order object - Effect: Apply to order +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique order ID, assigned by Voucherify.

**Example:**

ord_OLWs41pBk7VFn6ZTyX9U6keh

| +| source_id
`string` |

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
`string` |

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

**Example:**

2022-10-06T11:40:48.705Z

| +| updated_at
`string` |

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

**Example:**

2022-10-06T11:47:20.760Z

| +| status
`string` |

Order status.

Available values: `CREATED`, `PAID`, `CANCELED`, `FULFILLED` | +| amount
`integer` |

Order amount before applying any discount.

| +| discount_amount
`integer` |

Sum of all order-level discounts applied to the order.

| +| total_discount_amount
`integer` |

Sum of all order-level AND all product-specific discounts applied to the order.
total_discount_amount = discount_amount + items_discount_amount

| +| total_amount
`integer` |

Order amount after applying all the discounts.
total_amount = amount - total_discount_amount

| +| applied_discount_amount
`integer` |

This field shows the order-level discount applied.

| +| total_applied_discount_amount
`integer` |

This field sums up all order-level and all product-specific discounts applied in a particular request.

| +| items
`array` |

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.

Array of:
AttributesDescription
object
string

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

product_id
string

A unique identifier that represents the product and is assigned by Voucherify.

Example:

prod_5h0wc453_1

sku_id
string

A unique identifier that represents the SKU and is assigned by Voucherify.

Example:

sku_prod_5h0wc453_1_1

quantity
integer

Quantity of the item in the cart.

amount
integer

Represents a total pre-discount amount of order item (price * quantity).

price
integer

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
integer

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.
subtotal_amount=amount-discount_amount

product
object

This object stores more information about the related product.

AttributesDescription
id
string

A unique identifier that represents the product and is assigned by Voucherify.

Example:

prod_5h0wc453_1

source_id
string

A unique product identifier from your inventory system.

Example:

illy-arabica

name
string

Product name.

Example:

Brewing System

price
integer

Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

sku
object

This object stores more information about the related SKU.

AttributesDescription
id
string

A unique identifier that represents the SKU and is assigned by Voucherify.

Example:

sku_prod_5h0wc453_1_1

source_id
string

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku
string

SKU name.

price
integer

Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

| +| metadata
`object` |

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
`object` |

Object containing information about the customer that is making the purchase.

AttributesDescription
id
string

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the customer object.

| +| referrer
`object` |

Object containing information about the referrer.

AttributesDescription
id
string

Unique referrer ID, who referred the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the referrer object.

| +| customer_id
`string` |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| +| referrer_id
`string` |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| +| object
`string` |

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

| +| redemptions |

Lists details related to the redemption.

See: [Unstacked Redemption](#unstacked-redemption) | + +## Order object - Effect: Apply to items +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique order ID, assigned by Voucherify.

**Example:**

ord_OLWs41pBk7VFn6ZTyX9U6keh

| +| source_id
`string` |

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
`string` |

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

**Example:**

2022-10-06T11:40:48.705Z

| +| updated_at
`string` |

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

**Example:**

2022-10-06T11:47:20.760Z

| +| status
`string` |

Order status.

Available values: `CREATED`, `PAID`, `CANCELED`, `FULFILLED` | +| amount
`integer` |

Order amount before applying any discount.

| +| items_discount_amount
`integer` |

Sum of all product-specific discounts applied to the order.
sum(items, i => i.discount_amount)

| +| total_discount_amount
`integer` |

Sum of all order-level AND all product-specific discounts applied to the order.

| +| total_amount
`integer` |

Order amount after applying all the discounts.
total_amount = amount - total_discount_amount

| +| items_applied_discount_amount
`integer` |

Sum of all product-specific discounts applied.

| +| total_applied_discount_amount
`integer` |

Sum of all order-level AND all product-specific discounts applied to the order.

| +| items
`array` |

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.

Array of:
AttributesDescription
object
string

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

product_id
string

A unique identifier that represents the product and is assigned by Voucherify.

Example:

prod_5h0wc453_1

sku_id
string

A unique identifier that represents the SKU and is assigned by Voucherify.

Example:

sku_prod_5h0wc453_1_1

quantity
integer

Quantity of the item in the cart.

amount
integer

Represents a total pre-discount amount of order item (price * quantity).

discount_amount
integer

The item-level discount applied to the item.

applied_discount_amount
integer

The item-level discount applied to the item.

price
integer

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
integer

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.
subtotal_amount=amount-discount_amount

product
object

This object stores more information about the related product.

AttributesDescription
id
string

A unique identifier that represents the product and is assigned by Voucherify.

Example:

prod_5h0wc453_1

source_id
string

A unique product identifier from your inventory system.

Example:

illy-arabica

name
string

Product name.

Example:

Brewing System

price
integer

Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

sku
object

This object stores more information about the related SKU.

AttributesDescription
id
string

A unique identifier that represents the SKU and is assigned by Voucherify.

Example:

sku_prod_5h0wc453_1_1

source_id
string

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku
string

SKU name.

price
integer

Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

| +| metadata
`object` |

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
`object` |

Object containing information about the customer that is making the purchase.

AttributesDescription
id
string

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the customer object.

| +| referrer
`object` |

Object containing information about the referrer.

AttributesDescription
id
string

Unique referrer ID, who referred the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the referrer object.

| +| customer_id
`string` |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| +| referrer_id
`string` |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| +| object
`string` |

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

| +| redemptions |

Lists details related to the redemption.

See: [Unstacked Redemption](#unstacked-redemption) | + +## Category Object +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique category ID assigned by Voucherify.

| +| name
`string` |

Category name.

| +| hierarchy
`integer` |

Category hierarchy.

| +| created_at
`string` |

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

**Example:**

2022-07-14T10:45:13.156Z

| +| updated_at
`string` |

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

**Example:**

2022-08-16T10:52:08.094Z

| +| object
`string` |

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

| + +## Amount +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Applies an amount discount.

| +| amount_off
`integer` |

Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the amount being calculated by the formula, i.e. the amount_off_formula parameter is present in the amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the amount off.

**Example:**

100

| +| amount_off_formula
`string` |

Formula used to calculate the discount.

| +| aggregated_amount_limit
`integer` |

Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:

| +| effect
`string` |

Defines how the discount is applied to the customer's order. The discount effects are defined as follows:

Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS`, `APPLY_TO_ITEMS_PROPORTIONALLY`, `APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY`, `APPLY_TO_ITEMS_BY_QUANTITY` | + +## Percentage +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Applies a percentage discount.

| +| amount_limit
`string` |

Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.

| +| aggregated_amount_limit
`integer` |

Maximum discount amount per order. This value is definable for the APPLY_TO_ITEMS discount effect. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600.

| +| percent_off
`integer` |

Percent taken off the subtotal amount. In case of the percent being calculated by the formula, i.e. the percent_off_formula parameter is present in the percent definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the percent off.

| +| percent_off_formula
`string` |

Formula used to calculate the discount.

| +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | + +## Fixed +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Sets a fixed total on cart or item(s) and then calculates the discount to apply.

| +| fixed_amount
`integer` |

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.

**Example:**

1000

| +| fixed_amount_formula
`string` |

Formula used to calculate the discounted price of an item or a new order total.

| +| effect
`string` |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets 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.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | + +## Unit, single item +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Applies a full value discount to item(s).

| +| unit_off
`number` |

Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the unit_off_formula parameter is present in the unit definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.

**Example:**

1

| +| unit_off_formula
`string` |

Formula used to calculate the number of units.

| +| unit_type
`string` |

The product deemed as free, chosen from the product inventory (e.g. time, items).

**Example:**

prod_f1r5Tpr0DuC7

| +| effect
`string` |

Defines how the unit is added to the customer's order.

Available values: `ADD_NEW_ITEMS`, `ADD_MISSING_ITEMS` | + +## Unit, multiple items +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Applies a full value discount to item(s).

| +| effect
`string` |

Defines the effect for adding multiple item types.

| +| units
`array` |

Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.

Array of:
AttributesDescription
unit_off
integer

Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the unit_off_formula parameter is present in the unit definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.

Example:

1

unit_off_formula
string

Formula used to calculate the number of units.

unit_type
string

The product deemed as free, chosen from the product inventory (e.g. time, items).

Example:

prod_f1r5Tpr0DuC7

effect
string

Defines how the unit is added to the customer's order.

Available values: ADD_NEW_ITEMS, ADD_MISSING_ITEMS
| + +## Shipping +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Applies a full value discount to item(s).

| +| unit_off
`number` |

Subtracts 1 shipping item from the subtotal.

| +| unit_type
`string` |

The shipping product deemed as free.

| +| effect
`string` |

Defines how the unit is added to the customer's order.

| + +## Product Object +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique product ID.

**Example:**

prod_f1r5Tpr0DuC7

| +| source_id
`string` |

Unique product source ID.

**Example:**

productSourceID16

| +| name
`string` |

Unique user-defined product name.

**Example:**

T-shirt

| +| price
`integer` |

Product unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

| +| attributes
`array` |

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.

| +| metadata
`object` |

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
`string` |

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
`string` |

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

**Example:**

2022-05-23T06:52:55.008Z

| +| updated_at
`string` |

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

**Example:**

2022-05-23T09:24:07.405Z

| +| object
`string` |

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

| + +## SKU Object +| Attributes | Description | +|:-----|:--------| +| id
`string` |

A unique identifier that represents the SKU and is assigned by Voucherify.

**Example:**

sku_0b1621b319d248b79f

| +| source_id
`string` |

A unique SKU identifier from your inventory system.

**Example:**

sku_source_id_4

| +| product_id
`string` |

The parent product's unique ID.

**Example:**

prod_0b15f6b9f650c16990

| +| sku
`string` |

Unique user-defined SKU name.

**Example:**

Large Pink Shirt

| +| price
`integer` |

SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

| +| currency
`string` |

SKU price currency.

**Example:**

USD

| +| attributes
`object` |

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
`string` |

The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image.

| +| metadata
`object` |

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
`string` |

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

**Example:**

2022-05-17T10:36:30.187Z

| +| updated_at
`string` |

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

**Example:**

2022-05-17T10:55:09.137Z

| +| object
`string` |

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

| + +## Discount Voucher +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique parent campaign ID of reward.

**Example:**

camp_0dJG7cCAjquzcxWmZ634bA0C

| +| type
`string` |

Campaign type.

Available values: `DISCOUNT_COUPONS` | + +## Gift Card +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique parent campaign ID of reward.

**Example:**

camp_0dJG7cCAjquzcxWmZ634bA0C

| +| balance
`integer` |

The amount credited to the gift card as a reward expressed as the smallest currency unit (that is, 100 cents for $1.00).

| +| type
`string` |

Campaign type.

Available values: `GIFT_VOUCHERS` | + +## Loyalty Card +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Unique parent campaign ID of reward.

**Example:**

camp_0dJG7cCAjquzcxWmZ634bA0C

| +| balance
`integer` |

The number of loyalty points that is added to the loyalty card as a reward.

| +| type
`string` |

Campaign type.

Available values: `LOYALTY_PROGRAM` | + +## Validation Rule Assignments +| Attributes | Description | +|:-----|:--------| +| object
`string` |

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

| +| data_ref
`string` |

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

| +| data
`array` |

A dictionary that contains an array of validation rule assignments.

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

Total number of validation rule assignments.

| + +## Unstacked Redemption +| Attributes | Description | +|:-----|:--------| +| 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 +| Attributes | Description | +|:-----|:--------| +| id
`string` |

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| +| rule_id
`string` |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| +| 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.

| + [block:html] { "html": "" diff --git a/docs/reference-docs/VALIDATIONS-API-Validation-Object.md b/docs/reference-docs/VALIDATIONS-API-Validation-Object.md index 565f9915a..f6d434075 100644 --- a/docs/reference-docs/VALIDATIONS-API-Validation-Object.md +++ b/docs/reference-docs/VALIDATIONS-API-Validation-Object.md @@ -70,7 +70,7 @@ Any of: ## Included Items | Attributes | Description | |:-----|:--------| -| data
`array` |

Contains array of items to which the discount can apply.

| +| data
`array` |

Contains array of items to which the discount can apply.

Array any of: [Product Collection](#product-collection), [Product Collection for Unit Discount](#product-collection-for-unit-discount), [Product Collection for Fixed Amount Discount](#product-collection-for-fixed-amount-discount), [Product](#product), [Product for Unit Discount](#product-for-unit-discount), [Product for Fixed Amount Discount](#product-for-fixed-amount-discount), [SKU](#sku), [SKU for Unit Discount](#sku-for-unit-discount), [SKU for Amount Discount](#sku-for-amount-discount) | | total
`integer` |

Total number of objects defining included products, SKUs, or product collections.

| | data_ref
`string` |

Identifies the name of the attribute that contains the array of included objects.

| | object
`string` |

The type of object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary.

| @@ -78,7 +78,7 @@ Any of: ## Excluded Items | Attributes | Description | |:-----|:--------| -| data
`array` |

Contains array of items to which the discount cannot apply.

| +| data
`array` |

Contains array of items to which the discount cannot apply.

Array any of: [Product Collection](#product-collection), [Product](#product), [SKU](#sku) | | total
`integer` |

Total number of objects defining excluded products, SKUs, or product collections.

| | data_ref
`string` |

Identifies the name of the attribute that contains the array of excluded objects.

| | object
`string` |

The type of object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary.

| @@ -182,6 +182,128 @@ One of: | ttl_unit
`string` |

Defines the type of unit in which the session time is counted.

Available values: `HOURS`, `DAYS`, `MINUTES`, `SECONDS`, `MILLISECONDS`, `MICROSECONDS`, `NANOSECONDS` | | ttl
`integer` |

Value for the period of time that the session is active. Units for this parameter are defined by the session.ttl_unit parameter.

| +## Product Collection +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product collection.

| +| id
`string` |

Unique product collection ID assigned by Voucherify.

**Example:**

pc_4ndRXAsTOzwSdHcQcxf489uU

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | + +## Product Collection for Unit Discount +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product collection.

| +| id
`string` |

Unique product collection ID assigned by Voucherify.

**Example:**

pc_4ndRXAsTOzwSdHcQcxf489uU

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | +| quantity_limit
`integer` |

The maximum number of units allowed to be discounted per order line item.

| +| aggregated_quantity_limit
`integer` |

The maximum number of units allowed to be discounted combined across all matched order line items.

| + +## Product Collection for Fixed Amount Discount +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product collection.

| +| id
`string` |

Unique product collection ID assigned by Voucherify.

**Example:**

pc_4ndRXAsTOzwSdHcQcxf489uU

| +| strict
`boolean` | | +| price
`integer` |

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
`string` |

Formula used to calculate the discounted price of an item.

**Example:**

"IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)

| +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | + +## Product +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product.

| +| id
`string` |

Unique product ID assigned by Voucherify.

**Example:**

prod_0bae2dc5a090fd0184

| +| source_id
`string` |

The product ID from your inventory system.

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | + +## Product for Unit Discount +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product.

| +| id
`string` |

Unique product ID assigned by Voucherify.

**Example:**

prod_0bae2dc5a090fd0184

| +| source_id
`string` |

The product ID from your inventory system.

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | +| quantity_limit
`integer` |

The maximum number of units allowed to be discounted per order line item.

| +| aggregated_quantity_limit
`integer` |

The maximum number of units allowed to be discounted combined across all matched order line items.

| + +## Product for Fixed Amount Discount +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product.

| +| id
`string` |

Unique product ID assigned by Voucherify.

**Example:**

prod_0bae2dc5a090fd0184

| +| source_id
`string` |

The product ID from your inventory system.

| +| strict
`boolean` | | +| price
`integer` |

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
`string` |

Formula used to calculate the discounted price of an item.

**Example:**

IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)

| +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | + +## SKU +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product variant.

| +| id
`string` |

Unique SKU ID assigned by Voucherify.

**Example:**

sku_0b7d7dfb090be5c619

| +| source_id
`string` |

The source ID from your inventory system.

| +| product_id
`string` |

Parent product's unique ID assigned by Voucherify.

| +| product_source_id
`string` |

Parent product's source ID from your inventory system.

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | + +## SKU for Unit Discount +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product variant.

| +| id
`string` |

Unique SKU ID assigned by Voucherify.

**Example:**

sku_0b7d7dfb090be5c619

| +| source_id
`string` |

The source ID from your inventory system.

| +| product_id
`string` |

Parent product's unique ID assigned by Voucherify.

| +| product_source_id
`string` |

Parent product's source ID from your inventory system.

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | +| quantity_limit
`integer` |

The maximum number of units allowed to be discounted per order line item.

| +| aggregated_quantity_limit
`integer` |

The maximum number of units allowed to be discounted combined across all matched order line items.

| + +## SKU for Amount Discount +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product variant.

| +| id
`string` |

Unique SKU ID assigned by Voucherify.

**Example:**

sku_0b7d7dfb090be5c619

| +| source_id
`string` |

The source ID from your inventory system.

| +| product_id
`string` |

Parent product's unique ID assigned by Voucherify.

| +| product_source_id
`string` |

Parent product's source ID from your inventory system.

| +| strict
`boolean` | | +| price
`integer` |

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
`string` |

Formula used to calculate the discounted price of an item.

**Example:**

IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.2;6)

| +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY`, `APPLY_TO_CHEAPEST`, `APPLY_TO_MOST_EXPENSIVE` | + +## Product Collection +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product collection.

| +| id
`string` |

Unique product collection ID assigned by Voucherify.

**Example:**

pc_4ndRXAsTOzwSdHcQcxf489uU

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY` | + +## Product +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This product stores information about the product.

| +| id
`string` |

Unique product ID assigned by Voucherify.

**Example:**

prod_0bae2dc5a090fd0184

| +| source_id
`string` |

The product ID from your inventory system.

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY` | + +## SKU +| Attributes | Description | +|:-----|:--------| +| object
`string` |

This object stores information about the product variant.

| +| id
`string` |

Unique SKU ID assigned by Voucherify.

**Example:**

sku_0b7d7dfb090be5c619

| +| source_id
`string` |

The source ID from your inventory system.

| +| strict
`boolean` | | +| effect
`string` |

Defines how the discount is applied to the customer's order.

Available values: `APPLY_TO_EVERY` | + ## Order object - Effect: Apply to items | Attributes | Description | |:-----|:--------| diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 9d7264973..470f57629 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -41481,6 +41481,1732 @@ "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": "ExportBase", + "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" + }, "a_req_importCSV": { "type": "object", "title": "Import CSV file", @@ -81041,7 +82767,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_req_create_export_POST" + "$ref": "#/components/schemas/ExportsCreateRequestBody" } } } @@ -81052,7 +82778,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_obj_export_object" + "$ref": "#/components/schemas/ExportsCreateResponseBody" } } } @@ -81137,7 +82863,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_res_list_exports" + "$ref": "#/components/schemas/ExportsListResponseBody" }, "examples": { "List Exports": { @@ -81262,7 +82988,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_obj_export_object" + "$ref": "#/components/schemas/ExportsGetResponseBody" }, "examples": { "Get Export": { diff --git a/scripts/md-tables.ts b/scripts/md-tables.ts index 874e0c236..f70db227a 100644 --- a/scripts/md-tables.ts +++ b/scripts/md-tables.ts @@ -7,11 +7,11 @@ export const mdTables: [string, string?][] = [ ['5_obj_publication_object', 'PUBLICATIONS-API-Publication-Object.md'], ['6_res_validate_voucher', 'VALIDATIONS-API-Validation-Object.md'], ['7_obj_redemption_object', 'REDEMPTIONS-API-Redemption-Object.md'], - ['7_obj_rollback_redemption_object_extended', 'REDEMPTIONS-API-Rollback-Redemption-Object.md'], + ['7_obj_rollback_redemption_object_extended', 'REDEMPTIONS-API-Rollback-Redemption-Object.md'], ['19_res_redemptions_POST', 'STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md'], ['8_obj_loyalty_campaign_object', 'LOYALTIES-API-Loyalty-Campaign-Object.md'], ['8_obj_loyalty_card_object_non_expanded_categories', 'LOYALTIES-API-Loyalty-Card-Object.md'], - ['8_obj_earning_rule_object', 'LOYALTIES-API-Earning-Rule-Object.md'], + ['8_obj_earning_rule_object', 'LOYALTIES-API-Earning-Rule-Object.md'], ['8_obj_loyalty_tier_object', 'LOYALTIES-API-Loyalty-Tier-Object.md'], ['9_obj_customer_object', 'CUSTOMERS-API-Customer-Object.md'], ['9_obj_customer_activity_object', 'CUSTOMERS-API-Customer-Activity-Object.md'], @@ -25,9 +25,9 @@ export const mdTables: [string, string?][] = [ ['15_req_track_custom_event', 'EVENTS-API-Custom-Event-Object.md'], ['18_res_list_consents_GET', 'CONSENTS-API-Consents-Object.md'], ['17_obj_async_action_object', 'ASYNC-ACTIONS-API-Async-Action-Object.md'], - ['16_obj_export_object', 'EXPORTS-API-Export-Object.md'], + ['Export', 'EXPORTS-API-Export-Object.md'], ['20_obj_category_object', 'CATEGORIES-API-Category-Object.md'], ['21_obj_metadata_schema_object', 'METADATA-SCHEMAS-API-Metadata-Schema-Object.md'], ['22_obj_location_object', 'LOCATIONS-API-Location-Object.md'], ['23_obj_qualification_object', 'QUALIFICATIONS-API-Qualification-Object.md'] -]; \ No newline at end of file +]; diff --git a/scripts/src/schema-to-md-table.ts b/scripts/src/schema-to-md-table.ts index 71f05dfd1..69c2bf889 100644 --- a/scripts/src/schema-to-md-table.ts +++ b/scripts/src/schema-to-md-table.ts @@ -17,7 +17,7 @@ yup.addMethod( const nodeWithTitleAndPropertiesSchema = yup.object({ title: yup.string().optional(), - type: yup.string().oneOf(["object", "string", "array"]), + type: yup.string().oneOf(["object", "string", "array", "number"]), properties: yup.object({}), anyOf: yup.array().optional(), }); @@ -51,6 +51,8 @@ const anyOfSchema = yup ) .optional(); +const allOfSchema = anyOfSchema; + const propertySchema = yup.object({ type: yup.mixed().oneOfSchemas([yup.string(), yup.array().of(yup.string())]), properties: yup.object({}), @@ -69,12 +71,14 @@ const propertySchema = yup.object({ .optional(), oneOf: oneOfSchema, anyOf: anyOfSchema, + allOf: allOfSchema, items: itemsSchema, $ref: yup.string().optional(), }); interface Items extends yup.InferType {} interface AnyOf extends yup.InferType {} +interface AllOf extends yup.InferType {} interface OneOf extends yup.InferType {} export type Properties = Record; @@ -162,10 +166,16 @@ export default class SchemaToMarkdownTable { return { descriptionArr, relatedObjectsNames }; } - private renderAnyOfDescription(anyOf: AnyOf, level: number) { + private renderAnyOfDescription( + anyOf: AnyOf, + level: number, + skipAnyOf: boolean = false + ) { const descriptionArr = []; const relatedObjectsNames = []; - descriptionArr.push(`Any of:`); + if (!skipAnyOf) { + descriptionArr.push(`Any of:`); + } const nestedObjectsHtml = anyOf .map((item) => { if ( @@ -193,11 +203,117 @@ export default class SchemaToMarkdownTable { const { html, relatedObjects } = this.renderSchema(item, level + 1); relatedObjectsNames.push(...relatedObjects); return renderMarkdown(html); + } else if ("items" in item) { + const { html, relatedObjects } = this.renderSchema( + item, + level + 1, + true + ); + relatedObjectsNames.push(...relatedObjects); + return renderMarkdown(html); + } else if ( + "type" in item && + typeof item.type === "string" && + ["string", "number", "object"].includes(item.type) + ) { + return level ? item.type : renderMarkdown(item.type); + } + }) + .filter((i) => !!i); + descriptionArr.push(this.smartJoin(nestedObjectsHtml)); + return { descriptionArr, relatedObjectsNames }; + } + + private smartJoin(items: string[]): string { + const removeAllHtmlNesting = (html) => { + let letHtml = `${html}`; + let indexOfFirstMinoritySign = letHtml.indexOf("<"); + let indexOfFirstMajoritySign = letHtml.indexOf(">"); + while (indexOfFirstMinoritySign >= 0 && indexOfFirstMajoritySign >= 0) { + letHtml = `${letHtml.slice(0, indexOfFirstMinoritySign)}${letHtml.slice( + indexOfFirstMajoritySign + 1, + letHtml.length + )}`; + indexOfFirstMinoritySign = letHtml.indexOf("<"); + indexOfFirstMajoritySign = letHtml.indexOf(">"); + } + return letHtml; + }; + + if ( + items.filter((item) => item.at(0) === "<" && item.at(-1) === ">") + .length === items.length && + !items.find( + (item) => item.includes("") && item.includes("
") + ) + ) { + //all items are http tag, no table tag found + return items + .map((item, index) => { + return ` ${index + 1}. ${removeAllHtmlNesting(item)}`; + }) + .join("\n"); + } + //regular join + return items + .map((item, index) => { + if (!index) { + return item; + } + if (items[index - 1].at(0) === "<" && items[index - 1].at(-1) === ">") { + return item; + } + return `${this.redenderMode === RenderMode.List ? ", " : ""}${item}`; + }) + .join(""); + } + + private renderAllOfDescription(allOf: AnyOf, level: number) { + const descriptionArr = []; + const relatedObjectsNames = []; + descriptionArr.push(`All of:`); + const nestedObjectsHtml = allOf + .map((item) => { + if ( + "$ref" in item && + typeof item["$ref"] === "string" && + item["$ref"].startsWith("#/components/schemas/") + ) { + const nestedObjectName = item["$ref"].replace( + "#/components/schemas/", + "" + ); + if (typeof this.schemas[nestedObjectName] !== "object") { + return false; + } + relatedObjectsNames.push(nestedObjectName); + const title = (this.schemas[nestedObjectName].title || + nestedObjectName) as string; + if (this.redenderMode === RenderMode.List) { + return this.getMarkdownLinkToHeader(title); + } else { + const { html } = this.renderSchema(nestedObjectName, level + 1); + return renderMarkdown(html); + } + } else if ("properties" in item) { + const { html, relatedObjects } = this.renderSchema(item, level + 1); + relatedObjectsNames.push(...relatedObjects); + return renderMarkdown(html); + } else if ("anyOf" in item) { + const anyOf = anyOfSchema.validateSync(item["anyOf"]); + const { + descriptionArr: anyOfDescriptionArr, + relatedObjectsNames: anyOfRelatedObjectsNames, + } = this.renderAnyOfDescription(anyOf, level + 1); + relatedObjectsNames.push(...anyOfRelatedObjectsNames); + return anyOfDescriptionArr.join(" "); } }) .filter((i) => !!i); descriptionArr.push( - nestedObjectsHtml.join(this.redenderMode === RenderMode.List ? ", " : "") + nestedObjectsHtml + .map((row, index) => `${index + 1}. ${row}`) + .join(this.redenderMode === RenderMode.List ? `${EOL}` : "") ); return { descriptionArr, relatedObjectsNames }; } @@ -230,6 +346,14 @@ export default class SchemaToMarkdownTable { const { html, relatedObjects } = this.renderSchema(items, level + 1); relatedObjectsNames.push(...relatedObjects); descriptionArr.push(renderMarkdown(html)); + } else if ("anyOf" in items) { + const anyOf = anyOfSchema.validateSync(items.anyOf); + const { + descriptionArr: anyOfDescriptionArr, + relatedObjectsNames: anyOfRelatedObjectsNames, + } = this.renderAnyOfDescription(anyOf, level + 1, true); + relatedObjectsNames.push(...anyOfRelatedObjectsNames); + descriptionArr.push(`Array any of: ${anyOfDescriptionArr.join(" ")}`); } return { descriptionArr, relatedObjectsNames }; } @@ -263,6 +387,7 @@ export default class SchemaToMarkdownTable { enum: EnumProp, oneOf, anyOf, + allOf, items, type, $ref, @@ -289,6 +414,15 @@ export default class SchemaToMarkdownTable { relatedObjectsNames.push(...relatedObjectsNamesOneOff); } + if (allOf) { + const { + descriptionArr: descriptionArrAllOf, + relatedObjectsNames: relatedObjectsNamesAllOff, + } = this.renderAllOfDescription(allOf, level); + descriptionArr.push(...descriptionArrAllOf); + relatedObjectsNames.push(...relatedObjectsNamesAllOff); + } + if (anyOf) { const { descriptionArr: descriptionArrAnyOf, @@ -375,7 +509,8 @@ export default class SchemaToMarkdownTable { private renderSchema( schemaNameOrSchemaObject: string | object, - level: number = 0 + level: number = 0, + skipTitle: boolean = false ) { const schema = typeof schemaNameOrSchemaObject === "object" @@ -388,9 +523,9 @@ export default class SchemaToMarkdownTable { nodeWithTitleAndPropertiesSchema.validateSync(schema); const respopnseStrArr = []; - if (title) { + if (!skipTitle && title) { respopnseStrArr.push(`${"#".repeat(level + 2)} ${title}`); - } else { + } else if (!skipTitle) { if (typeof schemaNameOrSchemaObject === "string") { throw new Error(`Missing title for ${schemaNameOrSchemaObject} object`); } From edb1a1f3ab0fa0b984206ece530d896a22d229aa Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:33:09 +0200 Subject: [PATCH 3/5] Pz/types 011 - Loyalties (includes changes from 010) (#488) * in progress * Update OpenAPI.json * Update Changelog.md * fix * Update .gitignore * naming * naming * in progress * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * changelog * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * Update OpenAPI.json * added new ednpoint * descriptions * Update OpenAPI.json * change log * Update Changelog.md * Update Changelog.md * remove duplicates * Update EXPORTS-API-Export-Object.md * Update update-md-tables-in-doc.ts * LoyaltiesGetPointsExpirationResponseBody * Update Changelog.md * schemas * new endpoint * Update OpenAPI.json --- Changelog.md | 40 +- .../EXPORTS-API-Export-Object.md | 4 +- .../LOYALTIES-API-Create-Loyalty-Tiers.md | 14 + reference/OpenAPI.json | 932 ++++++++++++++---- scripts/update-md-tables-in-doc.ts | 10 +- 5 files changed, 792 insertions(+), 208 deletions(-) create mode 100644 docs/reference-docs/LOYALTIES-API-Create-Loyalty-Tiers.md diff --git a/Changelog.md b/Changelog.md index 7418bcfe8..110835c39 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,43 @@ # Changelog +## 20231011 + +#### New schemas: +- LoyaltiesCreateTiersRequestBody +- LoyaltiesCreateTiersResponseBody +- LoyaltiesGetRewardAssignmentResponseBody +- LoyaltiesGetRewardDetailsResponseBody +- LoyaltiesListTiersRequestQuery +- LoyaltiesListLoyaltyTierEarningRulesRequestQuery +- LoyaltiesGetTierResponseBody +- LoyaltiesListTiersResponseBody +- LoyaltiesListMemberLoyaltyTiersResponseBody +- LoyaltiesListLoyaltyTierEarningRulesResponseBody +- CreateLoyaltyTier +- LoyaltyTier +- MappingMultiply +- MappingFixed +- EarningRule + +#### Schemas changes +- GET /v1/loyalties/{campaignId}/tiers + - new response schema `LoyaltiesListTiersResponseBody` (old `8_res_list_loyalty_tiers`) +- GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} + - new response schema `LoyaltiesGetRewardAssignmentResponseBody` (old `4_obj_reward_assignment_object`) +- GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward + - new response schema `LoyaltiesGetRewardDetailsResponseBody` (old `4_obj_reward_object`) +- GET /v1/loyalties/{campaignId}/tiers/{tierId} + - new response schema `LoyaltiesGetTierResponseBody` (old `8_obj_loyalty_tier_object`) +- GET /v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules + - new response schema `LoyaltiesListLoyaltyTierEarningRulesResponseBody` (old `8_res_list_loyalty_tier_earning_rules`) +- GET /v1/loyalties/members/{memberId}/tiers + - new response schema `LoyaltiesListMemberLoyaltyTiersResponseBody` (old `8_res_get_member_loyalty_tier`) +- GET /v1/loyalties/{campaignId}/members/{memberId}/points-expiration + - New response schema: `LoyaltiesGetPointsExpirationResponseBody` (old one: `8_res_get_points_expiration`) + +#### New endpoint +- POST /v1/loyalties/{campaignId}/tiers + ## 20231009 @@ -52,8 +90,6 @@ - /v1/loyalties/{campaignId}/members/{memberId}/points-expiration - new response schema `LoyaltiesGetPointsExpirationResponseBody` (old `8_res_get_points_expiration`) - - ## 20230831 - Exports API **New models** diff --git a/docs/reference-docs/EXPORTS-API-Export-Object.md b/docs/reference-docs/EXPORTS-API-Export-Object.md index 204062922..54ba16769 100644 --- a/docs/reference-docs/EXPORTS-API-Export-Object.md +++ b/docs/reference-docs/EXPORTS-API-Export-Object.md @@ -11,10 +11,10 @@ order: 1 ## Export All of: -1. [ExportBase](#exportbase) +1. [Export Base](#export-base) 2. Any of: [Export Vouchers](#export-vouchers), [Export Redemptions](#export-redemptions), [Export Customers](#export-customers), [Export Publications](#export-publications), [Export Orders](#export-orders), [Export Points Expirations](#export-points-expirations), [Export Vouchers Transactions Expiration](#export-vouchers-transactions-expiration) -## ExportBase +## Export Base | Attributes | Description | |:-----|:--------| | id
`string` |

Unique export ID.

| diff --git a/docs/reference-docs/LOYALTIES-API-Create-Loyalty-Tiers.md b/docs/reference-docs/LOYALTIES-API-Create-Loyalty-Tiers.md new file mode 100644 index 000000000..aea320165 --- /dev/null +++ b/docs/reference-docs/LOYALTIES-API-Create-Loyalty-Tiers.md @@ -0,0 +1,14 @@ +--- +title: Create Loyalty Tiers +type: endpoint +categorySlug: voucherify-api +slug: create-loyalty-tiers +parentDocSlug: loyalties-api +hidden: false +order: 44 +--- +[block:html] +{ + "html": "" +} +[/block] diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 470f57629..1b9cda175 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39240,42 +39240,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": [ { @@ -39336,6 +39406,9 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", + "x-stoplight": { + "id": "w4ci1ljqva0r1" + }, "type": "object", "properties": { "id": { @@ -39473,6 +39546,9 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", + "x-stoplight": { + "id": "6vxql7fnzg2zp" + }, "type": "string", "enum": [ "order.paid", @@ -39487,6 +39563,9 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", + "x-stoplight": { + "id": "r5o8m0sdli7fq" + }, "type": "object", "properties": { "type": { @@ -39518,6 +39597,9 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", + "x-stoplight": { + "id": "1z7lk7z1lp5af" + }, "type": "object", "properties": { "type": { @@ -39569,6 +39651,9 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", + "x-stoplight": { + "id": "ekudxr430edgk" + }, "type": "object", "properties": { "type": { @@ -39620,6 +39705,9 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", + "x-stoplight": { + "id": "4ccw4gz8b47u5" + }, "type": "object", "properties": { "type": { @@ -39677,6 +39765,9 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", + "x-stoplight": { + "id": "pqsn9otpzyot9" + }, "type": "object", "properties": { "type": { @@ -39743,6 +39834,9 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", + "x-stoplight": { + "id": "8pg4o23daepkb" + }, "type": "object", "properties": { "type": { @@ -39809,6 +39903,9 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", + "x-stoplight": { + "id": "duxy5qw36h5ph" + }, "type": "object", "properties": { "type": { @@ -40045,109 +40142,6 @@ } } }, - "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." - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, "LoyaltiesListCardTransactionsRequestQuery": { "title": "Loyalties List Card Transactions Request Query", "type": "object", @@ -40774,25 +40768,32 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique reward assignment ID, assigned by Voucherify." }, "reward_id": { - "type": "string" + "type": "string", + "description": "Associated reward ID." }, "related_object_id": { - "type": "string" + "type": "string", + "description": "Related object ID to which the reward was assigned." }, "related_object_type": { - "type": "string" + "type": "string", + "description": "Related object type to which the reward was assigned." }, "parameters": { "type": "object", + "description": "Defines the cost of the reward.", "properties": { "loyalty": { "type": "object", + "description": "Defines the equivalent points value of the reward.", "properties": { "points": { - "type": "integer" + "type": "integer", + "description": "The number of points required to redeem the reward." } }, "required": [ @@ -40802,13 +40803,18 @@ } }, "created_at": { - "type": "string" + "type": "string", + "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", + "format": "date-time" }, "updated_at": { - "type": "string" + "type": "string", + "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", + "format": "date-time" }, "object": { - "type": "string" + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the reward assignment." } }, "required": [ @@ -40819,44 +40825,55 @@ ] }, "Reward": { - "title": "Reward", "allOf": [ { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique reward ID, assigned by Voucherify." }, "name": { - "type": "string" + "type": "string", + "description": "Reward name." }, "stock": { - "type": "integer" + "type": "integer", + "description": "Configurable for material rewards. The number of units of the product that you want to share as reward." }, "redeemed": { - "type": "integer" + "type": "integer", + "description": "Defines the number of already invoked (successful) reward redemptions." }, "attributes": { "type": "object", + "description": "These properties are configurable for material rewards.", "properties": { "image_url": { - "type": "string" + "type": "string", + "description": "The HTTPS URL pointing to the .png or .jpg file." }, "description": { - "type": "string" + "type": "string", + "description": "An arbitrary string that you can attach to a material reward." } } }, "created_at": { - "type": "string" + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format." }, "updated_at": { - "type": "string" + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format." }, "object": { "type": "string", "default": "reward", - "pattern": "reward" + "pattern": "reward", + "description": "The type of object represented by the JSON. This object stores information about the reward." } }, "required": [ @@ -40870,6 +40887,20 @@ } ] }, + "RewardType": { + "title": "Reward Type", + "anyOf": [ + { + "$ref": "#/components/schemas/RewardTypeCampaign" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + } + ] + }, "RewardTypeCoin": { "title": "Reward Type Coin", "type": "object", @@ -40878,25 +40909,30 @@ "type": "string", "enum": [ "COIN" - ] + ], + "description": "Reward type." }, "parameters": { "type": "object", "required": [ "coin" ], + "description": "Defines how the reward is generated.", "properties": { "coin": { "type": "object", "required": [ "exchange_ratio" ], + "description": "Defines the ratio by mapping the number of loyalty points in points_ratio to a predefined cash amount in exchange_ratio.", "properties": { "exchange_ratio": { - "type": "number" + "type": "number", + "description": "The cash equivalent of the points defined in the points_ratio property." }, "points_ratio": { - "type": "integer" + "type": "integer", + "description": "The number of loyalty points that will map to the predefined cash amount defined by the exchange_ratio property." } } } @@ -40916,13 +40952,15 @@ "type": "string", "enum": [ "MATERIAL" - ] + ], + "description": "Reward type." }, "parameters": { "type": "object", "required": [ "product" ], + "description": "Defines how the reward is generated.", "properties": { "product": { "type": "object", @@ -40930,15 +40968,18 @@ "id", "sku" ], + "description": "Contains information about the product given as a reward.", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique product ID, assigned by Voucherify." }, "sku": { "type": [ "string", "null" - ] + ], + "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward." } } } @@ -40958,13 +40999,15 @@ "type": "string", "enum": [ "CAMPAIGN" - ] + ], + "description": "Reward type." }, "parameters": { "type": "object", "required": [ "campaign" ], + "description": "Defines how the reward is generated.", "properties": { "campaign": { "type": "object", @@ -40972,12 +41015,15 @@ "id", "type" ], + "description": "Objects stores information about the campaign related to the reward.", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify." }, "balance": { - "type": "integer" + "type": "integer", + "description": "The incremental amout to be added to the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "type": { "type": "string", @@ -40986,7 +41032,8 @@ "PROMOTION", "GIFT_VOUCHERS", "REFERRAL_PROGRAM" - ] + ], + "description": "Campaign type." } } } @@ -40998,20 +41045,6 @@ "parameters" ] }, - "RewardType": { - "title": "Reward Type", - "anyOf": [ - { - "$ref": "#/components/schemas/RewardTypeCampaign" - }, - { - "$ref": "#/components/schemas/RewardTypeCoin" - }, - { - "$ref": "#/components/schemas/RewardTypeCoin" - } - ] - }, "LoyaltiesAddOrRemoveCardBalanceResponseBody": { "title": "Loyalties Add Or Remove Card Balance Response Body", "type": "object", @@ -41739,7 +41772,7 @@ "type": "object" }, "ExportBase": { - "title": "ExportBase", + "title": "Export Base", "type": "object", "additionalProperties": false, "properties": { @@ -43207,6 +43240,470 @@ ], "title": "Any" }, + "LoyaltiesCreateTiersRequestBody": { + "title": "Loyalties Create Tiers Request Body", + "x-stoplight": { + "id": "i1emmwlaqp7lt" + }, + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" + }, + { + "type": "object", + "properties": { + "metadata": { + "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format.", + "type": "object" + } + } + } + ] + } + }, + "LoyaltiesCreateTiersResponseBody": { + "title": "Loyalties Create Tiers Response Body", + "x-stoplight": { + "id": "ix7g5mnuwqsp6" + }, + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "LoyaltiesGetRewardAssignmentResponseBody": { + "$ref": "#/components/schemas/RewardAssignment", + "x-stoplight": { + "id": "fnbbaq9l1l9it" + } + }, + "LoyaltiesGetRewardDetailsResponseBody": { + "$ref": "#/components/schemas/Reward", + "x-stoplight": { + "id": "44hds9u0hhukf" + } + }, + "LoyaltiesListTiersRequestQuery": { + "title": "Loyalties List Tiers Request Query", + "x-stoplight": { + "id": "d5sluzqkxu8km" + }, + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + "page": { + "type": "integer", + "description": "Which page of results to return." + }, + "order": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ], + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + } + }, + "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { + "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", + "x-stoplight": { + "id": "zs0z1cyyzac9u" + }, + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + "page": { + "type": "integer", + "description": "Which page of results to return." + } + } + }, + "LoyaltiesGetTierResponseBody": { + "$ref": "#/components/schemas/LoyaltyTier", + "x-stoplight": { + "id": "hzcsijl2b4d5o" + } + }, + "LoyaltiesListTiersResponseBody": { + "title": "Loyalties List Tiers Response Body", + "x-stoplight": { + "id": "kw06g2szvv479" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "description": "This is an object representing a loyalty tier. Loyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltiesListMemberLoyaltyTiersResponseBody": { + "title": "Loyalties List Member Loyalty Tiers Response Body", + "x-stoplight": { + "id": "s3zpgud510xl6" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "EarningRule": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" + }, + { + "type": "object", + "properties": { + "validation_rule_id": { + "type": [ + "string", + "null" + ], + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date.\n\n- `true` indicates an active earning rule\n- `false` indicates an inactive earning rule" + } + }, + "required": [ + "validation_rule_id", + "updated_at", + "active" + ] + } + ] + }, + "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { + "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", + "x-stoplight": { + "id": "i180zbh3ffwaa" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of earning rule objects." + }, + "data": { + "type": "array", + "description": "Contains array of earning rule objects.", + "items": { + "$ref": "#/components/schemas/EarningRule" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltyTierBase": { + "title": "Loyalty Tier Base", + "x-stoplight": { + "id": "3af9422223696" + }, + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "earning_rules": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule." + }, + "rewards": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of reward IDs and their points mapping for the given reward." + }, + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." + }, + "to": { + "type": "integer", + "description": "Top points threshold value." + } + } + } + }, + "required": [ + "name", + "points" + ] + }, + "LoyaltyTier": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID." + }, + "campaign_id": { + "type": "string", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in points.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." + }, + "to": { + "type": "integer", + "description": "Top points threshold value." + } + } + } + } + }, + "expiration": { + "type": "object", + "description": "Defines loyalty tier expiration date.", + "properties": { + "customer_id": { + "type": "string" + }, + "campaign_id": { + "type": "string" + }, + "tier_id": { + "type": "string" + }, + "start_date": { + "type": "string", + "format": "date-time" + }, + "expiration_date": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "customer_id", + "campaign_id", + "tier_id", + "created_at" + ] + }, + "object": { + "type": "string", + "enum": [ + "loyalty_tier" + ], + "description": "The type of object represented by JSON. This object stores information about the loyalty." + } + }, + "required": [ + "id", + "campaign_id", + "metadata", + "created_at", + "config", + "object" + ] + } + ] + }, + "MappingMultiply": { + "title": "MappingMultiply", + "x-stoplight": { + "id": "7zrwgr2oqh4tj" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "MULTIPLY" + ], + "description": "Type of calculation." + }, + "multiplier": { + "type": "number", + "description": "Multiplication factor used to multiply the points to obtain the mapped points." + } + } + }, + "MappingFixed": { + "title": "MappingFixed", + "x-stoplight": { + "id": "86eksegayxcxa" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "Type of calculation.\n\n" + }, + "points": { + "type": "integer", + "description": "Fixed number of points to be applied." + } + } + }, + "MappingPoints": { + "anyOf": [ + { + "$ref": "#/components/schemas/MappingMultiply" + }, + { + "$ref": "#/components/schemas/MappingFixed" + } + ] + }, "a_req_importCSV": { "type": "object", "title": "Import CSV file", @@ -66961,7 +67458,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" + "$ref": "#/components/schemas/8_req_add_remove_points_balance" }, "examples": { "Add points": { @@ -66986,7 +67483,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, "examples": { "Add balance": { @@ -67075,7 +67572,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" + "$ref": "#/components/schemas/8_req_add_remove_points_balance" }, "examples": { "Subtract points": { @@ -67100,7 +67597,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, "examples": { "Subtract Points": { @@ -67184,7 +67681,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesTransferPointsRequestBody" + "$ref": "#/components/schemas/8_req_transfer_loyalty_points" }, "examples": { "Example": { @@ -67209,7 +67706,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesTransferPointsResponseBody" + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" }, "examples": { "Example": { @@ -67321,7 +67818,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" }, "examples": { "Example": { @@ -67662,7 +68159,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" }, "examples": { "Example": { @@ -67995,7 +68492,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" }, "examples": { "Example": { @@ -68028,7 +68525,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_obj_export_transactions_object" }, "examples": { "Example": { @@ -68161,7 +68658,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" }, "examples": { "Example": { @@ -68194,7 +68691,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_obj_export_transactions_object" }, "examples": { "Example": { @@ -71309,7 +71806,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" + "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" }, "examples": { "Material": { @@ -71842,7 +72339,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" }, "examples": { "Example": { @@ -73926,7 +74423,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tiers" + "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" }, "examples": { "Example": { @@ -74049,6 +74546,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}": { @@ -74094,7 +74628,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + "$ref": "#/components/schemas/LoyaltyTier" }, "examples": { "Example": { @@ -74184,7 +74718,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_member_loyalty_tier" + "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" }, "examples": { "Example": { @@ -74307,7 +74841,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_earning_rules" + "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" }, "examples": { "example-1": { @@ -82767,7 +83301,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportsCreateRequestBody" + "$ref": "#/components/schemas/16_req_create_export_POST" } } } @@ -82778,7 +83312,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportsCreateResponseBody" + "$ref": "#/components/schemas/16_obj_export_object" } } } @@ -82863,7 +83397,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportsListResponseBody" + "$ref": "#/components/schemas/16_res_list_exports" }, "examples": { "List Exports": { @@ -82988,7 +83522,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportsGetResponseBody" + "$ref": "#/components/schemas/16_obj_export_object" }, "examples": { "Get Export": { diff --git a/scripts/update-md-tables-in-doc.ts b/scripts/update-md-tables-in-doc.ts index f8282938f..ba3bc0ee7 100644 --- a/scripts/update-md-tables-in-doc.ts +++ b/scripts/update-md-tables-in-doc.ts @@ -4,7 +4,7 @@ import { EOL } from 'os'; import { mdTables } from './md-tables'; const PATH_TO_DOCS_REFERENCE = [__dirname, '../docs/reference-docs']; -const PATH_TO_GERENATED_TABLES = [__dirname, './output']; +const PATH_TO_GENERATED_TABLES = [__dirname, './output']; const updateMdTablesInDoc = async () => { for (const [objectName, docFile] of mdTables) { @@ -27,17 +27,17 @@ const updateMdTablesInDoc = async () => { } 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_GERENATED_TABLES, `${objectName}.md`))) + 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, + additionalBlockquotes?.length? additionalBlockquotes.join(EOL) : false, newTable, contentAfterTable ].filter(e => !!e) @@ -53,4 +53,4 @@ const updateMdTablesInDoc = async () => { console.log('done') } -updateMdTablesInDoc(); \ No newline at end of file +updateMdTablesInDoc(); From ac601a89328ce60e7fadda20cb807e202f7cd97d Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:48:52 +0200 Subject: [PATCH 4/5] 09 - Product Collections (#489) * Update OpenAPI.json * Update OpenAPI.json * update schema for collection object * Update Changelog.md * changelog - product collections * remove stoplight tags * add new slug, update order * Update OpenAPI.json * update product_collections_collection_item name * update openAPI * add missing filter keys for product collection * Update PRODUCT-COLLECTIONS-API-Product-Collection-Object.md --- Changelog.md | 34 +- ...LLECTIONS-API-Delete-Product-Collection.md | 2 +- ...ECTIONS-API-List-Products-In-Collection.md | 2 +- ...LLECTIONS-API-Product-Collection-Object.md | 74 ++- ...DUCT-COLLECTIONS-Get-Product-Collection.md | 2 +- ...LLECTIONS_API_Create_Product_Collection.md | 14 + reference/OpenAPI.json | 586 ++++++++++++++---- scripts/md-tables.ts | 2 +- 8 files changed, 577 insertions(+), 139 deletions(-) create mode 100644 docs/reference-docs/PRODUCT_COLLECTIONS_API_Create_Product_Collection.md diff --git a/Changelog.md b/Changelog.md index 110835c39..a70d6a5c0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,36 @@ # Changelog + +## 20231012 - Product Collections + +**New models** +- product_collections_get_response_body +- product_collections_list_products_response_body +- product_collections_sku_in_collection +- product_collections_product_in_collection +- product_collections_collection_item +- - product_collections_collection_item_base +- product_collections_static_collection +- product_collections_dynamic_collection +- product_collections_list_response_body +- product_collections_create_request_body +- product_collections_create_static_request_body +- product_collections_create_dynamic_request_body + + +**Endpoint changes** +- Added missing method for endpoint: POST `/v1/product-collections` + - Request body schema: `product_collections_create_request_body` + - Response body schema: `product_collections_collection` +- GET `/v1/product-collections` + - New response schema: `product_collections_list_response_body` (old one: `12_res_product-collections`) +- GET `/v1/product-collections/{productCollectionId}` + - New response schema: `product_collections_get_response_body` (old one: `12_obj_product_collection_object`) +- GET `/v1/product-collections/{productCollectionId}/products` + - New response schema: `product_collections_list_products_response_body` (old one: `11_res_product-collections_productCollectionID_products`) +- /v1/product-collection-object + - New response schema: `product_collections_collection_item` (old one: `12_obj_product_collection_object`) + ## 20231011 #### New schemas: @@ -38,7 +69,6 @@ #### New endpoint - POST /v1/loyalties/{campaignId}/tiers - ## 20231009 #### New schemas: @@ -535,4 +565,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` +`/v1/qualification-object` \ No newline at end of file diff --git a/docs/reference-docs/PRODUCT-COLLECTIONS-API-Delete-Product-Collection.md b/docs/reference-docs/PRODUCT-COLLECTIONS-API-Delete-Product-Collection.md index b9cb6db94..deeadb03a 100644 --- a/docs/reference-docs/PRODUCT-COLLECTIONS-API-Delete-Product-Collection.md +++ b/docs/reference-docs/PRODUCT-COLLECTIONS-API-Delete-Product-Collection.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: delete-product-collection parentDocSlug: product-collections-api hidden: false -order: 5 +order: 6 --- [block:html] { diff --git a/docs/reference-docs/PRODUCT-COLLECTIONS-API-List-Products-In-Collection.md b/docs/reference-docs/PRODUCT-COLLECTIONS-API-List-Products-In-Collection.md index bf38293a3..df02bfd64 100644 --- a/docs/reference-docs/PRODUCT-COLLECTIONS-API-List-Products-In-Collection.md +++ b/docs/reference-docs/PRODUCT-COLLECTIONS-API-List-Products-In-Collection.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: list-products-in-collection parentDocSlug: product-collections-api hidden: false -order: 4 +order: 5 --- [block:html] { diff --git a/docs/reference-docs/PRODUCT-COLLECTIONS-API-Product-Collection-Object.md b/docs/reference-docs/PRODUCT-COLLECTIONS-API-Product-Collection-Object.md index 7168d42c3..526344ca2 100644 --- a/docs/reference-docs/PRODUCT-COLLECTIONS-API-Product-Collection-Object.md +++ b/docs/reference-docs/PRODUCT-COLLECTIONS-API-Product-Collection-Object.md @@ -11,31 +11,75 @@ order: 1 ## Product Collection Object

This is an object representing a product collection.

The 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.

-One of: +All of: -[Static Product Collection](#static-product-collection), [Dynamic Product Collection](#dynamic-product-collection) +1. [Product Collection Base](#product-collection-base) +2. Any of: [Static Product Collection](#static-product-collection), [Dynamic Product Collection](#dynamic-product-collection) -## Static Product Collection +## Product Collection Base | Attributes | Description | |:-----|:--------| -| id
`string` |

Product collection ID.

**Example:**

pc_a11pr0dUc75

| +| id
`string` |

Product collection ID.

| | name
`string` |

Unique user-defined product collection name.

**Example:**

All Products

| -| type
`string` |

Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).

Available values: `AUTO_UPDATE`, `STATIC` | -| products
`array` |

Defines a set of products for a STATIC product collection type.

Array of:
AttributesDescription
id
string

The product ID.

Example:

prod_0a41bcf807c5fcaaf6

object
string

Denotes the type of object represented by the ID.

| | created_at
`string` |

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

**Example:**

2021-12-09T12:51:29.898Z

| -| updated_at
`string` |

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

**Example:**

2022-04-08T04:56:41.142Z

| -| object
`string` |

The type of object represented by JSON. This object stores information about the static product collection.

| +| object |

The type of object represented by JSON. This object stores information about the static product collection.

Available values: `products_collection` | + +## Static Product Collection +| Attributes | Description | +|:-----|:--------| +| type |

Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).

Available values: `STATIC` | +| products
`array` |

Defines a set of products for a STATIC product collection type.

Array of:
AttributesDescription
id
string

The product ID.

Example:

prod_0a41bcf807c5fcaaf6

product_id
string

Product ID for SKUs.

object

Denotes the type of object represented by the ID.

Available values: sku, product
| ## Dynamic Product Collection | Attributes | Description | |:-----|:--------| -| id
`string` |

Product collection ID.

**Example:**

pc_a11pr0dUc75

| -| name
`string` |

Unique user-defined product collection name.

**Example:**

All Products

| -| type
`string` |

Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).

Available values: `AUTO_UPDATE`, `STATIC` | -| filter
`object` |

Defines a set of criteria and boundary conditions for an AUTO_UPDATE product collection type.

| -| created_at
`string` |

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

**Example:**

2021-12-09T12:51:29.898Z

| -| updated_at
`string` |

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

**Example:**

2022-04-08T04:56:41.142Z

| -| object
`string` |

The type of object represented by JSON. This object stores information about the dynamic product collection.

| +| type |

Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).

Available values: `AUTO_UPDATE` | +| filter
`object` |

Defines a set of criteria and boundary conditions for an AUTO_UPDATE product collection type.

AttributesDescription
junctionSee: Junction
idSee: Field Conditions
product_idSee: Field Conditions
source_idSee: Field Conditions
nameSee: Field Conditions
priceSee: Field Conditions
objectSee: Field Conditions
attributesSee: Field Conditions
metadataSee: Field Conditions
image_urlSee: Field Conditions
skusSee: Field Conditions
created_atSee: Field Conditions
updated_atSee: Field Conditions
| + +## Junction +Available values: `and`, `AND`, `or`, `OR` + +## Field Conditions +| Attributes | Description | +|:-----|:--------| +| conditions |

Data filters used to narrow the data records to be returned in the result.

See: [Filters Condition](#filters-condition) | + +## Filters Condition +| Attributes | Description | +|:-----|:--------| +| $in | See: [Any](#any) | +| $not_in | See: [Any](#any) | +| $is | See: [Any](#any) | +| $is_days_ago | See: [Any](#any) | +| $is_days_in_future | See: [Any](#any) | +| $is_not | See: [Any](#any) | +| $has_value | See: [Any](#any) | +| $is_unknown | See: [Any](#any) | +| $contains | See: [Any](#any) | +| $not_contain | See: [Any](#any) | +| $starts_with | See: [Any](#any) | +| $ends_with | See: [Any](#any) | +| $more_than | See: [Any](#any) | +| $less_than | See: [Any](#any) | +| $more_than_ago | See: [Any](#any) | +| $less_than_ago | See: [Any](#any) | +| $more_than_future | See: [Any](#any) | +| $less_than_future | See: [Any](#any) | +| $more_than_equal | See: [Any](#any) | +| $less_than_equal | See: [Any](#any) | +| $after | See: [Any](#any) | +| $before | See: [Any](#any) | +| $count | See: [Any](#any) | +| $count_less | See: [Any](#any) | +| $count_more | See: [Any](#any) | + +## Any +Any of: + + 1. Array any of: string, number, object + 2. string + 3. number + 4. object [block:html] { diff --git a/docs/reference-docs/PRODUCT-COLLECTIONS-Get-Product-Collection.md b/docs/reference-docs/PRODUCT-COLLECTIONS-Get-Product-Collection.md index dc80f528c..33e6ee389 100644 --- a/docs/reference-docs/PRODUCT-COLLECTIONS-Get-Product-Collection.md +++ b/docs/reference-docs/PRODUCT-COLLECTIONS-Get-Product-Collection.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: get-product-collection parentDocSlug: product-collections-api hidden: false -order: 3 +order: 4 --- [block:html] { diff --git a/docs/reference-docs/PRODUCT_COLLECTIONS_API_Create_Product_Collection.md b/docs/reference-docs/PRODUCT_COLLECTIONS_API_Create_Product_Collection.md new file mode 100644 index 000000000..56c370670 --- /dev/null +++ b/docs/reference-docs/PRODUCT_COLLECTIONS_API_Create_Product_Collection.md @@ -0,0 +1,14 @@ +--- +title: Create Product Collection +type: endpoint +categorySlug: voucherify-api +slug: create-product-collection +parentDocSlug: product-collections-api +hidden: false +order: 3 +--- +[block:html] +{ +"html": "" +} +[/block] diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 1b9cda175..dae42e817 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -33254,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.", @@ -33439,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", @@ -33450,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." }, @@ -33460,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": { @@ -33473,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": { @@ -33487,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" @@ -33500,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", @@ -33507,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": { @@ -33538,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", @@ -33572,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", @@ -33593,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" } ] } @@ -33605,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", @@ -33635,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": { @@ -33684,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`.", @@ -33776,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", @@ -41470,9 +41604,6 @@ }, "Category": { "title": "Category", - "x-stoplight": { - "id": "4l87q60w8ta36" - }, "type": "object", "description": "This is an object representing a category.", "properties": { @@ -44015,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", @@ -44531,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": { @@ -80020,7 +80335,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/12_obj_product_collection_object" + "$ref": "#/components/schemas/product_collections_collection_item" } } } @@ -80048,9 +80363,7 @@ "type": "string", "enum": [ "created_at", - "-created_at", - "updated_at", - "-updated_at" + "-created_at" ] }, "in": "query", @@ -80070,7 +80383,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/12_res_product-collections" + "$ref": "#/components/schemas/product_collections_list_response_body" }, "examples": { "Example": { @@ -80240,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}": { @@ -80275,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": { @@ -80453,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": { @@ -85541,4 +85891,4 @@ } } } -} +} \ No newline at end of file diff --git a/scripts/md-tables.ts b/scripts/md-tables.ts index f70db227a..48f4506f1 100644 --- a/scripts/md-tables.ts +++ b/scripts/md-tables.ts @@ -18,7 +18,7 @@ export const mdTables: [string, string?][] = [ ['10_obj_order_object', 'ORDERS-API-Order-Object.md'], ['11_obj_product_object', 'PRODUCTS-API-Product-Object.md'], ['11_obj_sku_object', 'PRODUCTS-API-SKU-Object.md'], - ['12_obj_product_collection_object', 'PRODUCT-COLLECTIONS-API-Product-Collection-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'], ['14_obj_segment_object', 'SEGMENTS-API-Customer-Segment-Object.md'], From e2a635f0679f3ea3d4dca5d83612dd4a95d9eeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Al=C4=99zak?= <35666945+marcin-slezak@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:52:27 +0200 Subject: [PATCH 5/5] Update Changelog.md --- Changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index a70d6a5c0..da4deaaf3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,7 +9,7 @@ - product_collections_sku_in_collection - product_collections_product_in_collection - product_collections_collection_item -- - product_collections_collection_item_base +- product_collections_collection_item_base - product_collections_static_collection - product_collections_dynamic_collection - product_collections_list_response_body @@ -565,4 +565,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`