diff --git a/Changelog.md b/Changelog.md index f88aaa701..a1c6c789b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -21,21 +21,22 @@ #### Schemas changes - GET /v1/loyalties/{campaignId}/tiers - - new response schema `LoyaltiesListTiersResponseBody` (old `8_res_list_loyalty_tiers`) + - new response schema `LoyaltiesListTiersResponseBody` (old `8_res_list_loyalty_tiers`) - GET /v1/loyalties/members/{memberId}/balance - - new response schema `LoyaltiesGetRewardAssignmentResponseBody` (old `4_obj_reward_assignment_object`) + - 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`) + - 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`) + - new response schema `LoyaltiesGetTierResponseBody` (old `8_obj_loyalty_tier_object`) - GET /v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules - - new response schema `LoyaltiesListLoyaltyTierEarningRulesRequestQuery` (old `8_res_list_loyalty_tier_earning_rules`) + - new response schema `LoyaltiesListLoyaltyTierEarningRulesRequestQuery` (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`) + - new response schema `LoyaltiesListMemberLoyaltyTiersResponseBody` (old `8_res_get_member_loyalty_tier`) #### New endpoint - POST /v1/loyalties/{campaignId}/tiers + ## 20231009 #### New schemas: @@ -87,6 +88,58 @@ - /v1/loyalties/{campaignId}/members/{memberId}/points-expiration - 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 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
.
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.
Attributes | Description |
---|---|
urlstring | URL of the CSV file location. It contains the |
Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel
value is WEBSITE
.
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.
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:
Field | Definition | Example Export |
---|---|---|
id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |
source_id | Unique order source ID. | 8638 |
created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |
updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |
status | Order status. | PAID , CREATED , FULFILLED , CANCELED |
amount | Total amount of order items. | 7700 |
discount_amount | Represents total amount of the discount applied to whole cart. | 500 |
items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |
total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |
total_amount | Total order amount after applying all discounts. | 7100 |
customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |
referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |
metadata | Returns all order metadata. | Response will include all order metadata. |
metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. Read more here. |
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |
code | Unique voucher code. | WELCOME100 |
voucher_type | Type of voucher. | DISCOUNT_VOUCHER , GIFT_VOUCHER , LOYALTY_CARD |
value | Value of voucher. | DISCOUNT_VOUCHER : amount, percent, unitGIFT_VOUCHER : amount left to spendLOYALTY_CARD : available usable points |
discount_type | The type of discount for a DISCOUNT_VOUCHER . | AMOUNT , PERCENT , UNIT , FIXED |
campaign | Unique campaign name. | Summer Discounts 20% off |
category | Tag defining the category that this voucher belongs to. | |
start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is inactive before this date. | 2020-12-10T23:00:00.000Z |
expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is inactive after this date. | 2023-12-31T23:00:00.000Z |
gift_balance | Amount left to spend. | 1000 |
loyalty_balance | Available usable points. | 2000 |
redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |
redemption_count | Total redemptions. | 59 |
active | Boolean indicating whether the voucher is available for use. | true , false |
qr_code | URL to QR representation of encrypted code. | |
bar_code | URL to barcode representation of encrypted code. | |
is_referral_code | Boolean indicating whether the voucher is a referral code. | true , false |
created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |
updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |
validity_timeframe_interval | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day. | P2D |
validity_timeframe_duration | Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour. | PT1H |
validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | "1,2,3,4,5" |
discount_amount_limit | For PERCENT discount type, this is the maximum threshold allowed to be deducted. | 50 |
campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |
additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |
customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |
discount_unit_type | For UNIT discount type, either a shipping or product ID for a UNIT discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |
discount_unit_effect | UNIT discount effect. | ADD_MANY_ITEMS , ADD_MISSING_ITEMS ,ADD_NEW_ITEMS |
customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |
metadata | Returns all voucher metadata. | Response will include all voucher metadata. |
metadata.X | Where X is the name of a particular voucher metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. Read more here. |
Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:
categories
vouchers
type
holder_id
is_referral_code
published_for_customer_id
validity_timeframe
category_ids
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
voucher_code | Unique voucher code. | WELCOME100 |
customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |
customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |
date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |
channel | Publication channel. | voucherify-website |
campaign | Unique campaign name. | Summer Discounts 20% off |
is_winner | ||
metadata | Returns all publication metadata. | Response will include all publication metadata. |
metadata.X | Where X is the name of a particular publication metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. Read more here |
Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:
failure_code
result
customer_id
campaign_name
voucher_type
is_referral_code
parent_object_id
related_object_id
source_id
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |
object | Object being exported; by default redemption . | redemption |
date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |
voucher_code | Unique voucher code redeemed. | WELCOME100 |
campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |
promotion_tier_id | promo_Mwy9XpA0TLctSGriM5kum0qp | |
customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |
customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |
customer_name | Customer name. | John Smith |
tracking_id | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy | |
order_amount | Total order amount before applying all discounts. | 1000 |
gift_amount | Gift credits used for redemption. | 10 |
loyalty_points | 12 | |
result | Tells you whether the redemption succeeded. | SUCCESS , FAILURE |
failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |
failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |
metadata | Returns all redemption metadata. | Response will include all redemption metadata. |
metadata.X | Where X is the name of a particular redemption metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. Read more here |
Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:
voucher_code
related_object_id
related_object_parent_id
parent_redemption_id
failure_code
result
object
customer_id
campaign_name
user_login
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
name | Customer name. | John Smith |
id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |
description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |
Customer's email. | name.lastname@email.com | |
source_id | Unique custom customer identifier. | name.lastname@email.com |
created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |
address_city | City | Houston |
address_state | State | TX |
address_line_1 | First line of customer's address. | 72738 Main St |
address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |
address_country | Country | United States of America |
address_postal_code | Postal code (ZIP code) | 77042-4143 |
redemptions_total_redeemed | Total customer redemptions. | 5 |
redemptions_total_failed | Total customer failed redemptions. | 2 |
redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |
redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |
redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |
redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |
orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |
orders_total_count | Total number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 2 |
orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |
orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |
orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |
loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | |
loyalty_referred_customers | How many customers were referred by this customer. | |
updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |
phone | Customer's phone number. | +1 (294) 752-1846 |
birthday | Customer's birthday. | 2022-01-01 |
birthdate | Customer's birthdate. | 2022-04-29 |
metadata | Returns all customer metadata. | Response will include all customer metadata. |
metadata.X | Where X is the name of a particular customer metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. Read more here |
Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:
name
(string)
email
(string)
phone
(string)
metadata
(json)
metadata.X
(?)
address
(json)
address.state
(string)
address.country
(string)
address.postal_code
(string)
birthday
(string - date-time)
birthdate
(string date-time)
created_at
(date)
source_id
(string)
system.metadata
(json)
system.metadata.source
(string)
system.metadata.consents.unsubscribed
(boolean)
loyalty_points
(json)
loyalty
(json)
summary.orders.total_amount
(json)
summary.orders.last_order_date
(date)
summary.orders.last_order_amount
(json)
summary.redemptions.gift.redeemed_amount
(integer)
summary.redemptions.total_succeeded
(integer)
events.cart_abandoned.last_occurred
(integer)
events.newsletter_subscribed.count
(integer)
events.sign_up.last_occurred
(integer)
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |
campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |
voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |
status | Status of the loyalty points bucket. | ACTIVE or INACTIVE |
expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |
points | Number of points. | 1000 |
Data filters used to narrow the data records to be returned in the export. You can filter the following parameters:
campaign_id
voucher_id
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
id | Unique transaction ID. | vtx_0cb7811f1c07765800 |
type | Transaction type. | - CREDITS_REMOVAL - CREDITS_ADDITION - CREDITS_REFUND - CREDITS_REDEMPTION |
source_id | Unique transaction source ID. | 8638 |
reason | Contains the reason for the transaction if one was included originally. | |
balance | The gift card balance after the transaction. | |
amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
source | Channel through which the transaction was initiated. | API |
details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
How the export is filtered, where the dash -
preceding a sorting option means sorting in a descending order.
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:
Field | Definition | Example Export |
---|---|---|
id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |
type | Transaction type. | - POINTS_EXPIRATION - POINTS_ADDITION - POINTS_REMOVAL - POINTS_TRANSFER_OUT - POINTS_ACCRUAL - POINTS_REFUND - POINTS_REDEMPTION |
source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |
reason | Contains the reason for the transaction if one was included originally. | |
balance | The loyalty card balance after the transaction. | |
amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
source | Channel through which the transaction was initiated. | - API - voucherify-web-ui - Automation |
details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |
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` |Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Voucher Order |
fieldsarray | 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 |
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.
Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Redemption Order |
fieldsarray | 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 |
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.
Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Customer Order |
fieldsarray | 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 |
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.
Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Publication Order |
fieldsarray | 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 |
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.
Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Order Order |
fieldsarray | 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 |
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.
Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Points Expiration Order |
fieldsarray | 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 |
Data filters used to narrow the data records to be returned in the result.
Attributes | Description |
---|---|
$inarray | Array of resource values that should be included in the results. (multiple values) |
$not_inarray | Array of resource values that should be included in the results. (multiple values) |
$isstring | Value is exactly this value. (single value) |
$is_notstring | Results omit this value. (single value) |
$has_valuestring | Value is NOT null. The value for this parameter is an empty string. |
$is_unknownstring | Value is null. The value for this parameter is an empty string. |
$starts_withstring | Value starts with the specified string. |
$ends_withstring | Value ends with the specified 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.
Attributes | Description |
---|---|
order | How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order. See: Export Voucher Transactions Order |
fieldsarray | 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 |
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.
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.
Attributes | Description |
---|---|
$inarray | Array of resource values that should be included in the results. (multiple values) |
$not_inarray | Array of resource values that should be included in the results. (multiple values) |
$isinteger | Value is exactly this value. (single value) |
$is_notinteger | Results omit this value. (single value) |
$has_valuestring | Value is NOT null. The value for this parameter is an empty string. |
$is_unknownstring | Value is null. The value for this parameter is an empty string. |
$more_thaninteger | Value is more than the specified number. |
$more_than_equalinteger | Value is more than or equal to the specified number. |
$less_thaninteger | Value is less than the specified number. |
$less_than_equalinteger | Value is less than or equal to the specified number. |
Data filters used to narrow the data records to be returned in the result.
Attributes | Description |
---|---|
$isstring | Value is exactly this value. (single value) |
$is_notstring | Results omit this value. (single value) |
$has_valuestring | Value is NOT null. The value for this parameter is an empty string. |
$is_unknownstring | Value is null. The value for this parameter is an empty string. |
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.
Attributes | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
idstring | Unique redemption ID. Example:r_0bc92f81a6801f9bca | ||||||||||||||
objectstring | The type of object represented by the JSON. This object stores information about the | ||||||||||||||
datestring | Timestamp in ISO 8601 format indicating when the redemption occured. Example:2022-10-03T12:24:58.008Z | ||||||||||||||
customer_idstring | Unique customer ID of the redeeming customer. Example:cust_i8t5Tt6eiKG5K79KQlJ0Vs64 | ||||||||||||||
tracking_idstring | Hashed customer source ID. Example:track_fxEMFiLowFHg== | ||||||||||||||
metadataobject | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption. | ||||||||||||||
resultstring | Redemption result. Available values:SUCCESS , FAILURE | ||||||||||||||
order | Defines the details of the order that is related to the redemption. See: Order | ||||||||||||||
customerobject | Defines the customer making the stacked redemption.
| ||||||||||||||
related_object_typestring | Defines the related object. Available values:redemption | ||||||||||||||
related_object_idstring | Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption. | ||||||||||||||
vouchernull |
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
.
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.
Attributes | Description |
---|---|
channel_idstring | 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_typestring | The source of the channel for the redemption. A USER , API |
Defines the customer that is related to the redemption.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
Defines the related object.
Related Object | Definition |
---|---|
voucher | Either a discount voucher, gift card, or loyalty card. |
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.
Attributes | Description |
---|---|
channel_idstring | 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_typestring | The source of the channel for the redemption. A USER , API |
Defines the customer redeeming the reward.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
Defines the related object. i.e. voucher
.
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.
Attributes | Description |
---|---|
pointsinteger | Number of points being subtracted from the loyalty card for the reward redemption. |
Unique redemption ID.
**Example:**r_0bc92f81a6801f9bca
| +| object`string` |The type of object represented by the JSON. This object stores information about the redemption
.
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.
Attributes | Description |
---|---|
channel_idstring | 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_typestring | The source of the channel for the redemption. A USER , API |
Defines the customer redeeming the gift card.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
Defines the related object.
Related Object | Definition |
---|---|
voucher | Either a discount voucher, gift card, or loyalty card. |
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.
Attributes | Description |
---|---|
amountinteger | The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00). |
Unique redemption ID.
**Example:**r_0bc92f81a6801f9bca
| +| object`string` |The type of object represented by the JSON. This object stores information about the redemption
.
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.
Attributes | Description |
---|---|
channel_idstring | 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_typestring | The source of the channel for the redemption. A USER , API |
Defines the customer that is related to the redemption.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
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
.
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
.
Attributes | Description |
---|---|
amountinteger | 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 |
balanceinteger | Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000. Example:500 |
effectstring | Defines how the credits are applied to the customer's order. Available values:APPLY_TO_ORDER , APPLY_TO_ITEMS |
Object representing loyalty card parameters. Child attributes are present only if type
is LOYALTY_CARD
. Defaults to null
.
Attributes | Description |
---|---|
pointsinteger | Total points incurred over lifespan of loyalty card. Example:7000 |
balanceinteger | Points available for reward redemption. Example:6970 |
next_expiration_datestring | The next closest date when the next set of points are due to expire. Example:2023-05-30 |
next_expiration_pointsinteger | The amount of points that are set to expire next. |
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
.
Attributes | Description |
---|---|
durationstring | Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a PT1H |
intervalstring | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an P2D |
Integer array corresponding to the particular days of the week in which the voucher is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
SaturdayA 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
.
true
indicates an active voucherfalse
indicates an inactive voucherAn 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.
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
qrobject | Stores Quick Response (QR) representation of encrypted code.
| ||||||
barcodeobject | Stores barcode representation of encrypted code.
|
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.
Attributes | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
objectstring | The type of object represented is by default | ||||||||||||||
data_refstring | Identifies the name of the attribute that contains the array of validation rule assignments. | ||||||||||||||
dataarray | Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule. Array of:
| ||||||||||||||
totalinteger | Total number of validation rules assigned to the voucher. |
Stores a summary of redemptions that have been applied to the voucher.
Attributes | Description |
---|---|
quantityinteger | How many times a voucher can be redeemed. A |
redeemed_quantityinteger | How many times a voucher has already been redeemed. Example:1 |
redeemed_amountinteger | 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_pointsinteger | Total loyalty points redeemed. Example:100000 |
objectstring | The type of object represented is by default |
urlstring | The endpoint where this list of redemptions can be accessed using a GET method. /v1/vouchers/WVPblOYX/redemptions?page=1&limit=10 |
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.
Required | Optional |
---|---|
type :LOYALTY_CARD | type :DISCOUNT_VOUCHER |
is_referral_code :true | type :GIFT_VOUCHER |
Attributes | Description |
---|---|
objectstring | The type of object represented is by default |
countinteger | Publication events counter. Example:0 |
urlstring | The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/WVPblOYX/publications?page=1&limit=10 |
The type of object represented by JSON. Default is voucher
.
Defines the customer redeeming the reward.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
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
.
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.
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
coinobject | Defines the ratio by mapping the number of loyalty points in
|
Reward type
Available values: `COIN` | + +## Product Material Reward +| Attributes | Description | +|:-----|:--------| +| customer`object` |Defines the customer redeeming the reward.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
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
.
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.
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
productobject | Defines the product redeemed as a reward.
|
Reward type
Available values: `MATERIAL` | + +## SKU Material Reward +| Attributes | Description | +|:-----|:--------| +| customer`object` |Defines the customer redeeming the reward.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
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
.
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.
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
productobject | Defines the SKU redeemed as a reward.
|
Reward type
Available values: `MATERIAL` | + +## Digital Reward +| Attributes | Description | +|:-----|:--------| +| customer`object` |Defines the customer redeeming the reward.
Attributes | Description |
---|---|
idstring | The unique ID of a customer that is assigned by Voucherify. Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
namestring | Customer's first and last name. |
emailstring | Customer's email address. |
source_idstring | 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. |
metadataobject | 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. |
objectstring | Type of object represented is |
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
.
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.
Attributes | Description |
---|---|
campaign | Defines the source of the digital reward. Any of: Discount Voucher, Gift Card, Loyalty Card |
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.
Attributes | Description |
---|---|
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 |
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.
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
idstring | Unique campaign ID. | ||||||
start_datestring | 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_datestring | 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_timeframeobject | Recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.
| ||||||
validity_day_of_weekarray | Integer array corresponding to the particular days of the week in which the campaign is valid.
| ||||||
activeboolean | 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
| ||||||
category_idstring | Unique category ID that this campaign belongs to. Example:cat_0b688929a2476386a6 | ||||||
objectstring | The type of object represented by the campaign object. This object stores information about the campaign. |
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
.
true
indicates an active promotion tierfalse
indicates an inactive promotion tierActivation 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
.
Attributes | Description |
---|---|
intervalstring | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an |
durationstring | Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a |
Integer array corresponding to the particular days of the week in which the promotion tier is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
SaturdayContains statistics about promotion tier redemptions and orders.
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
redemptionsobject | Contains statistics about promotion tier redemptions.
| ||||||
ordersobject | Contains statistics about orders related to the promotion tier.
|
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.
Attributes | Description |
---|---|
datestring | Timestamp representing the date and time when the redemption was created in ISO 8601 format. Example:2022-09-02T17:06:56.649Z |
related_object_typestring | The source of the incentive. |
related_object_idstring | Unique ID of the parent redemption. Example:r_0ba186c4824e4881e1 |
stackedarray | Contains a list of unique IDs of child redemptions, which belong to the stacked incentives. |
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
Order amount after applying all the discounts.total_amount
= amount
- total_discount_amount
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:Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
objectstring | The type of object represented by JSON. This object stores information about the | ||||||||||
product_idstring | A unique identifier that represents the product and is assigned by Voucherify. Example:prod_5h0wc453_1 | ||||||||||
sku_idstring | A unique identifier that represents the SKU and is assigned by Voucherify. Example:sku_prod_5h0wc453_1_1 | ||||||||||
quantityinteger | Quantity of the item in the cart. | ||||||||||
amountinteger | Represents a total pre-discount amount of order item ( | ||||||||||
priceinteger | Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000. | ||||||||||
subtotal_amountinteger | Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the | ||||||||||
productobject | This object stores more information about the related product.
| ||||||||||
skuobject | This object stores more information about the related SKU.
|
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.
Attributes | Description |
---|---|
idstring | Unique customer ID of the customer making the purchase. Example:cust_7iUa6ICKyU6gH40dBU25kQU1 |
objectstring | Type of object represented by the |
Object containing information about the referrer.
Attributes | Description |
---|---|
idstring | Unique referrer ID, who referred the customer making the purchase. Example:cust_7iUa6ICKyU6gH40dBU25kQU1 |
objectstring | Type of object represented by the |
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
.
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)
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
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:Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
objectstring | The type of object represented by JSON. This object stores information about the | ||||||||||
product_idstring | A unique identifier that represents the product and is assigned by Voucherify. Example:prod_5h0wc453_1 | ||||||||||
sku_idstring | A unique identifier that represents the SKU and is assigned by Voucherify. Example:sku_prod_5h0wc453_1_1 | ||||||||||
quantityinteger | Quantity of the item in the cart. | ||||||||||
amountinteger | Represents a total pre-discount amount of order item ( | ||||||||||
discount_amountinteger | The item-level discount applied to the item. | ||||||||||
applied_discount_amountinteger | The item-level discount applied to the item. | ||||||||||
priceinteger | Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000. | ||||||||||
subtotal_amountinteger | Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the | ||||||||||
productobject | This object stores more information about the related product.
| ||||||||||
skuobject | This object stores more information about the related SKU.
|
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.
Attributes | Description |
---|---|
idstring | Unique customer ID of the customer making the purchase. Example:cust_7iUa6ICKyU6gH40dBU25kQU1 |
objectstring | Type of object represented by the |
Object containing information about the referrer.
Attributes | Description |
---|---|
idstring | Unique referrer ID, who referred the customer making the purchase. Example:cust_7iUa6ICKyU6gH40dBU25kQU1 |
objectstring | Type of object represented by the |
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
.
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.
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:
APPLY_TO_ITEMS
(each item subtotal is discounted equally)APPLY_TO_ITEMS_BY_QUANTITY
(each unit of matched products has the same discount value)Defines how the discount is applied to the customer's order. The discount effects are defined as follows:
APPLY_TO_ORDER
(discount applies to the total order amount)APPLY_TO_ITEMS
(each item subtotal is discounted equally)APPLY_TO_ITEMS_PROPORTIONALLY
(split discount proportionally to amount)APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY
(split discount proportionally to quantity)APPLY_TO_ITEMS_BY_QUANTITY
(each unit of matched products has the same discount value)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 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.
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.
1000
| +| fixed_amount_formula`string` |Formula used to calculate the discounted price of an item or a new order total.
| +| effect`string` |Effect | Definition |
---|---|
APPLY_TO_ORDER | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |
APPLY_TO_ITEMS | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |
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.
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:Attributes | Description |
---|---|
unit_offinteger | Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the 1 |
unit_off_formulastring | Formula used to calculate the number of units. |
unit_typestring | The product deemed as free, chosen from the product inventory (e.g. time, items). Example:prod_f1r5Tpr0DuC7 |
effectstring | Defines how the unit is added to the customer's order. Available values:ADD_NEW_ITEMS , ADD_MISSING_ITEMS |
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.
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
.
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
.
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.
Attributes | Description |
---|---|
datestring | Timestamp representing the date and time when the redemption was created in ISO 8601 format. Example:2022-09-02T17:06:56.649Z |
related_object_typestring | The source of the incentive. Available values:voucher , promotion_tier |
related_object_idstring | Unique ID of the related object that defines the incentive. |
related_object_parent_idstring | 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 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.
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.
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.
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.
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 188cadc3a..246dd8f89 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39240,172 +39240,7 @@ } } }, - "LoyaltiesCreateTiersRequestBody": { - "title": "LoyaltiesCreateTiersRequestBody", - "x-stoplight": { - "id": "i1emmwlaqp7lt" - }, - "type": "array", - "items": { - "$ref": "#/components/schemas/CreateLoyaltyTier" - } - }, - "LoyaltiesCreateTiersResponseBody": { - "title": "LoyaltiesCreateTiersResponseBody", - "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": "LoyaltiesListTiersRequestQuery", - "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": "LoyaltiesListTiersResponseBody", - "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": "LoyaltiesListMemberLoyaltyTiersResponseBody", - "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": { + "LoyaltiesGetEarningRuleResponseBody": { "allOf": [ { "$ref": "#/components/schemas/EarningRuleBase" @@ -39441,461 +39276,411 @@ } ] }, - "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { - "title": "LoyaltiesListLoyaltyTierEarningRulesResponseBody", - "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" - } + "LoyaltiesEnableEarningRulesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." + { + "type": "object", + "properties": { + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." + }, + "active": { + "type": "boolean", + "default": true, + "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date." + } + }, + "required": [ + "updated_at", + "active" + ] } - }, - "required": [ - "object", - "data_ref", - "data", - "total" ] }, - "CreateLoyaltyTier": { - "title": "CreateLoyaltyTier", - "x-stoplight": { - "id": "xpsiqbhyf58t7" - }, - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format.\n\n" - }, - "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." + "LoyaltiesDisableEarningRulesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" }, - "points": { + { "type": "object", - "description": "Defines range of loyalty tier in points.", "properties": { - "from": { - "type": "integer", - "description": "Bottom points threshold value." + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." }, - "to": { - "type": "integer", - "description": "Top points threshold value." + "active": { + "type": "boolean", + "default": false, + "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date." } - } + }, + "required": [ + "updated_at", + "active" + ] } - }, - "required": [ - "name", - "points" ] }, - "LoyaltyTier": { - "title": "LoyaltyTier", + "EarningRuleBase": { + "title": "EarningRuleBase", "x-stoplight": { - "id": "ed25x9e2fu5od" + "id": "w4ci1ljqva0r1" }, "type": "object", "properties": { "id": { "type": "string", - "description": "Unique loyalty tier ID." - }, - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "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." + "description": "Assigned by the Voucherify API, identifies the earning rule object." }, "created_at": { "type": "string", "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + "description": "Timestamp representing the date and time when the earning rule 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." + "loyalty": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleFixed" + }, + { + "$ref": "#/components/schemas/EarningRuleProportional" + } + ] }, - "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." + "event": { + "$ref": "#/components/schemas/EarningRuleEvent", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card." }, - "rewards": { + "custom_event": { "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/MappingPoints" + "properties": { + "schema_id": { + "type": "string" + } }, - "description": "Contains a list of reward IDs and their points mapping for the given reward." + "required": [ + "schema_id" + ] }, - "config": { + "segment": { "type": "object", - "required": [ - "points" - ], - "description": "Defines loyalty tier range in points.", + "description": "Contains the id of a customer segment. Required for the customer.segment.entered option in event.", "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." - } - } + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." } - } + }, + "required": [ + "id" + ] }, - "points": { + "source": { "type": "object", - "description": "Defines range of loyalty tier in points.", + "required": [ + "object_id", + "object_type" + ], + "description": "Contains the custom earning rule name and parent campaign.", "properties": { - "from": { - "type": "integer", - "description": "Bottom points threshold value." + "banner": { + "type": "string", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." }, - "to": { - "type": "integer", - "description": "Top points threshold value." + "object_id": { + "type": "string", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`.", + "enum": [ + "campaign" + ] } } }, - "expiration": { + "object": { + "type": "string", + "enum": [ + "earning_rule" + ], + "description": "The type of object represented by JSON. Default is earning_rule." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify." + }, + "start_date": { + "type": "string", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is inactive before this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is inactive after this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { "type": "object", - "description": "Defines loyalty tier expiration date.", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the `validity_timeframe`.", "properties": { - "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": { + "duration": { "type": "string", - "format": "date-time" + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour." }, - "updated_at": { + "interval": { "type": "string", - "format": "date-time" + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day." } }, "required": [ - "customer_id", - "campaign_id", - "tier_id", - "created_at" + "duration", + "interval" ] }, - "object": { - "type": "string", - "enum": [ - "loyalty_tier" - ], - "description": "The type of object represented by JSON. This object stores information about the loyalty." + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3` Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 6 + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } }, "required": [ "id", - "name", - "campaign_id", - "metadata", "created_at", - "config", - "points", - "object" + "loyalty", + "source", + "object", + "automation_id", + "metadata" ] }, - "MappingMultiply": { - "title": "MappingMultiply", + "EarningRuleEvent": { + "title": "EarningRuleEvent", "x-stoplight": { - "id": "7zrwgr2oqh4tj" + "id": "6vxql7fnzg2zp" }, - "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." - } - } + "type": "string", + "enum": [ + "order.paid", + "customer.segment.entered", + "custom_event", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged", + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left" + ] }, - "MappingFixed": { - "title": "MappingFixed", + "EarningRuleFixed": { + "title": "Define fixed amount of points", "x-stoplight": { - "id": "86eksegayxcxa" + "id": "r5o8m0sdli7fq" }, "type": "object", "properties": { "type": { "type": "string", "enum": [ - "CUSTOM" + "FIXED" ], - "description": "Type of calculation.\n\n" + "description": "The number of points to be added to the loyalty card." }, "points": { "type": "integer", - "description": "Fixed number of points to be applied." + "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points." } } }, - "RewardAssignment": { - "title": "Reward Assignment", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique reward assignment ID, assigned by Voucherify." + "EarningRuleProportionalOrder": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount" }, - "reward_id": { - "type": "string", - "description": "Associated reward ID." + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount" }, - "related_object_id": { + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata" + } + ], + "title": "Order" + }, + "EarningRuleProportionalOrderAmount": { + "title": "Order Amount", + "x-stoplight": { + "id": "1z7lk7z1lp5af" + }, + "type": "object", + "properties": { + "type": { "type": "string", - "description": "Related object ID to which the reward was assigned." + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "related_object_type": { + "calculation_type": { "type": "string", - "description": "Related object type to which the reward was assigned." + "enum": [ + "ORDER_AMOUNT" + ], + "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" }, - "parameters": { + "order": { "type": "object", - "description": "Defines the cost of the reward.", + "required": [ + "amount" + ], "properties": { - "loyalty": { + "amount": { "type": "object", - "description": "Defines the equivalent points value of the reward.", + "required": [ + "every", + "points" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, "points": { "type": "integer", - "description": "The number of points required to redeem the reward." + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." } - }, - "required": [ - "points" - ] + } } } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the reward assignment." } }, "required": [ - "id", - "reward_id", - "created_at", - "object" + "type", + "calculation_type", + "order" ] }, - "Reward": { - "allOf": [ - { + "EarningRuleProportionalOrderTotalAmount": { + "title": "Order Total Amount", + "x-stoplight": { + "id": "ekudxr430edgk" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_TOTAL_AMOUNT" + ], + "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" + }, + "order": { "type": "object", + "required": [ + "total_amount" + ], "properties": { - "id": { - "type": "string", - "description": "Unique reward ID, assigned by Voucherify." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as reward." - }, - "redeemed": { - "type": "integer", - "description": "Defines the number of already invoked (successful) reward redemptions." - }, - "attributes": { + "total_amount": { "type": "object", - "description": "These properties are configurable for material rewards.", + "required": [ + "every", + "points" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", "properties": { - "image_url": { - "type": "string", - "description": "The HTTPS URL pointing to the .png or .jpg file." + "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." }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a material reward." + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." } } - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format." - }, - "object": { - "type": "string", - "default": "reward", - "pattern": "reward", - "description": "The type of object represented by the JSON. This object stores information about the reward." } - }, - "required": [ - "id", - "created_at", - "object" - ] - }, - { - "$ref": "#/components/schemas/RewardType" - } - ] - }, - "RewardType": { - "title": "Reward Type", - "anyOf": [ - { - "$ref": "#/components/schemas/RewardTypeCampaign" - }, - { - "$ref": "#/components/schemas/RewardTypeCoin" - }, - { - "$ref": "#/components/schemas/RewardTypeCoin" - } - ] - }, - "MappingPoints": { - "anyOf": [ - { - "$ref": "#/components/schemas/MappingMultiply" - }, - { - "$ref": "#/components/schemas/MappingFixed" + } } + }, + "required": [ + "type", + "calculation_type", + "order" ] }, - "RewardTypeCoin": { - "title": "Reward Type Coin", + "EarningRuleProportionalOrderMetadata": { + "title": "Order Metadata", + "x-stoplight": { + "id": "4ccw4gz8b47u5" + }, "type": "object", "properties": { "type": { "type": "string", "enum": [ - "COIN" + "PROPORTIONAL" ], - "description": "Reward type." + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "parameters": { + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_METADATA" + ], + "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)" + }, + "order": { "type": "object", "required": [ - "coin" + "metadata" ], - "description": "Defines how the reward is generated.", + "description": "Defines the formula for calculating points proportionally.", "properties": { - "coin": { + "metadata": { "type": "object", "required": [ - "exchange_ratio" + "every", + "points", + "property" ], - "description": "Defines the ratio by mapping the number of loyalty points in points_ratio to a predefined cash amount in exchange_ratio.", + "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": { - "exchange_ratio": { - "type": "number", - "description": "The cash equivalent of the points defined in the points_ratio property." + "every": { + "type": "integer", + "description": "For how many increments of the order metadata property to grant points for." }, - "points_ratio": { + "points": { "type": "integer", - "description": "The number of loyalty points that will map to the predefined cash amount defined by the exchange_ratio property." + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "property": { + "type": "string", + "description": "Order metadata property." } } } @@ -39904,45 +39689,67 @@ }, "required": [ "type", - "parameters" + "calculation_type", + "order" ] }, - "RewardTypeMaterial": { - "title": "Reward Type Material", + "EarningRuleProportionalOrderItemsQuantity": { + "title": "Order Items Quantity", + "x-stoplight": { + "id": "pqsn9otpzyot9" + }, "type": "object", "properties": { "type": { "type": "string", "enum": [ - "MATERIAL" + "PROPORTIONAL" ], - "description": "Reward type." + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "parameters": { + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_QUANTITY" + ], + "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in order_items.quantity.object & .id (X points for every Y items excluding free items)" + }, + "order_items": { "type": "object", "required": [ - "product" + "quantity" ], - "description": "Defines how the reward is generated.", "properties": { - "product": { + "quantity": { "type": "object", "required": [ - "id", - "sku" + "every", + "points", + "object", + "id" ], - "description": "Contains information about the product given as a reward.", + "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": { - "id": { + "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": "Unique product ID, assigned by Voucherify." + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] }, - "sku": { - "type": [ - "string", - "null" - ], - "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward." + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } } } @@ -39951,52 +39758,67 @@ }, "required": [ "type", - "parameters" + "calculation_type", + "order_items" ] }, - "RewardTypeCampaign": { - "title": "Reward Type Campaign", + "EarningRuleProportionalOrderItemsAmount": { + "title": "Order Items Amount", + "x-stoplight": { + "id": "8pg4o23daepkb" + }, "type": "object", "properties": { "type": { "type": "string", "enum": [ - "CAMPAIGN" + "PROPORTIONAL" ], - "description": "Reward type." + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "parameters": { + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_AMOUNT" + ], + "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the order_items.amount.object & .id (X points for every Y spent on items excluding discounts)" + }, + "order_items": { "type": "object", "required": [ - "campaign" + "amount" ], - "description": "Defines how the reward is generated.", "properties": { - "campaign": { + "amount": { "type": "object", "required": [ - "id", - "type" + "every", + "points", + "object", + "id" ], - "description": "Objects stores information about the campaign related to the reward.", + "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": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify." + "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." }, - "balance": { + "points": { "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." + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." }, - "type": { + "object": { "type": "string", + "description": "Type of object taken under consideration.", "enum": [ - "DISCOUNT_COUPONS", - "PROMOTION", - "GIFT_VOUCHERS", - "REFERRAL_PROGRAM" - ], - "description": "Campaign type." + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } } } @@ -40005,751 +39827,1400 @@ }, "required": [ "type", - "parameters" + "calculation_type", + "order_items" ] }, - "LoyaltiesGetEarningRuleResponseBody": { - "$ref": "#/components/schemas/EarningRule" - }, - "LoyaltiesEnableEarningRulesResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" + "EarningRuleProportionalOrderItemsSubtotalAmount": { + "title": "Order Items Subtotal Amount", + "x-stoplight": { + "id": "duxy5qw36h5ph" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - { + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_SUBTOTAL_AMOUNT" + ], + "description": "ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the order_items.subtotal_amount.object & .id (X points for every Y spent on items including discounts)" + }, + "order_items": { "type": "object", + "required": [ + "subtotal_amount" + ], "properties": { - "updated_at": { - "type": [ - "string", - "null" + "subtotal_amount": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" ], - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." - }, - "active": { - "type": "boolean", - "default": true, - "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date." + "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": [ - "updated_at", - "active" - ] + } } + }, + "required": [ + "type", + "calculation_type", + "order_items" ] }, - "LoyaltiesDisableEarningRulesResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" + "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": { - "updated_at": { - "type": [ - "string", - "null" + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" ], - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." - }, - "active": { - "type": "boolean", - "default": false, - "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date." + "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": [ - "updated_at", - "active" - ] + } } + }, + "required": [ + "type", + "calculation_type", + "customer" ] }, - "EarningRuleBase": { - "title": "EarningRuleBase", + "EarningRuleProportionalCustomEvent": { + "title": "Custom Event", "type": "object", "properties": { - "id": { + "type": { "type": "string", - "description": "Assigned by the Voucherify API, identifies the earning rule object." + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "created_at": { + "calculation_type": { "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format." - }, - "loyalty": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleFixed" - }, - { - "$ref": "#/components/schemas/EarningRuleProportional" - } - ] - }, - "event": { - "$ref": "#/components/schemas/EarningRuleEvent", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card." + "enum": [ + "CUSTOM_EVENT_METADATA" + ], + "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." }, "custom_event": { - "type": "object", - "properties": { - "schema_id": { - "type": "string" - } - }, - "required": [ - "schema_id" - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. Required for the customer.segment.entered option in event.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - }, - "required": [ - "id" - ] - }, - "source": { "type": "object", "required": [ - "object_id", - "object_type" + "metadata" ], - "description": "Contains the custom earning rule name and parent campaign.", "properties": { - "banner": { - "type": "string", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`.", - "enum": [ - "campaign" - ] - } - } - }, - "object": { - "type": "string", - "enum": [ - "earning_rule" - ], - "description": "The type of object represented by JSON. Default is earning_rule." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify." - }, - "start_date": { - "type": "string", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is inactive before this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." - }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is inactive after this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour." - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day." + "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": [ - "duration", - "interval" - ] - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3` Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 6 } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } }, "required": [ - "id", - "created_at", - "loyalty", - "source", - "object", - "automation_id", - "metadata" - ] - }, - "EarningRuleEvent": { - "title": "EarningRuleEvent", - "type": "string", - "enum": [ - "order.paid", - "customer.segment.entered", - "custom_event", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged", - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left" + "type", + "calculation_type", + "custom_event" ] }, - "EarningRuleFixed": { - "title": "Define fixed amount of points", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "FIXED" - ], - "description": "The number of points to be added to the loyalty card." + "EarningRuleProportional": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrder" }, - "points": { - "type": "integer", - "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points." + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" } - } + ], + "title": "Calculate points proportionally" }, - "EarningRuleProportionalOrder": { + "EarningRuleProportionalOrderItems": { "anyOf": [ { - "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount" + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" }, { - "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount" + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" }, { - "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata" + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" } ], - "title": "Order" + "title": "Order Items" }, - "EarningRuleProportionalOrderAmount": { - "title": "Order Amount", + "LoyaltiesGetPointsExpirationResponseBody": { + "title": "Loyalties Get Points Expiration Response Body", "type": "object", "properties": { - "type": { + "object": { "type": "string", + "pattern": "list", "enum": [ - "PROPORTIONAL" + "list" ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." }, - "calculation_type": { + "data_ref": { "type": "string", + "pattern": "data", "enum": [ - "ORDER_AMOUNT" + "data" ], - "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" + "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects." }, - "order": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "required": [ - "every", - "points" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + "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": [ - "type", - "calculation_type", - "order" + "object", + "data_ref", + "data", + "total" ] }, - "EarningRuleProportionalOrderTotalAmount": { - "title": "Order Total Amount", + "LoyaltiesListCardTransactionsResponseBody": { + "title": "Loyalties List Card Transactions Response Body", "type": "object", "properties": { - "type": { + "object": { "type": "string", + "pattern": "list", "enum": [ - "PROPORTIONAL" + "list" ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "description": "The type of object represented by JSON." }, - "calculation_type": { + "data_ref": { "type": "string", + "pattern": "data", "enum": [ - "ORDER_TOTAL_AMOUNT" + "data" ], - "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" + "description": "Identifies the name of the attribute that contains the array of transaction objects." }, - "order": { - "type": "object", - "required": [ - "total_amount" - ], - "properties": { - "total_amount": { - "type": "object", - "required": [ - "every", - "points" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - } - } - } + "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": [ - "type", - "calculation_type", - "order" + "object", + "data_ref", + "data", + "has_more" ] }, - "EarningRuleProportionalOrderMetadata": { - "title": "Order Metadata", + "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": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "id": { + "type": "string" }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_METADATA" - ], - "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)" + "code": { + "type": "string" }, - "order": { + "loyalty_card": { "type": "object", "required": [ - "metadata" + "points", + "balance" ], - "description": "Defines the formula for calculating points proportionally.", "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the order metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "Order metadata property." - } - } + "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", - "calculation_type", - "order" + "campaign", + "campaign_id", + "object" ] }, - "EarningRuleProportionalOrderItemsQuantity": { - "title": "Order Items Quantity", + "LoyaltyCardTransaction": { + "title": "Loyalty Card Transaction", "type": "object", "properties": { - "type": { + "id": { "type": "string", - "enum": [ - "PROPORTIONAL" + "description": "Unique transaction ID." + }, + "source_id": { + "type": [ + "string", + "null" ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "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." }, - "calculation_type": { + "voucher_id": { "type": "string", - "enum": [ - "ORDER_ITEMS_QUANTITY" + "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": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in order_items.quantity.object & .id (X points for every Y items excluding free items)" + "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." }, - "order_items": { - "type": "object", - "required": [ - "quantity" + "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": { - "quantity": { + "balance": { "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": "Contains information on how the balance was affected by the transaction.", "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." + "type": { + "type": "string", + "pattern": "loyalty_card", + "enum": [ + "loyalty_card" + ], + "description": "The type of voucher whose balance is being adjusted due to the transaction." }, - "points": { + "total": { "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + "description": "The available points prior to the transaction." }, "object": { "type": "string", - "description": "Type of object taken under consideration.", + "pattern": "balance", "enum": [ - "products_collection", - "product", - "sku" - ] + "balance" + ], + "description": "The type of object represented by the JSON." }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." + "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", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalOrderItemsAmount": { - "title": "Order Items Amount", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_AMOUNT" - ], - "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the order_items.amount.object & .id (X points for every Y spent on items excluding discounts)" - }, - "order_items": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", + }, "required": [ - "every", - "points", + "type", + "total", "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.", + "points", + "balance", + "related_object" + ] + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", "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." + "id": { + "type": "string", + "description": "Unique order ID." }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + "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." }, - "object": { + "type": { "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] + "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 ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." + "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", - "calculation_type", - "order_items" + "details", + "related_transaction_id", + "created_at" ] }, - "EarningRuleProportionalOrderItemsSubtotalAmount": { - "title": "Order Items Subtotal Amount", + "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": { - "type": { + "order": { "type": "string", "enum": [ - "PROPORTIONAL" + "created_at", + "-created_at" ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." }, - "calculation_type": { + "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": [ - "ORDER_ITEMS_SUBTOTAL_AMOUNT" + "export" ], - "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)" + "description": "The type of object being represented. This object stores information about the export." }, - "order_items": { + "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": [ - "subtotal_amount" + "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": { - "subtotal_amount": { + "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": [ - "every", - "points", - "object", - "id" + "voucher_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": "Filter condition.", "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." + "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": [ - "type", - "calculation_type", - "order_items" + "id", + "object", + "created_at", + "status", + "channel", + "exported_object", + "parameters", + "result", + "user_id" ] }, - "EarningRuleProportionalCustomerMetadata": { - "title": "Customer Metadata", + "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": [ - "PROPORTIONAL" + "LOYALTY_CARD", + "GIFT_VOUCHER" ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "description": "The type of voucher being modified." }, - "calculation_type": { + "object": { "type": "string", + "pattern": "balance", "enum": [ - "CUSTOMER_METADATA" + "balance" ], - "description": "CUSTOMER_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)" + "description": "The type of object represented by JSON. Default is balance." }, - "customer": { + "related_object": { "type": "object", "required": [ - "metadata" + "type", + "id" ], + "description": "Defines the object that is being modified with the values that are returned in the balance object.", "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" + "type": { + "type": "string", + "enum": [ + "voucher" ], - "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." - } - } + "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", - "calculation_type", - "customer" + "object", + "related_object" ] }, - "EarningRuleProportionalCustomEvent": { - "title": "Custom Event", + "LoyaltiesTransferPointsResponseBody": { + "title": "Loyalties Transfer Points Response Body", "type": "object", "properties": { - "type": { + "id": { "type": "string", - "enum": [ - "PROPORTIONAL" + "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": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." }, - "calculation_type": { + "category_id": { + "type": [ + "string", + "null" + ], + "description": "Unique category ID assigned by Voucherify." + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Category" + } + }, + "type": { "type": "string", "enum": [ - "CUSTOM_EVENT_METADATA" + "LOYALTY_CARD" ], - "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." + "description": "Defines the type of voucher." }, - "custom_event": { + "loyalty_card": { "type": "object", + "description": "Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD.", "required": [ - "metadata" + "points", + "balance" ], "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" + "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": "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.", + "description": "The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute." + }, + "count": { + "type": "integer", + "description": "Publication events counter." + }, + "entries": { + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications" + } + }, + "required": [ + "object" + ] + }, + "redemption": { + "type": "object", + "description": "Stores a summary of redemptions that have been applied to the voucher.", + "properties": { + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "How many times a voucher can be redeemed. A null value means unlimited." + }, + "redeemed_points": { + "type": "integer", + "description": "Total loyalty points redeemed." + }, + "redeemed_quantity": { + "type": "integer", + "description": "How many times a voucher has already been redeemed." + }, + "redemption_entries": { + "type": "array", + "items": { + "type": "string" + } + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute." + }, + "url": { + "type": "string", + "description": "The endpoint where this list of redemptions can be accessed using a GET method. /v1/vouchers/{voucher_code}/redemptions" + } + }, + "required": [ + "quantity" + ] + }, + "active": { + "type": "string", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the start_date and expiration_date.\n\n- `true` indicates an active voucher\n- `false` indicates an inactive voucher" + }, + "additional_info": { + "type": [ + "string", + "null" + ], + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "assets": { + "type": "object", + "description": "Stores links to images of QR and barcode that correspond to an encrypted voucher code.", + "properties": { + "qr": { + "type": "object", + "description": "Stores Quick Response (QR) representation of encrypted code.", "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for." + "id": { + "type": "string", + "example": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==", + "description": "Encrypted voucher code ID." }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + "url": { + "type": "string", + "example": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D", + "description": "URL to QR code \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" + } + } + }, + "barcode": { + "type": "object", + "description": "Stores barcode representation of encrypted code.", + "properties": { + "id": { + "type": "string", + "example": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==", + "description": "Encrypted voucher code ID." }, - "property": { + "url": { "type": "string", - "description": "\nCustom event metadata property." + "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", - "custom_event" + "loyalty_card", + "start_date", + "expiration_date", + "validity_timeframe", + "validity_day_of_week", + "active", + "additional_info", + "metadata", + "is_referral_code", + "created_at" ] }, - "EarningRuleProportional": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrder" + "LoyaltiesTransferPoints": { + "title": "Loyalties Transfer Points", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source)." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" + "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)." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" + "reason": { + "type": "string", + "description": "Reason for the transfer." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" + "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." } - ], - "title": "Calculate points proportionally" + }, + "required": [ + "code", + "points", + "source_id" + ] }, - "EarningRuleProportionalOrderItems": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" + "LoyaltiesTransferPointsRequestBody": { + "title": "Loyalties Transfer Points Request Body", + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltiesTransferPoints" + } + }, + "LoyaltiesAddOrRemoveCardBalanceRequestBody": { + "title": "Loyalties Add Or Remove Card Balance Request Body", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Incremental balance to be added to/subtracted from the loyalty card.\n\n- To add points: 100\n- To subtract points, add a minus: -100" }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" + "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." }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Set expiration date for added points, i.e. `YYYY-MM-DD`. This parameter is required only when expiration_type is set to `CUSTOM_DATE`." + }, + "reason": { + "type": "string", + "description": "Reason for the transfer." + }, + "source_id": { + "type": "string", + "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service." } - ], - "title": "Order Items" + }, + "required": [ + "points" + ] + }, + "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." + }, + "name": { + "type": "string", + "description": "Category name." + }, + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "enum": [ + "category" + ], + "description": "The type of object represented by the JSON. This object stores information about the category." + } + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object" + ] }, "LoyaltiesListMemberRewardsRequestQuery": { "title": "Loyalties List Member Rewards Request Query", @@ -41360,619 +41831,2588 @@ "details" ] }, - "LoyaltiesExportCardTransactionsRequestBody": { - "title": "Loyalties Export Card Transactions Request Body", + "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", + "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "assets": { + "type": "object", + "description": "Stores links to images of QR and barcode that correspond to an encrypted voucher code.", + "properties": { + "qr": { + "type": "object", + "description": "Stores Quick Response (QR) representation of encrypted code.", + "properties": { + "id": { + "type": "string", + "example": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==", + "description": "Encrypted voucher code ID." + }, + "url": { + "type": "string", + "example": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D", + "description": "URL to QR code \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" + } + } + }, + "barcode": { + "type": "object", + "description": "Stores barcode representation of encrypted code.", + "properties": { + "id": { + "type": "string", + "example": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==", + "description": "Encrypted voucher code ID." + }, + "url": { + "type": "string", + "example": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D", + "description": "URL to barcode \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" + } + } + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + }, + "holder_id": { + "type": "string", + "description": "Unique customer ID of voucher owner." + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format.", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "code", + "category", + "category_id", + "type", + "loyalty_card", + "start_date", + "expiration_date", + "validity_timeframe", + "validity_day_of_week", + "active", + "additional_info", + "metadata", + "is_referral_code", + "created_at" + ] + }, + "LoyaltiesTransferPoints": { + "title": "Loyalties Transfer Points", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source)." + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to transfer to another loyalty card. The number of points cannot be higher than the current balance on the loyalty card (source)." + }, + "reason": { + "type": "string", + "description": "Reason for the transfer." + }, + "source_id": { + "type": "string", + "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service." + } + }, + "required": [ + "code", + "points", + "source_id" + ] + }, + "LoyaltiesTransferPointsRequestBody": { + "title": "Loyalties Transfer Points Request Body", + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltiesTransferPoints" + } + }, + "LoyaltiesAddOrRemoveCardBalanceRequestBody": { + "title": "Loyalties Add Or Remove Card Balance Request Body", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Incremental balance to be added to/subtracted from the loyalty card.\n\n- To add points: 100\n- To subtract points, add a minus: -100" + }, + "expiration_type": { + "$ref": "#/components/schemas/PointsExpirationTypes", + "description": "Set the type of expiration for added points.\n\n`PROGRAM_RULES`: Inherit rules from campaign.\n`NON_EXPIRING`: Points never expire.\n`CUSTOM_DATE`: Points expire on a particular date. Requires expiration_date parameter." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Set expiration date for added points, i.e. `YYYY-MM-DD`. This parameter is required only when expiration_type is set to `CUSTOM_DATE`." + }, + "reason": { + "type": "string", + "description": "Reason for the transfer." + }, + "source_id": { + "type": "string", + "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service." + } + }, + "required": [ + "points" + ] + }, + "PointsExpirationTypes": { + "title": "Points Expiration Types", + "type": "string", + "enum": [ + "PROGRAM_RULES", + "CUSTOM_DATE", + "NON_EXPIRING" + ] + }, + "Category": { + "title": "Category", + "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." + }, + "name": { + "type": "string", + "description": "Category name." + }, + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "enum": [ + "category" + ], + "description": "The type of object represented by the JSON. This object stores information about the category." + } + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object" + ] + }, + "ExportsCreateRequestBody": { + "anyOf": [ + { + "title": "Export Vouchers", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportVoucherOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportVoucherFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Redemptions", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "redemption" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportRedemptionOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportRedemptionFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportRedemptionFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Customers", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "customer" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportCustomerOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportCustomerFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportCustomerFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Publications", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "publication" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportPublicationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportPublicationFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportPublicationFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Order", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "order" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportOrderOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportOrderFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportOrderFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Points Expirations", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "points_expiration" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportPointsExpirationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportPointsExpirationFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportPointsExpirationFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Vouchers Transactions Expiration", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher_transactions" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportVoucherTransactionsOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + } + ], + "type": "object" + }, + "ExportBase": { + "title": "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": { - "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." + "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" }, - "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" - } + "$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" } } }, - "LoyaltiesExportCardTransactionsResponseBody": { - "title": "Loyalties Export Card Transactions Response Body", + "ExportVoucherFilters": { + "title": "Export Voucher Filters", "type": "object", - "description": "", "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": { - "type": "string", - "description": "Unique export ID." + "$ref": "#/components/schemas/FieldConditions" }, - "object": { - "type": "string", - "pattern": "export", - "enum": [ - "export" - ], - "description": "The type of object being represented. This object stores information about the export." + "is_referral_code": { + "$ref": "#/components/schemas/FieldConditions" }, "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" + "$ref": "#/components/schemas/FieldConditions" }, - "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." + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered." + "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", - "pattern": "voucher_transactions", "enum": [ - "voucher_transactions" + "redemption" ], - "description": "The type of exported object." + "description": "The type of object to be exported." }, "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", + "$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.\n\n`id`, `campaign_id`, `voucher_id`, `type`, `source_id`, `reason`, `source`, `balance`, `amount`, `related_transaction_id`, `created_at`, `details`", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", "items": { - "$ref": "#/components/schemas/LoyaltyCardTransactionsFields" + "$ref": "#/components/schemas/ExportRedemptionFields" } }, "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 - } - } - } - } - } - } - } + "$ref": "#/components/schemas/ExportRedemptionFilters", + "description": "Filter conditions." } - } - }, - "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." + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, "required": [ - "id", - "object", - "created_at", - "status", - "channel", "exported_object", - "parameters", - "result", - "user_id" + "parameters" ] }, - "LoyaltiesAddOrRemoveCardBalanceResponseBody": { - "title": "Loyalties Add Or Remove Card Balance Response Body", + "ExportRedemptionFilters": { + "title": "Export Redemption Filters", "type": "object", - "description": "Response schema for adding or removing points from a loyalty card.", + "additionalProperties": false, "properties": { - "points": { - "type": "integer", - "description": "The incremental points removed or added to the current balance on the loyalty card." + "junction": { + "$ref": "#/components/schemas/Junction" }, - "total": { - "type": "integer", - "description": "The total of points accrued over the lifetime of the loyalty card." + "id": { + "$ref": "#/components/schemas/FieldConditions" }, - "balance": { - "type": "integer", - "minimum": 0, - "description": "The balance after adding/removing points." + "object": { + "$ref": "#/components/schemas/FieldConditions" }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ], - "description": "The type of voucher being modified." + "date": { + "$ref": "#/components/schemas/FieldConditions" }, - "object": { + "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", - "pattern": "balance", "enum": [ - "balance" + "customer" ], - "description": "The type of object represented by JSON. Default is balance." + "description": "The type of object to be exported." }, - "related_object": { + "parameters": { "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." + "order": { + "$ref": "#/components/schemas/ExportCustomerOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." }, - "id": { - "type": "string", - "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API." + "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." } - } - }, - "operation_type": { - "type": "string", - "enum": [ - "MANUAL", - "AUTOMATIC" - ] + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, "required": [ - "points", - "total", - "balance", - "type", - "object", - "related_object" + "exported_object", + "parameters" ] }, - "LoyaltiesTransferPointsResponseBody": { - "title": "Loyalties Transfer Points Response Body", + "ExportCustomerFilters": { + "title": "Export Customer Filters", "type": "object", "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "name": { + "$ref": "#/components/schemas/FieldConditions" + }, "id": { - "type": "string", - "description": "Assigned by the Voucherify API, identifies the voucher." + "$ref": "#/components/schemas/FieldConditions" }, - "code": { - "type": "string", - "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." + "description": { + "$ref": "#/components/schemas/FieldConditions" }, - "campaign": { - "type": "string", - "description": "A unique campaign name, identifies the voucher's parent campaign." + "email": { + "$ref": "#/components/schemas/FieldConditions" }, - "campaign_id": { - "type": "string", - "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." + "source_id": { + "$ref": "#/components/schemas/FieldConditions" }, - "category": { - "type": [ - "string", - "null" - ], - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." + "created_at": { + "$ref": "#/components/schemas/FieldConditions" }, - "category_id": { - "type": [ - "string", - "null" - ], - "description": "Unique category ID assigned by Voucherify." + "address_city": { + "$ref": "#/components/schemas/FieldConditions" }, - "categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Category" - } + "address_state": { + "$ref": "#/components/schemas/FieldConditions" }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ], - "description": "Defines the type of voucher." + "address_line_1": { + "$ref": "#/components/schemas/FieldConditions" }, - "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." - } - } + "address_line_2": { + "$ref": "#/components/schemas/FieldConditions" }, - "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" + "address_country": { + "$ref": "#/components/schemas/FieldConditions" }, - "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" + "address_postal_code": { + "$ref": "#/components/schemas/FieldConditions" }, - "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." - } - } + "redemptions_total_redeemed": { + "$ref": "#/components/schemas/FieldConditions" }, - "validity_day_of_week": { - "type": [ - "array", - "null" + "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": "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 - } + "description": "The type of object to be exported." }, - "publish": { + "parameters": { "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." + "order": { + "$ref": "#/components/schemas/ExportPublicationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." }, - "entries": { + "fields": { "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", "items": { - "type": "string" + "$ref": "#/components/schemas/ExportPublicationFields" } }, - "url": { - "type": "string", - "description": "The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications" + "filters": { + "$ref": "#/components/schemas/ExportPublicationFilters", + "description": "Filter conditions." } }, - "required": [ - "object" - ] + "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" }, - "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." + "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." }, - "redemption_entries": { + "fields": { "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", "items": { - "type": "string" + "$ref": "#/components/schemas/ExportOrderFields" } }, - "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" + "filters": { + "$ref": "#/components/schemas/ExportOrderFilters", + "description": "Filter conditions." } }, - "required": [ - "quantity" - ] + "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" }, - "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" + "id": { + "$ref": "#/components/schemas/FieldConditions" }, - "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." + "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": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportPointsExpiration": { + "title": "Export Points Expirations", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "points_expiration" + ], + "description": "The type of object to be exported." }, - "assets": { + "parameters": { "type": "object", - "description": "Stores links to images of QR and barcode that correspond to an encrypted voucher code.", "properties": { - "qr": { - "type": "object", - "description": "Stores Quick Response (QR) representation of encrypted code.", - "properties": { - "id": { - "type": "string", - "example": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==", - "description": "Encrypted voucher code ID." - }, - "url": { - "type": "string", - "example": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D", - "description": "URL to QR code \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" - } - } + "order": { + "$ref": "#/components/schemas/ExportPointsExpirationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." }, - "barcode": { - "type": "object", - "description": "Stores barcode representation of encrypted code.", - "properties": { - "id": { - "type": "string", - "example": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==", - "description": "Encrypted voucher code ID." - }, - "url": { - "type": "string", - "example": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D", - "description": "URL to barcode \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" - } + "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." } - } - }, - "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" + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, "required": [ - "id", - "code", - "category", - "category_id", - "type", - "loyalty_card", - "start_date", - "expiration_date", - "validity_timeframe", - "validity_day_of_week", - "active", - "additional_info", - "metadata", - "is_referral_code", - "created_at" + "exported_object", + "parameters" ] }, - "LoyaltiesTransferPoints": { - "title": "Loyalties Transfer Points", + "ExportPointsExpirationFilters": { + "title": "Export Points Expiration Filters", "type": "object", "properties": { - "code": { - "type": "string", - "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source)." + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "voucher_id": { + "$ref": "#/components/schemas/FieldConditions" }, "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)." + "$ref": "#/components/schemas/FieldConditions" }, - "reason": { - "type": "string", - "description": "Reason for the transfer." + "status": { + "$ref": "#/components/schemas/FieldConditions" }, - "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." + "expires_at": { + "$ref": "#/components/schemas/FieldConditions" } - }, - "required": [ - "code", - "points", - "source_id" - ] - }, - "LoyaltiesTransferPointsRequestBody": { - "title": "Loyalties Transfer Points Request Body", - "type": "array", - "items": { - "$ref": "#/components/schemas/LoyaltiesTransferPoints" } }, - "LoyaltiesAddOrRemoveCardBalanceRequestBody": { - "title": "Loyalties Add Or Remove Card Balance Request Body", + "ExportVoucherTransactionsExpiration": { + "title": "Export Vouchers Transactions Expiration", "type": "object", "properties": { - "points": { - "type": "integer", - "description": "Incremental balance to be added to/subtracted from the loyalty card.\n\n- To add points: 100\n- To subtract points, add a minus: -100" - }, - "expiration_type": { - "$ref": "#/components/schemas/PointsExpirationTypes", - "description": "Set the type of expiration for added points.\n\n`PROGRAM_RULES`: Inherit rules from campaign.\n`NON_EXPIRING`: Points never expire.\n`CUSTOM_DATE`: Points expire on a particular date. Requires expiration_date parameter." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Set expiration date for added points, i.e. `YYYY-MM-DD`. This parameter is required only when expiration_type is set to `CUSTOM_DATE`." - }, - "reason": { + "exported_object": { "type": "string", - "description": "Reason for the transfer." + "enum": [ + "voucher_transactions" + ], + "description": "The type of object to be exported." }, - "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." + "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": [ - "points" - ] - }, - "PointsExpirationTypes": { - "title": "Points Expiration Types", - "type": "string", - "enum": [ - "PROGRAM_RULES", - "CUSTOM_DATE", - "NON_EXPIRING" + "exported_object", + "parameters" ] }, - "Category": { - "title": "Category", - "x-stoplight": { - "id": "4l87q60w8ta36" - }, + "ExportVoucherTransactionsFilters": { + "title": "Export Voucher Transactions Filters", "type": "object", - "description": "This is an object representing a category.", "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, "id": { - "type": "string", - "description": "Unique category ID assigned by Voucherify." + "$ref": "#/components/schemas/FieldConditions" }, - "name": { - "type": "string", - "description": "Category name." + "campaign_id": { + "$ref": "#/components/schemas/FieldConditions" }, - "hierarchy": { - "type": "integer", - "description": "Category hierarchy." + "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": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the category was created in ISO 8601 format." + "$ref": "#/components/schemas/FieldConditions" }, - "updated_at": { + "details": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportsGetResponseBody": { + "$ref": "#/components/schemas/Export", + "title": "" + }, + "ExportsListResponseBody": { + "title": "Exports List Response Body", + "type": "object", + "properties": { + "object": { "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format." + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about exports." }, - "object": { + "data_ref": { "type": "string", "enum": [ - "category" + "exports" ], - "description": "The type of object represented by the JSON. This object stores information about the category." + "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", - "hierarchy", + "-name", + "id", + "-id", + "description", + "-description", + "email", + "-email", + "source_id", + "-source_id", "created_at", - "object" + "-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", @@ -65727,7 +68167,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" + "$ref": "#/components/schemas/8_req_add_remove_points_balance" }, "examples": { "Add points": { @@ -65752,7 +68192,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, "examples": { "Add balance": { @@ -65841,7 +68281,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" + "$ref": "#/components/schemas/8_req_add_remove_points_balance" }, "examples": { "Subtract points": { @@ -65866,7 +68306,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, "examples": { "Subtract Points": { @@ -65950,7 +68390,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesTransferPointsRequestBody" + "$ref": "#/components/schemas/8_req_transfer_loyalty_points" }, "examples": { "Example": { @@ -65975,7 +68415,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesTransferPointsResponseBody" + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" }, "examples": { "Example": { @@ -66087,7 +68527,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" }, "examples": { "Example": { @@ -66428,7 +68868,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" }, "examples": { "Example": { @@ -66761,7 +69201,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" }, "examples": { "Example": { @@ -66794,7 +69234,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_obj_export_transactions_object" }, "examples": { "Example": { @@ -66927,7 +69367,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" }, "examples": { "Example": { @@ -66960,7 +69400,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" + "$ref": "#/components/schemas/8_obj_export_transactions_object" }, "examples": { "Example": { @@ -67102,7 +69542,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" + "$ref": "#/components/schemas/8_res_get_points_expiration" }, "examples": { "Example": { @@ -70075,7 +72515,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" + "$ref": "#/components/schemas/4_obj_reward_object" }, "examples": { "Material": { @@ -70608,7 +73048,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" + "$ref": "#/components/schemas/4_obj_reward_assignment_object" }, "examples": { "Example": { @@ -72692,7 +75132,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" + "$ref": "#/components/schemas/8_res_list_loyalty_tiers" }, "examples": { "Example": { @@ -72815,43 +75255,6 @@ } } } - }, - "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}": { @@ -72897,7 +75300,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesGetTierResponseBody" + "$ref": "#/components/schemas/8_obj_loyalty_tier_object" }, "examples": { "Example": { @@ -72987,7 +75390,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" + "$ref": "#/components/schemas/8_res_get_member_loyalty_tier" }, "examples": { "Example": { @@ -73110,7 +75513,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesRequestQuery" + "$ref": "#/components/schemas/8_res_list_loyalty_tier_earning_rules" }, "examples": { "example-1": { 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