From 5d9970022eccf39cd9d3ea1231bc498995d00dcd Mon Sep 17 00:00:00 2001 From: Marcin Slezak Date: Thu, 28 Sep 2023 15:55:23 +0200 Subject: [PATCH] - markdown tables - add types --- .../ASYNC-ACTIONS-API-Async-Action-Object.md | 184 +++++----- .../CAMPAIGNS-API-Campaign-Object.md | 316 +++++++++--------- .../CATEGORIES-API-Category-Object.md | 14 +- .../CONSENTS-API-Consents-Object.md | 6 +- .../CUSTOMERS-API-Customer-Activity-Object.md | 12 +- .../CUSTOMERS-API-Customer-Object.md | 38 +-- .../EXPORTS-API-Export-Object.md | 126 +++---- .../LOYALTIES-API-Loyalty-Campaign-Object.md | 118 +++---- .../LOYALTIES-API-Loyalty-Card-Object.md | 68 ++-- .../LOYALTIES-API-Loyalty-Tier-Object.md | 36 +- ...DATA-SCHEMAS-API-Metadata-Schema-Object.md | 16 +- .../reference-docs/ORDERS-API-Order-Object.md | 44 +-- .../PRODUCTS-API-Product-Object.md | 58 ++-- .../reference-docs/PRODUCTS-API-SKU-Object.md | 26 +- .../PROMOTIONS-API-Promotion-Tier-Object.md | 142 ++++---- .../PUBLICATIONS-API-Publication-Object.md | 124 +++---- ...QUALIFICATIONS-API-Qualification-Object.md | 60 ++-- .../REWARDS-API-Reward-Assignment-Object.md | 18 +- .../REWARDS-API-Reward-Object.md | 54 +-- .../SEGMENTS-API-Customer-Segment-Object.md | 16 +- ...COUNTS-API-Stackable-Redemptions-Object.md | 52 +-- ...S-API-Validation-Rule-Assignment-Object.md | 14 +- ...DATION-RULES-API-Validation-Rule-Object.md | 22 +- .../VOUCHERS-API-Voucher-Object.md | 134 ++++---- scripts/src/schema-to-md-table.ts | 12 +- scripts/update-md-tables-in-doc.ts | 4 +- 26 files changed, 860 insertions(+), 854 deletions(-) diff --git a/docs/reference-docs/ASYNC-ACTIONS-API-Async-Action-Object.md b/docs/reference-docs/ASYNC-ACTIONS-API-Async-Action-Object.md index 8d728c063..e1d5b6e68 100644 --- a/docs/reference-docs/ASYNC-ACTIONS-API-Async-Action-Object.md +++ b/docs/reference-docs/ASYNC-ACTIONS-API-Async-Action-Object.md @@ -8,145 +8,145 @@ hidden: false order: 1 --- - +## Async Action Object | Attributes | Description | |:-----|:--------| -| id |

Async action unique ID.

**Example:**

aa_0adad13d6f057f088e

| -| type |

Type of async action.

Available values: `CAMPAIGN.VOUCHERS_IMPORT`, `CAMPAIGN.VOUCHERS_IMPORT_CSV`, `CAMPAIGN.VOUCHERS_UPDATE`, `CAMPAIGN.VOUCHERS_DELETE`, `CAMPAIGN.VOUCHERS_GENERATE`, `CAMPAIGNS.METADATA_KEY_PURGE`, `CUSTOMERS.IMPORT_CSV`, `CUSTOMERS.BULK_UPDATE`, `CUSTOMERS.METADATA_UPDATE`, `CUSTOMERS.METADATA_KEY_PURGE`, `PRODUCTS.BULK_UPDATE`, `PRODUCTS.METADATA_UPDATE`, `PRODUCTS.METADATA_KEY_PURGE`, `PRODUCTS.IMPORT_CSV`, `SKUS.IMPORT_CSV`, `VOUCHERS.IMPORT`, `VOUCHERS.IMPORT_CSV`, `VOUCHERS.BULK_UPDATE`, `VOUCHERS.METADATA_UPDATE`, `VOUCHERS.METADATA_KEY_PURGE`, `ORDERS.IMPORT`, `ORDERS.METADATA_KEY_PURGE` | -| status |

Status of async action. Informs you whether the async action has already been completed.

Available values: `ENQUEUED`, `IN_PROGRESS`, `DONE`, `FAILED` | +| id
`string` |

Async action unique ID.

**Example:**

aa_0adad13d6f057f088e

| +| type
`string` |

Type of async action.

Available values: `CAMPAIGN.VOUCHERS_IMPORT`, `CAMPAIGN.VOUCHERS_IMPORT_CSV`, `CAMPAIGN.VOUCHERS_UPDATE`, `CAMPAIGN.VOUCHERS_DELETE`, `CAMPAIGN.VOUCHERS_GENERATE`, `CAMPAIGNS.METADATA_KEY_PURGE`, `CUSTOMERS.IMPORT_CSV`, `CUSTOMERS.BULK_UPDATE`, `CUSTOMERS.METADATA_UPDATE`, `CUSTOMERS.METADATA_KEY_PURGE`, `PRODUCTS.BULK_UPDATE`, `PRODUCTS.METADATA_UPDATE`, `PRODUCTS.METADATA_KEY_PURGE`, `PRODUCTS.IMPORT_CSV`, `SKUS.IMPORT_CSV`, `VOUCHERS.IMPORT`, `VOUCHERS.IMPORT_CSV`, `VOUCHERS.BULK_UPDATE`, `VOUCHERS.METADATA_UPDATE`, `VOUCHERS.METADATA_KEY_PURGE`, `ORDERS.IMPORT`, `ORDERS.METADATA_KEY_PURGE` | +| status
`string` |

Status of async action. Informs you whether the async action has already been completed.

Available values: `ENQUEUED`, `IN_PROGRESS`, `DONE`, `FAILED` | | result | Any of: [CAMPAIGN.VOUCHERS_IMPORT](#campaign.vouchers_import), [CAMPAIGN.VOUCHERS_IMPORT_CSV](#campaign.vouchers_import_csv), [CAMPAIGN.VOUCHERS_UPDATE](#campaign.vouchers_update), [CAMPAIGN.VOUCHERS_DELETE](#campaign.vouchers_delete), [CAMPAIGN.VOUCHERS_GENERATE](#campaign.vouchers_generate), [CAMPAIGNS.METADATA_KEY_PURGE](#campaigns.metadata_key_purge), [CUSTOMERS.IMPORT_CSV](#customers.import_csv), [CUSTOMERS.BULK_UPDATE](#customers.bulk_update), [CUSTOMERS.METADATA_UPDATE](#customers.metadata_update), [CUSTOMERS.METADATA_KEY_PURGE](#customers.metadata_key_purge), [PRODUCTS.BULK_UPDATE](#products.bulk_update), [PRODUCTS.METADATA_UPDATE](#products.metadata_update), [PRODUCTS.IMPORT_CSV](#products.import_csv), [SKUS.IMPORT_CSV](#skus.import_csv), [PRODUCTS.METADATA_KEY_PURGE](#products.metadata_key_purge), [VOUCHERS.IMPORT](#vouchers.import), [VOUCHERS.IMPORT_CSV](#vouchers.import_csv), [VOUCHERS.BULK_UPDATE](#vouchers.bulk_update), [VOUCHERS.METADATA_UPDATE](#vouchers.metadata_update), [VOUCHERS.METADATA_KEY_PURGE](#vouchers.metadata_key_purge), [ORDERS.IMPORT](#orders.import), [ORDERS.METADATA_KEY_PURGE](#orders.metadata_key_purge) | -| created_at |

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

**Example:**

2022-06-23T11:21:45.578Z

| -| updated_at |

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

**Example:**

2022-06-23T11:21:46.795Z

| -| request_id |

Unique request ID.

**Example:**

v-0b45cee140c3c9b5ca

| -| processing_time |

The length of time it took to process the request in milliseconds.

**Example:**

1217

| -| progress |

% progress to completion of the asynchronous action.

| -| object |

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

| -# CAMPAIGN.VOUCHERS_IMPORT +| created_at
`string` |

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

**Example:**

2022-06-23T11:21:45.578Z

| +| updated_at
`string` |

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

**Example:**

2022-06-23T11:21:46.795Z

| +| request_id
`string` |

Unique request ID.

**Example:**

v-0b45cee140c3c9b5ca

| +| processing_time
`integer` |

The length of time it took to process the request in milliseconds.

**Example:**

1217

| +| progress
`integer` |

% progress to completion of the asynchronous action.

| +| object
`string` |

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

| +## CAMPAIGN.VOUCHERS_IMPORT | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
code

Unique voucher code.

reason

Detailed failure cause for the voucher code import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# CAMPAIGN.VOUCHERS_IMPORT_CSV +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`array` |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
code
string

Unique voucher code.

reason
string

Detailed failure cause for the voucher code import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## CAMPAIGN.VOUCHERS_IMPORT_CSV | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
code

Unique voucher code.

row

The CSV file row number where the code definition is recorded. The row counter excludes the file headers row.

reason

Detailed failure cause for the voucher code import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# CAMPAIGN.VOUCHERS_UPDATE +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`array` |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
code
string

Unique voucher code.

row
integer

The CSV file row number where the code definition is recorded. The row counter excludes the file headers row.

reason
string

Detailed failure cause for the voucher code import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## CAMPAIGN.VOUCHERS_UPDATE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| -# CAMPAIGN.VOUCHERS_DELETE +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## CAMPAIGN.VOUCHERS_DELETE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| -# CAMPAIGN.VOUCHERS_GENERATE +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## CAMPAIGN.VOUCHERS_GENERATE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| -# CAMPAIGNS.METADATA_KEY_PURGE +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## CAMPAIGNS.METADATA_KEY_PURGE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| -# CUSTOMERS.IMPORT_CSV +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## CUSTOMERS.IMPORT_CSV | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
source_id

Unique customer ID from your inventory system as indicated in the CSV file.

row

The CSV file row number where the customer is recorded. The row counter excludes the file headers row.

reason

Detailed failure cause for the customer import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# CUSTOMERS.BULK_UPDATE +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`array` |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
source_id
string

Unique customer ID from your inventory system as indicated in the CSV file.

row
integer

The CSV file row number where the customer is recorded. The row counter excludes the file headers row.

reason
string

Detailed failure cause for the customer import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## CUSTOMERS.BULK_UPDATE | Attributes | Description | |:-----|:--------| -| results |

An array of statuses for each record.

Array of:
AttributesDescription
source_id

Unique customer source_id.

updated

Indicates whether the record was updated.

found

Indicates whether the record was found.

| -| done_count |

Number or resources processed successfully.

| -# CUSTOMERS.METADATA_UPDATE +| results
`array` |

An array of statuses for each record.

Array of:
AttributesDescription
source_id
string

Unique customer source_id.

updated
boolean

Indicates whether the record was updated.

found
boolean

Indicates whether the record was found.

| +| done_count
`integer` |

Number or resources processed successfully.

| +## CUSTOMERS.METADATA_UPDATE | Attributes | Description | |:-----|:--------| -| results |

An array of statuses for each record.

Array of:
AttributesDescription
source_id

Unique customer source_id.

updated

Indicates whether the record was updated.

found

Indicates whether the record was found.

| -| done_count |

Number of resources processed successfully.

| -# CUSTOMERS.METADATA_KEY_PURGE +| results
`array` |

An array of statuses for each record.

Array of:
AttributesDescription
source_id
string

Unique customer source_id.

updated
boolean

Indicates whether the record was updated.

found
boolean

Indicates whether the record was found.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## CUSTOMERS.METADATA_KEY_PURGE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| -# PRODUCTS.BULK_UPDATE +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## PRODUCTS.BULK_UPDATE | Attributes | Description | |:-----|:--------| -| results |

An array of statuses for each record.

Array of:
AttributesDescription
source_id

Unique product source_id.

updated

Indicates whether the record was updated.

found

Indicates whether the record was found.

| -| done_count |

Number of resources processed successfully.

| -# PRODUCTS.METADATA_UPDATE +| results
`array` |

An array of statuses for each record.

Array of:
AttributesDescription
source_id
string

Unique product source_id.

updated
boolean

Indicates whether the record was updated.

found
boolean

Indicates whether the record was found.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## PRODUCTS.METADATA_UPDATE | Attributes | Description | |:-----|:--------| -| results |

An array of statuses for each record.

Array of:
AttributesDescription
source_id

Unique product source_id.

updated

Indicates whether the record was updated.

found

Indicates whether the record was found.

| -| done_count |

Number of resources processed successfully.

| -# PRODUCTS.IMPORT_CSV +| results
`array` |

An array of statuses for each record.

Array of:
AttributesDescription
source_id
string

Unique product source_id.

updated
boolean

Indicates whether the record was updated.

found
boolean

Indicates whether the record was found.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## PRODUCTS.IMPORT_CSV | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
row

The CSV file row number where the product definition is recorded. The row counter excludes the file headers row.

reason

Detailed failure cause for the product import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# SKUS.IMPORT_CSV +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`array` |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
row
integer

The CSV file row number where the product definition is recorded. The row counter excludes the file headers row.

reason
string

Detailed failure cause for the product import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## SKUS.IMPORT_CSV | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

**Example:**

2 sku(s) imported successfully, 6 failed.

| -| failed |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
row

The CSV file row number where the SKU definition is recorded. The row counter excludes the file headers row.

Example:

2

reason

Detailed failure cause for the SKU import.

Example:

Resource sku with id size-small is in use by products with ids [prod_0b0e3441c2462eff2c]

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# PRODUCTS.METADATA_KEY_PURGE +| message
`string` |

A human-readable message providing a short description about the result.

**Example:**

2 sku(s) imported successfully, 6 failed.

| +| failed
`array` |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
row
integer

The CSV file row number where the SKU definition is recorded. The row counter excludes the file headers row.

Example:

2

reason
string

Detailed failure cause for the SKU import.

Example:

Resource sku with id size-small is in use by products with ids [prod_0b0e3441c2462eff2c]

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## PRODUCTS.METADATA_KEY_PURGE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources updated successfully.

| -# VOUCHERS.IMPORT +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources updated successfully.

| +## VOUCHERS.IMPORT | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

AttributesDescription
code

Unique voucher code.

reason

Detailed failure cause for the voucher code import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# VOUCHERS.IMPORT_CSV +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`object` |

If any records failed during the process, this array shows the failure details.

AttributesDescription
code
string

Unique voucher code.

reason
string

Detailed failure cause for the voucher code import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## VOUCHERS.IMPORT_CSV | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
code

Unique voucher code.

row

The CSV file row number where the code definition is recorded. The row counter excludes the file headers row.

reason

Detailed failure cause for the voucher code import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# VOUCHERS.BULK_UPDATE +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`array` |

If any records failed during the process, this array shows the failure details.

Array of:
AttributesDescription
code
string

Unique voucher code.

row
integer

The CSV file row number where the code definition is recorded. The row counter excludes the file headers row.

reason
string

Detailed failure cause for the voucher code import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## VOUCHERS.BULK_UPDATE | Attributes | Description | |:-----|:--------| -| results |

An array of statuses for each record.

Array of:
AttributesDescription
code

Unique voucher code.

updated

Indicates whether the record was updated.

found

Indicates whether the record was found.

| -| done_count |

Number of resources processed successfully.

| -# VOUCHERS.METADATA_UPDATE +| results
`array` |

An array of statuses for each record.

Array of:
AttributesDescription
code
string

Unique voucher code.

updated
boolean

Indicates whether the record was updated.

found
boolean

Indicates whether the record was found.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## VOUCHERS.METADATA_UPDATE | Attributes | Description | |:-----|:--------| -| results |

An array of statuses for each record.

Array of:
AttributesDescription
code

Unique voucher code.

updated

Indicates whether the record was updated.

found

Indicates whether the record was found.

| -| done_count |

Number of resources processed successfully.

| -# VOUCHERS.METADATA_KEY_PURGE +| results
`array` |

An array of statuses for each record.

Array of:
AttributesDescription
code
string

Unique voucher code.

updated
boolean

Indicates whether the record was updated.

found
boolean

Indicates whether the record was found.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## VOUCHERS.METADATA_KEY_PURGE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| -# ORDERS.IMPORT +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| +## ORDERS.IMPORT | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| failed |

If any records failed during the process, this array shows the failure details.

AttributesDescription
source_id

Unique order source ID.

reason

Detailed failure cause for the voucher code import.

| -| done_count |

Number of resources processed successfully.

| -| failed_count |

Number of resources failed to process.

| -# ORDERS.METADATA_KEY_PURGE +| message
`string` |

A human-readable message providing a short description about the result.

| +| failed
`object` |

If any records failed during the process, this array shows the failure details.

AttributesDescription
source_id
string

Unique order source ID.

reason
string

Detailed failure cause for the voucher code import.

| +| done_count
`integer` |

Number of resources processed successfully.

| +| failed_count
`integer` |

Number of resources failed to process.

| +## ORDERS.METADATA_KEY_PURGE | Attributes | Description | |:-----|:--------| -| message |

A human-readable message providing a short description about the result.

| -| done_count |

Number of resources processed successfully.

| +| message
`string` |

A human-readable message providing a short description about the result.

| +| done_count
`integer` |

Number of resources processed successfully.

| [block:html] { diff --git a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md index 1d35064ed..665f31e60 100644 --- a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md +++ b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md @@ -8,198 +8,198 @@ hidden: false order: 1 --- - +## Campaign Object | Attributes | Description | |:-----|:--------| -| id |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_f7fBbQxUuTN7dI7tGOo5XMDA

| -| name |

Campaign name.

| -| description |

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

| -| campaign_type |

Type of campaign.

Available values: `LOYALTY_PROGRAM`, `GIFT_VOUCHERS`, `DISCOUNT_COUPONS`, `PROMOTION`, `REFERRAL_PROGRAM`, `LUCKY_DRAW` | -| type |

Defines whether the campaign can be updated with new vouchers after campaign creation.

Available values: `AUTO_UPDATE`, `STATIC` | +| id
`string` |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_f7fBbQxUuTN7dI7tGOo5XMDA

| +| name
`string` |

Campaign name.

| +| description
`string` |

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

| +| campaign_type
`string` |

Type of campaign.

Available values: `LOYALTY_PROGRAM`, `GIFT_VOUCHERS`, `DISCOUNT_COUPONS`, `PROMOTION`, `REFERRAL_PROGRAM`, `LUCKY_DRAW` | +| type
`string` |

Defines whether the campaign can be updated with new vouchers after campaign creation.

Available values: `AUTO_UPDATE`, `STATIC` | | voucher | Any of: [Discount Voucher](#discount-voucher), [Gift Card](#gift-card), [Loyalty Card](#loyalty-card) | -| auto_join |

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

| -| join_once |

If this value is set to true, customers will be able to join the campaign only once.

| -| use_voucher_metadata_schema |

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

| -| validity_timeframe |

Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

| -| validity_day_of_week |

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

| -| activity_duration_after_publishing |

Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a duration of P24D will be valid for a duration of 24 days.

| -| vouchers_count |

Total number of unique vouchers in campaign.

| -| start_date |

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

**Example:**

2022-09-20T00:00:00.000Z

| -| expiration_date |

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

**Example:**

2022-09-30T00:00:00.000Z

| -| active |

A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the start_date and expiration_date.

| -| metadata |

The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.

| -| created_at |

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

**Example:**

2021-12-01T08:00:50.038Z

| -| updated_at |

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

**Example:**

2022-09-20T09:18:19.623Z

| -| category |

Unique category name.

| -| creation_status |

Indicates the status of the campaign creation.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT`, `MODIFYING` | -| vouchers_generation_status |

Indicates the status of the campaign's vouchers.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT` | -| protected |

Indicates whether the resource can be deleted.

| -| category_id |

Unique category ID that this campaign belongs to.

**Example:**

cat_0b688929a2476386a7

| +| auto_join
`boolean` |

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

| +| join_once
`boolean` |

If this value is set to true, customers will be able to join the campaign only once.

| +| use_voucher_metadata_schema
`boolean` |

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

| +| validity_timeframe
`object` |

Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration
string

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

| +| validity_day_of_week
`array` |

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

| +| activity_duration_after_publishing
`string` |

Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a duration of P24D will be valid for a duration of 24 days.

| +| vouchers_count
`integer` |

Total number of unique vouchers in campaign.

| +| start_date
`string` |

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

**Example:**

2022-09-20T00:00:00.000Z

| +| expiration_date
`string` |

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

**Example:**

2022-09-30T00:00:00.000Z

| +| active
`boolean` |

A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the start_date and expiration_date.

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.

| +| created_at
`string` |

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

**Example:**

2021-12-01T08:00:50.038Z

| +| updated_at
`string` |

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

**Example:**

2022-09-20T09:18:19.623Z

| +| category
`string` |

Unique category name.

| +| creation_status
`string` |

Indicates the status of the campaign creation.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT`, `MODIFYING` | +| vouchers_generation_status
`string` |

Indicates the status of the campaign's vouchers.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT` | +| protected
`boolean` |

Indicates whether the resource can be deleted.

| +| category_id
`string` |

Unique category ID that this campaign belongs to.

**Example:**

cat_0b688929a2476386a7

| | categories | See: [Category Object](#category-object) | -| object |

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

| -| referral_program |

Defines the referee reward and the way a referral is triggered. Context: REFERRAL_PROGRAM.

AttributesDescription
conversion_event_type

How a referral is triggered.

Available values: redemption, custom_event
custom_event

Contains details about the custom event.

AttributesDescription
id

Unique custom event ID.

Example:

ms_fi47Dcu5T0m3v3nT5ch3ma

name

Custom event name.

referee_reward

Defines the referee reward.

AttributesDescription
related_object_parent

Details of the resource from which the reward originates.

AttributesDescription
id

Unique ID of the reward source.

name

Name of the reward source.

object

Type of resource represented by the source of the reward.

type

Type of reward.

Available values: LOYALTY_CARD, GIFT_VOUCHER
amount

The number of points to add to a loyalty card or credits to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

| +| object
`string` |

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

| +| referral_program
`object` |

Defines the referee reward and the way a referral is triggered. Context: REFERRAL_PROGRAM.

AttributesDescription
conversion_event_type
string

How a referral is triggered.

Available values: redemption, custom_event
custom_event
object

Contains details about the custom event.

AttributesDescription
id
string

Unique custom event ID.

Example:

ms_fi47Dcu5T0m3v3nT5ch3ma

name
string

Custom event name.

referee_reward
object

Defines the referee reward.

AttributesDescription
related_object_parent
object

Details of the resource from which the reward originates.

AttributesDescription
id
string

Unique ID of the reward source.

name
string

Name of the reward source.

object
string

Type of resource represented by the source of the reward.

type
string

Type of reward.

Available values: LOYALTY_CARD, GIFT_VOUCHER
amount
string

The number of points to add to a loyalty card or credits to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

| | promotion | See: [Promotion Tiers](#promotion-tiers) | -| loyalty_tiers_expiration |

Defines the expiration mechanism for loyalty tiers.

Any of: [Balance](#balance), [Points in Period](#points-in-period) | -# Discount Voucher +| loyalty_tiers_expiration
`object` |

Defines the expiration mechanism for loyalty tiers.

Any of: [Balance](#balance), [Points in Period](#points-in-period) | +## Discount Voucher | Attributes | Description | |:-----|:--------| -| type |

Type of voucher.

| +| type
`string` |

Type of voucher.

| | discount |

Defines the voucher discount type and details.

One of: [Amount](#amount), [Percentage](#percentage), [Fixed](#fixed), [Unit, single item](#unit-single-item), [Unit, multiple items](#unit-multiple-items), [Shipping](#shipping) | -| redemption |

Defines the redemption limits on vouchers.

AttributesDescription
quantity

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

| -| code_config |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length

Number of characters in a generated code (excluding prefix and postfix).

charset

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix

A text appended before the code.

postfix

A text appended after the code.

pattern

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| -| is_referral_code |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| -# Gift Card +| redemption
`object` |

Defines the redemption limits on vouchers.

AttributesDescription
quantity
integer

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

| +| code_config
`object` |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length
string

Number of characters in a generated code (excluding prefix and postfix).

charset
string

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix
string

A text appended before the code.

postfix
string

A text appended after the code.

pattern
string

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| +| is_referral_code
`boolean` |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| +## Gift Card | Attributes | Description | |:-----|:--------| -| type |

Type of voucher.

| -| gift |

Defines the gift card details.

AttributesDescription
amount

Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

effect

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

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
| -| redemption |

Defines the redemption limits on vouchers.

AttributesDescription
quantity

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

| -| code_config |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length

Number of characters in a generated code (excluding prefix and postfix).

charset

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix

A text appended before the code.

postfix

A text appended after the code.

pattern

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| -| is_referral_code |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| -# Loyalty Card +| type
`string` |

Type of voucher.

| +| gift
`object` |

Defines the gift card details.

AttributesDescription
amount
integer

Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

effect
string

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

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

Defines the redemption limits on vouchers.

AttributesDescription
quantity
integer

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

| +| code_config
`object` |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length
string

Number of characters in a generated code (excluding prefix and postfix).

charset
string

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix
string

A text appended before the code.

postfix
string

A text appended after the code.

pattern
string

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| +| is_referral_code
`boolean` |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| +## Loyalty Card | Attributes | Description | |:-----|:--------| -| type |

Type of voucher.

| -| loyalty_card |

Defines the loyalty card details.

AttributesDescription
points

Initial loyalty card income in points to be applied to the loyalty card at voucher generation.

expiration_rules

Defines point expiration rules.

AttributesDescription
period_type

The expiration period.

Available values: MONTH
period_value

How many periods should pass before the expiration occurs.

rounding_type

Round up expiration till the end of the given period type.

Available values: END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH
| -| redemption |

Defines the redemption limits on vouchers.

AttributesDescription
quantity

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

| -| code_config |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length

Number of characters in a generated code (excluding prefix and postfix).

charset

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix

A text appended before the code.

postfix

A text appended after the code.

pattern

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| -| is_referral_code |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| -# Category Object +| type
`string` |

Type of voucher.

| +| loyalty_card
`object` |

Defines the loyalty card details.

AttributesDescription
points
integer

Initial loyalty card income in points to be applied to the loyalty card at voucher generation.

expiration_rules
object

Defines point expiration rules.

AttributesDescription
period_type
string

The expiration period.

Available values: MONTH
period_value
integer

How many periods should pass before the expiration occurs.

rounding_type
string

Round up expiration till the end of the given period type.

Available values: END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH
| +| redemption
`object` |

Defines the redemption limits on vouchers.

AttributesDescription
quantity
integer

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

| +| code_config
`object` |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length
string

Number of characters in a generated code (excluding prefix and postfix).

charset
string

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix
string

A text appended before the code.

postfix
string

A text appended after the code.

pattern
string

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| +| is_referral_code
`boolean` |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| +## Category Object | Attributes | Description | |:-----|:--------| -| id |

Unique category ID assigned by Voucherify.

| -| name |

Category name.

| -| hierarchy |

Category hierarchy.

| -| created_at |

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

**Example:**

2022-07-14T10:45:13.156Z

| -| updated_at |

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

**Example:**

2022-08-16T10:52:08.094Z

| -| object |

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

| -# Promotion Tiers +| 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.

| +## Promotion Tiers | Attributes | Description | |:-----|:--------| -| object |

The type of object represented by JSON. This object stores information about promotion tiers in a dictionary.

| -| data_ref |

Identifies the name of the attribute that contains the array of promotion tier objects.

| -| tiers |

Contains array of promotion tier objects.

Array of [Promotion Tier Object](#promotion-tier-object) | -| total |

Total number of promotion tiers.

| -| has_more |

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.

| -# Balance +| object
`string` |

The type of object represented by JSON. This object stores information about promotion tiers in a dictionary.

| +| data_ref
`string` |

Identifies the name of the attribute that contains the array of promotion tier objects.

| +| tiers
`array` |

Contains array of promotion tier objects.

Array of [Promotion Tier Object](#promotion-tier-object) | +| total
`integer` |

Total number of promotion tiers.

| +| has_more
`boolean` |

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.

| +## Balance | Attributes | Description | |:-----|:--------| -| qualification_type |

Tier qualification.

BALANCE: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier.

Available values: `BALANCE` | -| start_date |

Defines the conditions for the start date of the tier.

AttributesDescription
type

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.

Available values: IMMEDIATE
| +| qualification_type
`string` |

Tier qualification.

BALANCE: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier.

Available values: `BALANCE` | +| start_date
`object` |

Defines the conditions for the start date of the tier.

AttributesDescription
type
string

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.

Available values: IMMEDIATE
| | expiration_date |

Defines the conditions for the expiration date of a tier.

Any of: [Balance Drop](#balance-drop), [Custom](#custom) | -# Points in Period -| Attributes | Description | -|:-----|:--------| -| qualification_type |

Tier qualification.

POINTS_IN_PERIOD: A customer qualifies for the tier only if the sum of the accumulated points in a defined time interval reaches the tier threshold.

Available values: `POINTS_IN_PERIOD` | -| qualification_period |

Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.

PeriodDefinition
Calendar MonthPoints collected in one calendar month
January, February, March, etc.
Calendar QuarterPoints collected in the quarter
- January - March
- April - June
- July - September
- October - December
Calendar Half-yearPoints collected in the half-year
- January - June
- July - December
Calendar YearPoints collected in one calendar year
January - December
Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | -| start_date |

Defines the conditions for the start date of the tier.

AttributesDescription
type

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.
NEXT_PERIOD: When the next qualification period starts.

Available values: IMMEDIATE, NEXT_PERIOD
| -| expiration_date |

Defines the conditions for the expiration date of a tier.

AttributesDescription
type

What triggers the tier to expire for a customer.
END_OF_PERIOD: Expire tier at the end of the period.
END_OF_NEXT_PERIOD: Expire tier at the end of the next period.

Available values: END_OF_PERIOD, END_OF_NEXT_PERIOD
extend

Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of P3M will be valid for an additional duration of 3 months and a tier with a duration of P1D will be valid for an additional duration of 1 day.

| -# Amount -| Attributes | Description | -|:-----|:--------| -| type |

Applies an amount discount.

| -| amount_off |

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

**Example:**

100

| -| amount_off_formula |

Formula used to calculate the discount.

| -| aggregated_amount_limit |

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

| -| effect |

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

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

Applies a percentage discount.

| -| amount_limit |

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 |

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

| -| percent_off |

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

| -| percent_off_formula |

Formula used to calculate the discount.

| -| effect |

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

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

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

| -| fixed_amount |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| -| fixed_amount_formula |

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

| -| effect |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | -# Unit, single item -| Attributes | Description | -|:-----|:--------| -| type |

Applies a full value discount to item(s).

| -| unit_off |

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

**Example:**

1

| -| unit_off_formula |

Formula used to calculate the number of units.

| -| unit_type |

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

**Example:**

prod_f1r5Tpr0DuC7

| -| effect |

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 |

Applies a full value discount to item(s).

| -| effect |

Defines the effect for adding multiple item types.

| -| units |

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

Array of:
AttributesDescription
unit_off

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

Example:

1

unit_off_formula

Formula used to calculate the number of units.

unit_type

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

Example:

prod_f1r5Tpr0DuC7

effect

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

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

Applies a full value discount to item(s).

| -| unit_off |

Subtracts 1 shipping item from the subtotal.

| -| unit_type |

The shipping product deemed as free.

| -| effect |

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

| -# Promotion Tier Object -| Attributes | Description | -|:-----|:--------| -| id |

Unique promotion tier ID.

**Example:**

promo_63fYCt81Aw0h7lzyRkrGZh9p

| -| created_at |

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 |

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

**Example:**

2022-02-09T09:20:05.603Z

| -| name |

Name of the promotion tier.

| -| banner |

Text to be displayed to your customers on your website.

| -| action |

Contains details about the discount applied by the promotion tier.

AttributesDescription
discount

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

Any of: Amount, Percentage, Fixed, Unit, single item, Unit, multiple items, Shipping
| -| metadata |

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 |

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 |

Contains details about promotion tier's parent campaign.

AttributesDescription
id

Unique campaign ID.

start_date

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

Example:

2022-09-22T00:00:00.000Z

expiration_date

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

Example:

2022-09-30T00:00:00.000Z

validity_timeframe

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

AttributesDescription
interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

validity_day_of_week

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

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

A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the start_date and expiration_date using the Disable Campaign endpoint.

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

Unique category ID that this campaign belongs to.

Example:

cat_0b688929a2476386a6

object

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

| -| campaign_id |

Promotion tier's parent campaign's unique ID.

| -| active |

A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the start_date and expiration_date.

| -| start_date |

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

**Example:**

2022-09-23T00:00:00.000Z

| -| expiration_date |

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 |

Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an interval of P2D will be active every other day.

duration

Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a duration of P1D will be valid for a duration of one day.

| -| validity_day_of_week |

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

| -| summary |

Contains statistics about promotion tier redemptions and orders.

AttributesDescription
redemptions

Contains statistics about promotion tier redemptions.

AttributesDescription
total_redeemed

Number of times the promotion tier was redeemed.

orders

Contains statistics about orders related to the promotion tier.

AttributesDescription
total_amount

Sum of order totals.

total_discount_amount

Sum of total discount applied using the promotion tier.

| -| object |

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

| +## Points in Period +| Attributes | Description | +|:-----|:--------| +| qualification_type
`string` |

Tier qualification.

POINTS_IN_PERIOD: A customer qualifies for the tier only if the sum of the accumulated points in a defined time interval reaches the tier threshold.

Available values: `POINTS_IN_PERIOD` | +| qualification_period
`string` |

Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.

PeriodDefinition
Calendar MonthPoints collected in one calendar month
January, February, March, etc.
Calendar QuarterPoints collected in the quarter
- January - March
- April - June
- July - September
- October - December
Calendar Half-yearPoints collected in the half-year
- January - June
- July - December
Calendar YearPoints collected in one calendar year
January - December
Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | +| start_date
`object` |

Defines the conditions for the start date of the tier.

AttributesDescription
type
string

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.
NEXT_PERIOD: When the next qualification period starts.

Available values: IMMEDIATE, NEXT_PERIOD
| +| expiration_date
`object` |

Defines the conditions for the expiration date of a tier.

AttributesDescription
type
string

What triggers the tier to expire for a customer.
END_OF_PERIOD: Expire tier at the end of the period.
END_OF_NEXT_PERIOD: Expire tier at the end of the next period.

Available values: END_OF_PERIOD, END_OF_NEXT_PERIOD
extend
string

Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of P3M will be valid for an additional duration of 3 months and a tier with a duration of P1D will be valid for an additional duration of 1 day.

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

Applies an amount discount.

| +| amount_off
`integer` |

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

**Example:**

100

| +| amount_off_formula
`string` |

Formula used to calculate the discount.

| +| aggregated_amount_limit
`integer` |

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

| +| effect
`string` |

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

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

Applies a percentage discount.

| +| amount_limit
`string` |

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

| +| aggregated_amount_limit
`integer` |

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

| +| percent_off
`integer` |

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

| +| percent_off_formula
`string` |

Formula used to calculate the discount.

| +| effect
`string` |

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

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

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

| +| fixed_amount
`integer` |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| +| fixed_amount_formula
`string` |

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

| +| effect
`string` |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | +## Unit, single item +| Attributes | Description | +|:-----|:--------| +| type
`string` |

Applies a full value discount to item(s).

| +| unit_off
`number` |

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

**Example:**

1

| +| unit_off_formula
`string` |

Formula used to calculate the number of units.

| +| unit_type
`string` |

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

**Example:**

prod_f1r5Tpr0DuC7

| +| effect
`string` |

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

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

Applies a full value discount to item(s).

| +| effect
`string` |

Defines the effect for adding multiple item types.

| +| units
`array` |

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

Array of:
AttributesDescription
unit_off
integer

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

Example:

1

unit_off_formula
string

Formula used to calculate the number of units.

unit_type
string

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

Example:

prod_f1r5Tpr0DuC7

effect
string

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

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

Applies a full value discount to item(s).

| +| unit_off
`number` |

Subtracts 1 shipping item from the subtotal.

| +| unit_type
`string` |

The shipping product deemed as free.

| +| effect
`string` |

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

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

Unique promotion tier ID.

**Example:**

promo_63fYCt81Aw0h7lzyRkrGZh9p

| +| created_at
`string` |

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

**Example:**

2021-12-15T11:34:01.333Z

| +| updated_at
`string` |

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

**Example:**

2022-02-09T09:20:05.603Z

| +| name
`string` |

Name of the promotion tier.

| +| banner
`string` |

Text to be displayed to your customers on your website.

| +| action
`object` |

Contains details about the discount applied by the promotion tier.

AttributesDescription
discount

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

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

The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format.

| +| hierarchy
`integer` |

The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy.

| +| campaign
`object` |

Contains details about promotion tier's parent campaign.

AttributesDescription
id
string

Unique campaign ID.

start_date
string

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

Example:

2022-09-22T00:00:00.000Z

expiration_date
string

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

Example:

2022-09-30T00:00:00.000Z

validity_timeframe
object

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

AttributesDescription
interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration
string

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

validity_day_of_week
array

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

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

A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the start_date and expiration_date using the Disable Campaign endpoint.

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

Unique category ID that this campaign belongs to.

Example:

cat_0b688929a2476386a6

object
string

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

| +| campaign_id
`string` |

Promotion tier's parent campaign's unique ID.

| +| active
`boolean` |

A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the start_date and expiration_date.

| +| start_date
`string` |

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

**Example:**

2022-09-23T00:00:00.000Z

| +| expiration_date
`string` |

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

**Example:**

2022-09-26T00:00:00.000Z

| +| validity_timeframe
`object` |

Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an interval of P2D will be active every other day.

duration
string

Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a duration of P1D will be valid for a duration of one day.

| +| validity_day_of_week
`array` |

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

| +| summary
`object` |

Contains statistics about promotion tier redemptions and orders.

AttributesDescription
redemptions
object

Contains statistics about promotion tier redemptions.

AttributesDescription
total_redeemed
integer

Number of times the promotion tier was redeemed.

orders
object

Contains statistics about orders related to the promotion tier.

AttributesDescription
total_amount
integer

Sum of order totals.

total_discount_amount
integer

Sum of total discount applied using the promotion tier.

| +| object
`string` |

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

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

Promotion tier category ID.

**Example:**

cat_0c9da30e7116ba6bba

| +| 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) | -# Balance Drop +## Balance Drop | Attributes | Description | |:-----|:--------| -| type |

What triggers the tier to expire for a customer.
BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.

Available values: `BALANCE_DROP` | -# Custom +| type
`string` |

What triggers the tier to expire for a customer.
BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.

Available values: `BALANCE_DROP` | +## Custom | Attributes | Description | |:-----|:--------| -| type |

What triggers the tier to expire for a customer.
CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.

Available values: `CUSTOM` | -| extend |

Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months.

| +| type
`string` |

What triggers the tier to expire for a customer.
CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.

Available values: `CUSTOM` | +| extend
`string` |

Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months.

| | rounding |

Defines the rounding mechanism for tier expiration.

Any of: [Calendar Periods](#calendar-periods), [Specific Month](#specific-month) | -# Validation Rule Assignments +## Validation Rule Assignments | Attributes | Description | |:-----|:--------| -| object |

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

| -| data_ref |

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

| -| data |

A dictionary that contains an array of validation rule assignments.

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

Total number of validation rule assignments.

| -# Calendar Periods +| 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.

| +## Calendar Periods | Attributes | Description | |:-----|:--------| -| type |

Period to which the expiration will be rounded to.

Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | -| strategy |

Which portion of the given period should the rounding be applied to.

Available values: `END` | -# Specific Month +| type
`string` |

Period to which the expiration will be rounded to.

Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | +| strategy
`string` |

Which portion of the given period should the rounding be applied to.

Available values: `END` | +## Specific Month | Attributes | Description | |:-----|:--------| -| type |

This mechanism describes a custom rounding for the expiration date.

Available values: `CUSTOM` | -| strategy |

Which portion of the given period should the rounding be applied to.

Available values: `END` | -| unit |

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

Available values: `MONTH` | -| value |

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

| -# Validation Rule Assignment Object +| type
`string` |

This mechanism describes a custom rounding for the expiration date.

Available values: `CUSTOM` | +| strategy
`string` |

Which portion of the given period should the rounding be applied to.

Available values: `END` | +| unit
`string` |

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

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

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

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

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| -| rule_id |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| -| related_object_id |

The resource ID to which the validation rule was assigned.

**Example:**

v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

| -| related_object_type |

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

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

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

**Example:**

2022-02-17T08:18:15.085Z

| -| object |

The type of object represented by the ID.

| +| id
`string` |

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| +| rule_id
`string` |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| +| related_object_id
`string` |

The resource ID to which the validation rule was assigned.

**Example:**

v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

| +| related_object_type
`string` |

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

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

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

**Example:**

2022-02-17T08:18:15.085Z

| +| object
`string` |

The type of object represented by the ID.

| [block:html] { diff --git a/docs/reference-docs/CATEGORIES-API-Category-Object.md b/docs/reference-docs/CATEGORIES-API-Category-Object.md index 0806f85e2..963b8f563 100644 --- a/docs/reference-docs/CATEGORIES-API-Category-Object.md +++ b/docs/reference-docs/CATEGORIES-API-Category-Object.md @@ -8,15 +8,15 @@ hidden: false order: 1 --- - +## Category Object | Attributes | Description | |:-----|:--------| -| id |

Unique category ID assigned by Voucherify.

| -| name |

Category name.

| -| hierarchy |

Category hierarchy.

| -| created_at |

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

**Example:**

2022-07-14T10:45:13.156Z

| -| updated_at |

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

**Example:**

2022-08-16T10:52:08.094Z

| -| object |

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

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

| [block:html] { diff --git a/docs/reference-docs/CONSENTS-API-Consents-Object.md b/docs/reference-docs/CONSENTS-API-Consents-Object.md index 357c17499..84f55ab00 100644 --- a/docs/reference-docs/CONSENTS-API-Consents-Object.md +++ b/docs/reference-docs/CONSENTS-API-Consents-Object.md @@ -8,11 +8,11 @@ hidden: false order: 1 --- - +## List Consents Response Body | Attributes | Description | |:-----|:--------| -| groups |

Contains marketing permission groups' definitions.

AttributesDescription
object

Stores information about marketing permission groups.

data_ref

Identifies the name of the attribute that contains the array of marketing permission groups.

data

An array of marketing permission groups.

Array of:
AttributesDescription
id

Unique group ID.

Example:

cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8

name

Marketing permission group name.

description

Marketing permission group category.

consents

List of consents that are assigned to the group.

created_at

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

Example:

2022-04-13T09:12:47.743Z

updated_at

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

Example:

2022-05-14T09:11:27.037Z

object

Stores information about a marketing permission group.

total

Total number of groups.

| -| consents |

Contains opt-in consents' definitions.

AttributesDescription
object

Stores information about opt-in consents.

data_ref

Identifies the name of the attribute that contains the array of opt-in consents.

data

An array of consents.

Array of:
AttributesDescription
id

Unique consent ID.

Example:

cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I

name

Consent name.

description

Consent description.

category

Consent category.

created_at

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

Example:

2022-04-13T09:11:27.037Z

updated_at

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

Example:

2022-05-14T09:11:27.037Z

object

Stores information about an opt-in consent.

total

Total number of consents.

| +| groups
`object` |

Contains marketing permission groups' definitions.

AttributesDescription
object
string

Stores information about marketing permission groups.

data_ref
string

Identifies the name of the attribute that contains the array of marketing permission groups.

data
array

An array of marketing permission groups.

Array of:
AttributesDescription
id
string

Unique group ID.

Example:

cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8

name
string

Marketing permission group name.

description
string

Marketing permission group category.

consents
array

List of consents that are assigned to the group.

created_at
string

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

Example:

2022-04-13T09:12:47.743Z

updated_at
string

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

Example:

2022-05-14T09:11:27.037Z

object
string

Stores information about a marketing permission group.

total
integer

Total number of groups.

| +| consents
`object` |

Contains opt-in consents' definitions.

AttributesDescription
object
string

Stores information about opt-in consents.

data_ref
string

Identifies the name of the attribute that contains the array of opt-in consents.

data
array

An array of consents.

Array of:
AttributesDescription
id
string

Unique consent ID.

Example:

cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I

name
string

Consent name.

description
string

Consent description.

category
string

Consent category.

created_at
string

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

Example:

2022-04-13T09:11:27.037Z

updated_at
string

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

Example:

2022-05-14T09:11:27.037Z

object
string

Stores information about an opt-in consent.

total
integer

Total number of consents.

| [block:html] { diff --git a/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md b/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md index e394e4943..b7f79c073 100644 --- a/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md +++ b/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md @@ -8,14 +8,14 @@ hidden: false order: 2 --- - +## Customer Activity Object | Attributes | Description | |:-----|:--------| -| id |

Unique event ID, assigned by Voucherify.

**Example:**

evcus_0c150c51730c6b60b1

| -| type |

Event type.

Available values: `customer.confirmed`, `customer.created`, `customer.updated`, `customer.deleted`, `customer.referred`, `customer.custom_event`, `customer.segment_entered`, `customer.segment.left`, `customer.sms.sent`, `customer.sms.failed`, `customer.email.sent`, `customer.email.failed`, `customer.activecampaign.sent`, `customer.braze.sent`, `customer.mailchimp.sent`, `customer.intercom.sent`, `customer.intercom.failed`, `customer.rewarded`, `customer.rewarded.loyalty_points`, `customer.voucher.gift.balance_added`, `customer.voucher.loyalty_card.points_added`, `customer.voucher.loyalty_card.points_transferred`, `customer.publication.succeeded`, `customer.publication.failed`, `customer.redemption.succeeded`, `customer.redemption.failed`, `customer.redemption.rollback.succeeded`, `customer.redemption.rollback.failed`, `customer.consents.given`, `customer.consents.revoked` | -| data |

Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.

Array of [Customer Activity Data Object](#customer-activity-data-object) | -| created_at |

Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.

**Example:**

2022-08-30T09:14:07.660Z

| -# Customer Activity Data Object +| id
`string` |

Unique event ID, assigned by Voucherify.

**Example:**

evcus_0c150c51730c6b60b1

| +| type
`string` |

Event type.

Available values: `customer.confirmed`, `customer.created`, `customer.updated`, `customer.deleted`, `customer.referred`, `customer.custom_event`, `customer.segment_entered`, `customer.segment.left`, `customer.sms.sent`, `customer.sms.failed`, `customer.email.sent`, `customer.email.failed`, `customer.activecampaign.sent`, `customer.braze.sent`, `customer.mailchimp.sent`, `customer.intercom.sent`, `customer.intercom.failed`, `customer.rewarded`, `customer.rewarded.loyalty_points`, `customer.voucher.gift.balance_added`, `customer.voucher.loyalty_card.points_added`, `customer.voucher.loyalty_card.points_transferred`, `customer.publication.succeeded`, `customer.publication.failed`, `customer.redemption.succeeded`, `customer.redemption.failed`, `customer.redemption.rollback.succeeded`, `customer.redemption.rollback.failed`, `customer.consents.given`, `customer.consents.revoked` | +| data
`array` |

Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.

Array of [Customer Activity Data Object](#customer-activity-data-object) | +| created_at
`string` |

Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.

**Example:**

2022-08-30T09:14:07.660Z

| +## Customer Activity Data Object [block:html] { diff --git a/docs/reference-docs/CUSTOMERS-API-Customer-Object.md b/docs/reference-docs/CUSTOMERS-API-Customer-Object.md index 15c5fd870..98498ed94 100644 --- a/docs/reference-docs/CUSTOMERS-API-Customer-Object.md +++ b/docs/reference-docs/CUSTOMERS-API-Customer-Object.md @@ -8,27 +8,27 @@ hidden: false order: 1 --- - +## Customer Object | Attributes | Description | |:-----|:--------| -| id |

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

**Example:**

cust_CSnYd37MXmrbS19XCrghjBsv

| -| source_id |

The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It is externally defined. It can be a customer ID from a CRM system, database or 3rd-party service.

| -| name |

Customer's first and last name.

| -| description |

An arbitrary string that you can attach to a customer object.

| -| email |

Customer's email address.

| -| phone |

Customer's phone number.

| -| birthdate |

Customer's birthdate.

| -| birthday |

Customer's birthday.

| -| address |

Customer's address.

AttributesDescription
city

City

state

State

line_1

First line of address.

line_2

Second line of address.

country

Country.

postal_code

Postal code.

| -| summary |

Contains a summary of customer's redemption and order statistics.

AttributesDescription
redemptions

Customer's redemptions statistics.

AttributesDescription
total_redeemed

Total number of redemptions made by the customer.

total_failed

Total number of redemptions that failed.

total_succeeded

Total number of redemptions that succeeded.

total_rolled_back

Total number of redemptions that were rolled back for the customer.

total_rollback_failed

Total number of redemption rollbacks that failed.

total_rollback_succeeded

Total number of redemption rollbacks that succeeded.

gift

Summary of gift card credits.

AttributesDescription
redeemed_amount

Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

amount_to_go

Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

loyalty_card

Summary of loyalty points.

AttributesDescription
redeemed_points

Total number of loyalty points redeemed by the customer.

points_to_go

Sum of remaining available point balance across all loyalty cards.

orders

Customer's order statistics.

AttributesDescription
total_amount

The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

total_count

Total number of orders made by the customer.

average_amount

Average amount spent on orders. total_amount ÷ total_count. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

last_order_amount

Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

last_order_date

Timestamp representing the date and time of the customer's last order in ISO 8601 format.

Example:

2022-08-30T11:51:08.029Z

| -| loyalty |

Summary of customer's loyalty information.

AttributesDescription
points

Sum of remaining available point balance across all loyalty cards.

referred_customers

Total number of customers referred by the customer.

campaigns

Contains campaigns with details about point balances and how many customers were referred by the customer.

AttributesDescription
campaign_name

Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.

AttributesDescription
points

Remaining point balance in campaign.

loyalty_tier

Customer's loyalty tier within the campaign.

Example:

ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x

referred_customers

Number of customers referred by the customer in campaign.

| -| referrals |

Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.

AttributesDescription
total

Total number of times this customer received a referral, i.e. was referred by another customer.

campaigns

Contains an array of campaigns that served as the source of a referral for the customer.

Array of:
AttributesDescription
campaign_id

Unique campaign ID, assigned by Voucherify.

Example:

camp_rRsfatlwN7unSeUIJDCYedal

referrer_id

Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer.

Example:

cust_sehkNIi8Uq2qQuRqSr7xn4Zi

related_object_id

Related object ID, i.e. r_0b9d4cc4aa164dd073.

related_object_type

Related object type, i.e. redemption.

date

Timestamp representing the date and time when the customer was referred in ISO 8601 format.

Example:

2022-08-30T10:19:39.196Z

| -| metadata |

A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

| -| system_metadata |

Object used to store system metadata information.

AttributesDescription
consents

Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.

AttributesDescription
consentId

Unique ID of a consent, i.e. cnst_lbgOBhHTuDrB7sjIhFjvIALj.

AttributesDescription
date

Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.

Example:

2022-05-10T08:50:10.338Z

value

Accepted: true, Rejected: false

source

Takes on the name of the source of the integration if the customer was created through an integration, i.e. Bigcommerce or Shopify.

| -| created_at |

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

**Example:**

2022-08-30T06:32:07.380Z

| -| updated_at |

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

**Example:**

2022-08-31T06:32:07.380Z

| -| assets |

Contains information about the customer's cockpit.

AttributesDescription
cockpit_url

Customer's cockpit URL address.

| -| object |

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

| +| id
`string` |

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

**Example:**

cust_CSnYd37MXmrbS19XCrghjBsv

| +| source_id
`string` |

The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It is externally defined. It can be a customer ID from a CRM system, database or 3rd-party service.

| +| name
`string` |

Customer's first and last name.

| +| description
`string` |

An arbitrary string that you can attach to a customer object.

| +| email
`string` |

Customer's email address.

| +| phone
`string` |

Customer's phone number.

| +| birthdate
`string` |

Customer's birthdate.

| +| birthday
`string` |

Customer's birthday.

| +| address
`object` |

Customer's address.

AttributesDescription
city
string

City

state
string

State

line_1
string

First line of address.

line_2
string

Second line of address.

country
string

Country.

postal_code
string

Postal code.

| +| summary
`object` |

Contains a summary of customer's redemption and order statistics.

AttributesDescription
redemptions
object

Customer's redemptions statistics.

AttributesDescription
total_redeemed
integer

Total number of redemptions made by the customer.

total_failed
integer

Total number of redemptions that failed.

total_succeeded
integer

Total number of redemptions that succeeded.

total_rolled_back
integer

Total number of redemptions that were rolled back for the customer.

total_rollback_failed
integer

Total number of redemption rollbacks that failed.

total_rollback_succeeded
integer

Total number of redemption rollbacks that succeeded.

gift
object

Summary of gift card credits.

AttributesDescription
redeemed_amount
integer

Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

amount_to_go
integer

Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

loyalty_card
object

Summary of loyalty points.

AttributesDescription
redeemed_points
integer

Total number of loyalty points redeemed by the customer.

points_to_go
integer

Sum of remaining available point balance across all loyalty cards.

orders
object

Customer's order statistics.

AttributesDescription
total_amount
integer

The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

total_count
integer

Total number of orders made by the customer.

average_amount
integer

Average amount spent on orders. total_amount ÷ total_count. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

last_order_amount
integer

Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.

last_order_date
string

Timestamp representing the date and time of the customer's last order in ISO 8601 format.

Example:

2022-08-30T11:51:08.029Z

| +| loyalty
`object` |

Summary of customer's loyalty information.

AttributesDescription
points
integer

Sum of remaining available point balance across all loyalty cards.

referred_customers
integer

Total number of customers referred by the customer.

campaigns
object

Contains campaigns with details about point balances and how many customers were referred by the customer.

AttributesDescription
campaign_name
object

Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.

AttributesDescription
points
integer

Remaining point balance in campaign.

loyalty_tier
string

Customer's loyalty tier within the campaign.

Example:

ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x

referred_customers
integer

Number of customers referred by the customer in campaign.

| +| referrals
`object` |

Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.

AttributesDescription
total
integer

Total number of times this customer received a referral, i.e. was referred by another customer.

campaigns
array

Contains an array of campaigns that served as the source of a referral for the customer.

Array of:
AttributesDescription
campaign_id
string

Unique campaign ID, assigned by Voucherify.

Example:

camp_rRsfatlwN7unSeUIJDCYedal

referrer_id
string

Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer.

Example:

cust_sehkNIi8Uq2qQuRqSr7xn4Zi

related_object_id
string

Related object ID, i.e. r_0b9d4cc4aa164dd073.

related_object_type
string

Related object type, i.e. redemption.

date
string

Timestamp representing the date and time when the customer was referred in ISO 8601 format.

Example:

2022-08-30T10:19:39.196Z

| +| metadata
`object` |

A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

| +| system_metadata
`object` |

Object used to store system metadata information.

AttributesDescription
consents
object

Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.

AttributesDescription
consentId
object

Unique ID of a consent, i.e. cnst_lbgOBhHTuDrB7sjIhFjvIALj.

AttributesDescription
date
string

Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.

Example:

2022-05-10T08:50:10.338Z

value
boolean

Accepted: true, Rejected: false

source
string

Takes on the name of the source of the integration if the customer was created through an integration, i.e. Bigcommerce or Shopify.

| +| created_at
`string` |

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

**Example:**

2022-08-30T06:32:07.380Z

| +| updated_at
`string` |

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

**Example:**

2022-08-31T06:32:07.380Z

| +| assets
`object` |

Contains information about the customer's cockpit.

AttributesDescription
cockpit_url
string

Customer's cockpit URL address.

| +| object
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/EXPORTS-API-Export-Object.md b/docs/reference-docs/EXPORTS-API-Export-Object.md index 547b1d42c..d47228bf2 100644 --- a/docs/reference-docs/EXPORTS-API-Export-Object.md +++ b/docs/reference-docs/EXPORTS-API-Export-Object.md @@ -8,182 +8,182 @@ hidden: false order: 1 --- - +## Export Object | Attributes | Description | |:-----|:--------| -| id |

Unique export ID.

**Example:**

exp_FFfp9o7daWuJqJCKp5xqqli4

| -| object |

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

| -| created_at |

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

**Example:**

2022-04-28T11:23:20.922Z

| -| status |

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 |

The channel through which the export was triggered.

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

The type of exported object.

Available values: `order`, `voucher`, `publication`, `redemption`, `customer`, `points_expiration`, `voucher_transactions` | +| id
`string` |

Unique export ID.

**Example:**

exp_FFfp9o7daWuJqJCKp5xqqli4

| +| object
`string` |

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

| +| created_at
`string` |

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

**Example:**

2022-04-28T11:23:20.922Z

| +| status
`string` |

Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.

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

The channel through which the export was triggered.

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

The type of exported object.

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

Contains the URL of the CSV file.

AttributesDescription
url

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

| -| user_id |

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

**Example:**

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

| -# order +| result
`object` |

Contains the URL of the CSV file.

AttributesDescription
url
string

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

| +| user_id
`string` |

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

**Example:**

user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH

| +## order | Attributes | Description | |:-----|:--------| -| order |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

FieldDefinitionExample Export
idUnique order ID.ord_A69RIxEdRsPuC6i8gFGVHUft
source_idUnique order source ID.8638
created_atTimestamp in ISO 8601 format representing the date and time when the order was created.2022-03-09T09:16:32.521Z
updated_atTimestamp in ISO 8601 format representing the date and time when the order was last updated.2022-03-09T09:16:33.331Z
statusOrder status.PAID, CREATED, FULFILLED, CANCELED
amountTotal amount of order items.7700
discount_amountRepresents total amount of the discount applied to whole cart.500
items_discount_amountRepresents total amount of the discount applied to order line items.100
total_discount_amountAll discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart.600
total_amountTotal order amount after applying all discounts.7100
customer_idCustomer unique ID.cust_2G4fUQdCXUqp35nXNleav7bO
referrer_idReferrer unique ID.cust_IkrTR674vvQvr9a4rDMiqglY
metadataReturns all order metadata.Response will include all order metadata.
metadata.XWhere X is the name of a particular order metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. Read more here.
Available values: `id,source_id,created_at,updated_at,status,amount,discount_amount,items_discount_amount,total_discount_amount,total_amount,customer_id,referrer_id,metadata` | +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

FieldDefinitionExample Export
idUnique order ID.ord_A69RIxEdRsPuC6i8gFGVHUft
source_idUnique order source ID.8638
created_atTimestamp in ISO 8601 format representing the date and time when the order was created.2022-03-09T09:16:32.521Z
updated_atTimestamp in ISO 8601 format representing the date and time when the order was last updated.2022-03-09T09:16:33.331Z
statusOrder status.PAID, CREATED, FULFILLED, CANCELED
amountTotal amount of order items.7700
discount_amountRepresents total amount of the discount applied to whole cart.500
items_discount_amountRepresents total amount of the discount applied to order line items.100
total_discount_amountAll discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart.600
total_amountTotal order amount after applying all discounts.7100
customer_idCustomer unique ID.cust_2G4fUQdCXUqp35nXNleav7bO
referrer_idReferrer unique ID.cust_IkrTR674vvQvr9a4rDMiqglY
metadataReturns all order metadata.Response will include all order metadata.
metadata.XWhere X is the name of a particular order metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. Read more here.
Available values: `id,source_id,created_at,updated_at,status,amount,discount_amount,items_discount_amount,total_discount_amount,total_amount,customer_id,referrer_id,metadata` | | filters | Any of: [Filter by status](#filter-by-status), [Filter by order source ID](#filter-by-order-source-id), [Filter by order amount](#filter-by-order-amount), [Filter by order total amount](#filter-by-order-total-amount), [Filter by order discount amount](#filter-by-order-discount-amount), [Filter by order total discount amount](#filter-by-order-total-discount-amount), [Filter by order items discount amount](#filter-by-order-items-discount-amount) | -# voucher +## voucher | Attributes | Description | |:-----|:--------| -| order |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
idUnique voucher ID.v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD
codeUnique voucher code.WELCOME100
voucher_typeType of voucher.DISCOUNT_VOUCHER, GIFT_VOUCHER, LOYALTY_CARD
valueValue of voucher.DISCOUNT_VOUCHER : amount, percent, unit
GIFT_VOUCHER: amount left to spend
LOYALTY_CARD: available usable points
discount_typeThe type of discount for a DISCOUNT_VOUCHER.AMOUNT, PERCENT, UNIT, FIXED
campaignUnique campaign name.Summer Discounts 20% off
categoryTag defining the category that this voucher belongs to.
start_dateStart date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is inactive before this date.2020-12-10T23:00:00.000Z
expiration_dateExpiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is inactive after this date.2023-12-31T23:00:00.000Z
gift_balanceAmount left to spend.1000
loyalty_balanceAvailable usable points.2000
redemption_quantityMaximum number of times a voucher can be redeemed.2
redemption_countTotal redemptions.59
activeBoolean indicating whether the voucher is available for use.true, false
qr_codeURL to QR representation of encrypted code.
bar_codeURL to barcode representation of encrypted code.
is_referral_codeBoolean indicating whether the voucher is a referral code.true, false
created_atTimestamp in ISO 8601 format representing the date and time when the voucher was created.2022-04-14T09:55:46.814Z
updated_atTimestamp in ISO 8601 format representing the date and time when the voucher was last updated.2022-04-14T10:02:18.036Z
validity_timeframe_intervalDefines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.P2D
validity_timeframe_durationDefines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.PT1H
validity_day_of_weekArray corresponding to the particular days of the week in which the voucher is valid."1,2,3,4,5"
discount_amount_limitFor PERCENT discount type, this is the maximum threshold allowed to be deducted.50
campaign_idParent campaign ID.camp_7s3uXI44aKfIk5IhmeOPr6ic
additional_infoAn optional field to keep any extra textual information about the code such as a code description and details.
customer_idUnique customer ID of the assigned owner to whom the voucher was published.cust_7iUa6ICKyU6gH40dBU25kQU1
discount_unit_typeFor UNIT discount type, either a shipping or product ID for a UNIT discount with one product.prod_5h1pp1ng, prod_0a9f9aeddb019a42db
discount_unit_effectUNIT discount effect.ADD_MANY_ITEMS, ADD_MISSING_ITEMS,ADD_NEW_ITEMS
customer_source_idUnique customer source id of the assigned owner to whom the voucher was published.name.lastname@email.com
metadataReturns all voucher metadata.Response will include all voucher metadata.
metadata.XWhere X is the name of a particular voucher metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. Read more here.
Available values: `code,voucher_type,value,discount_type,campaign,category,start_date,expiration_date,gift_balance,loyalty_balance,redemption_quantity,redemption_count,active,qr_code,bar_code,id,is_referral_code,created_at,updated_at,validity_timeframe_interval,validity_timeframe_duration,validity_day_of_week,discount_amount_limit,campaign_id,additional_info,customer_id,discount_unit_type,discount_unit_effect,customer_source_id,metadata` | -| filters |

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

| -# publication +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
idUnique voucher ID.v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD
codeUnique voucher code.WELCOME100
voucher_typeType of voucher.DISCOUNT_VOUCHER, GIFT_VOUCHER, LOYALTY_CARD
valueValue of voucher.DISCOUNT_VOUCHER : amount, percent, unit
GIFT_VOUCHER: amount left to spend
LOYALTY_CARD: available usable points
discount_typeThe type of discount for a DISCOUNT_VOUCHER.AMOUNT, PERCENT, UNIT, FIXED
campaignUnique campaign name.Summer Discounts 20% off
categoryTag defining the category that this voucher belongs to.
start_dateStart date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is inactive before this date.2020-12-10T23:00:00.000Z
expiration_dateExpiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is inactive after this date.2023-12-31T23:00:00.000Z
gift_balanceAmount left to spend.1000
loyalty_balanceAvailable usable points.2000
redemption_quantityMaximum number of times a voucher can be redeemed.2
redemption_countTotal redemptions.59
activeBoolean indicating whether the voucher is available for use.true, false
qr_codeURL to QR representation of encrypted code.
bar_codeURL to barcode representation of encrypted code.
is_referral_codeBoolean indicating whether the voucher is a referral code.true, false
created_atTimestamp in ISO 8601 format representing the date and time when the voucher was created.2022-04-14T09:55:46.814Z
updated_atTimestamp in ISO 8601 format representing the date and time when the voucher was last updated.2022-04-14T10:02:18.036Z
validity_timeframe_intervalDefines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.P2D
validity_timeframe_durationDefines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.PT1H
validity_day_of_weekArray corresponding to the particular days of the week in which the voucher is valid."1,2,3,4,5"
discount_amount_limitFor PERCENT discount type, this is the maximum threshold allowed to be deducted.50
campaign_idParent campaign ID.camp_7s3uXI44aKfIk5IhmeOPr6ic
additional_infoAn optional field to keep any extra textual information about the code such as a code description and details.
customer_idUnique customer ID of the assigned owner to whom the voucher was published.cust_7iUa6ICKyU6gH40dBU25kQU1
discount_unit_typeFor UNIT discount type, either a shipping or product ID for a UNIT discount with one product.prod_5h1pp1ng, prod_0a9f9aeddb019a42db
discount_unit_effectUNIT discount effect.ADD_MANY_ITEMS, ADD_MISSING_ITEMS,ADD_NEW_ITEMS
customer_source_idUnique customer source id of the assigned owner to whom the voucher was published.name.lastname@email.com
metadataReturns all voucher metadata.Response will include all voucher metadata.
metadata.XWhere X is the name of a particular voucher metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. Read more here.
Available values: `code,voucher_type,value,discount_type,campaign,category,start_date,expiration_date,gift_balance,loyalty_balance,redemption_quantity,redemption_count,active,qr_code,bar_code,id,is_referral_code,created_at,updated_at,validity_timeframe_interval,validity_timeframe_duration,validity_day_of_week,discount_amount_limit,campaign_id,additional_info,customer_id,discount_unit_type,discount_unit_effect,customer_source_id,metadata` | +| filters
`object` |

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

| +## publication | Attributes | Description | |:-----|:--------| -| order |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
voucher_codeUnique voucher code.WELCOME100
customer_idCustomer unique ID.cust_7iUa6ICKyU6gH40dBU25kQU1
customer_source_idUnique customer source id of the assigned owner to whom the voucher was published.name.lastname@email.com
dateTimestamp in ISO 8601 format representing the date and time when the voucher was published.2022-04-28T10:19:30.792Z
channelPublication channel.voucherify-website
campaignUnique campaign name.Summer Discounts 20% off
is_winner
metadataReturns all publication metadata.Response will include all publication metadata.
metadata.XWhere X is the name of a particular publication metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. Read more here
Available values: `voucher_code,customer_id,customer_source_id,date,channel,campaign,is_winner,metadata` | +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
voucher_codeUnique voucher code.WELCOME100
customer_idCustomer unique ID.cust_7iUa6ICKyU6gH40dBU25kQU1
customer_source_idUnique customer source id of the assigned owner to whom the voucher was published.name.lastname@email.com
dateTimestamp in ISO 8601 format representing the date and time when the voucher was published.2022-04-28T10:19:30.792Z
channelPublication channel.voucherify-website
campaignUnique campaign name.Summer Discounts 20% off
is_winner
metadataReturns all publication metadata.Response will include all publication metadata.
metadata.XWhere X is the name of a particular publication metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. Read more here
Available values: `voucher_code,customer_id,customer_source_id,date,channel,campaign,is_winner,metadata` | | filters |

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

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

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
idUnique redemption ID.r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8
objectObject being exported; by default redemption.redemption
dateTimestamp in ISO 8601 format representing the date and time when the voucher was redeemed.2022-03-23T08:52:24.867Z
voucher_codeUnique voucher code redeemed.WELCOME100
campaignParent campaign name of voucher if applicable.Summer Discounts 20% off
promotion_tier_idpromo_Mwy9XpA0TLctSGriM5kum0qp
customer_idUnique customer ID of redeeming customer.cust_nk0N1uNQ1YnupAoJGOgvsODC
customer_source_idUnique source ID of redeeming customer.name.lastname@email.com
customer_nameCustomer name.John Smith
tracking_idtrack_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy
order_amountTotal order amount before applying all discounts.1000
gift_amountGift credits used for redemption.10
loyalty_points12
resultTells you whether the redemption succeeded.SUCCESS, FAILURE
failure_codeInternal Voucherify code for reason why redemption failed.invalid_customer
failure_messageA human-readable message providing a short description explaining why the redemption failed.Customer must be a holder of a loyalty card.
metadataReturns all redemption metadata.Response will include all redemption metadata.
metadata.XWhere X is the name of a particular redemption metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. Read more here
Available values: `id,object,date,voucher_code,campaign,promotion_tier_id,customer_id,customer_source_id,customer_name,tracking_id,order_amount,gift_amount,loyalty_points,result,failure_code,failure_message,metadata` | -| filters |

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

| -# customer +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
idUnique redemption ID.r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8
objectObject being exported; by default redemption.redemption
dateTimestamp in ISO 8601 format representing the date and time when the voucher was redeemed.2022-03-23T08:52:24.867Z
voucher_codeUnique voucher code redeemed.WELCOME100
campaignParent campaign name of voucher if applicable.Summer Discounts 20% off
promotion_tier_idpromo_Mwy9XpA0TLctSGriM5kum0qp
customer_idUnique customer ID of redeeming customer.cust_nk0N1uNQ1YnupAoJGOgvsODC
customer_source_idUnique source ID of redeeming customer.name.lastname@email.com
customer_nameCustomer name.John Smith
tracking_idtrack_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy
order_amountTotal order amount before applying all discounts.1000
gift_amountGift credits used for redemption.10
loyalty_points12
resultTells you whether the redemption succeeded.SUCCESS, FAILURE
failure_codeInternal Voucherify code for reason why redemption failed.invalid_customer
failure_messageA human-readable message providing a short description explaining why the redemption failed.Customer must be a holder of a loyalty card.
metadataReturns all redemption metadata.Response will include all redemption metadata.
metadata.XWhere X is the name of a particular redemption metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. Read more here
Available values: `id,object,date,voucher_code,campaign,promotion_tier_id,customer_id,customer_source_id,customer_name,tracking_id,order_amount,gift_amount,loyalty_points,result,failure_code,failure_message,metadata` | +| filters
`object` |

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

| +## customer | Attributes | Description | |:-----|:--------| -| order |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
nameCustomer name.John Smith
idUnique customer ID.cust_J1CDUdbqn5Exva8ASWk1Fq0j
descriptionAn arbitrary string that you can attach to a customer object.Customer requesting to be added to VIP tier.
emailCustomer's email.name.lastname@email.com
source_idUnique custom customer identifier.name.lastname@email.com
created_atTimestamp in ISO 8601 format representing the date and time when the customer was created.2022-02-03T13:10:11.928Z
address_cityCityHouston
address_stateStateTX
address_line_1First line of customer's address.72738 Main St
address_line_2Second line of customer's address.Bld 2, Apt 4
address_countryCountryUnited States of America
address_postal_codePostal code (ZIP code)77042-4143
redemptions_total_redeemedTotal customer redemptions.5
redemptions_total_failedTotal customer failed redemptions.2
redemptions_total_succeededTotal customer succeeded redemptions.3
redemptions_total_rolled_backTotal customer redemptions that were rolled back.3
redemptions_total_rollback_failedTotal customer redemptions that were unsuccessfully rolled back.2
redemptions_total_rollback_succeededTotal customer redemptions that were successfully rolled back.1
orders_total_amountTotal sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places.10000 (represents $100)
orders_total_countTotal number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places.2
orders_average_amountAverage amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places.50
orders_last_order_amountHow much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places.50
orders_last_order_dateWhen was the last customer order; timestamp in ISO 8601 format representing the date and time.2022-02-03T13:17:30.630Z
loyalty_pointsSum of customer's loyalty points to go across all loyalty cards.
loyalty_referred_customersHow many customers were referred by this customer.
updated_atTimestamp in ISO 8601 format representing the date and time when the customer was updated.2022-02-14T14:10:14.305Z
phoneCustomer's phone number.+1 (294) 752-1846
birthdayCustomer's birthday.2022-01-01
birthdateCustomer's birthdate.2022-04-29
metadataReturns all customer metadata.Response will include all customer metadata.
metadata.XWhere X is the name of a particular customer metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. Read more here
Available values: `name,id,description,email,source_id,created_at,address_city,address_state,address_line_1,address_line_2,address_country,address_postal_code,redemptions_total_redeemed,redemptions_total_failed,redemptions_total_succeeded,redemptions_total_rolled_back,redemptions_total_rollback_failed,redemptions_total_rollback_succeeded,orders_total_amount,orders_total_count,orders_average_amount,orders_last_order_amount,orders_last_order_date,loyalty_points,loyalty_referred_customers,updated_at,phone,birthday,metadata,birthdate` | -| filters |

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

| -# points expiration +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:

FieldDefinitionExample Export
nameCustomer name.John Smith
idUnique customer ID.cust_J1CDUdbqn5Exva8ASWk1Fq0j
descriptionAn arbitrary string that you can attach to a customer object.Customer requesting to be added to VIP tier.
emailCustomer's email.name.lastname@email.com
source_idUnique custom customer identifier.name.lastname@email.com
created_atTimestamp in ISO 8601 format representing the date and time when the customer was created.2022-02-03T13:10:11.928Z
address_cityCityHouston
address_stateStateTX
address_line_1First line of customer's address.72738 Main St
address_line_2Second line of customer's address.Bld 2, Apt 4
address_countryCountryUnited States of America
address_postal_codePostal code (ZIP code)77042-4143
redemptions_total_redeemedTotal customer redemptions.5
redemptions_total_failedTotal customer failed redemptions.2
redemptions_total_succeededTotal customer succeeded redemptions.3
redemptions_total_rolled_backTotal customer redemptions that were rolled back.3
redemptions_total_rollback_failedTotal customer redemptions that were unsuccessfully rolled back.2
redemptions_total_rollback_succeededTotal customer redemptions that were successfully rolled back.1
orders_total_amountTotal sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places.10000 (represents $100)
orders_total_countTotal number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places.2
orders_average_amountAverage amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places.50
orders_last_order_amountHow much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places.50
orders_last_order_dateWhen was the last customer order; timestamp in ISO 8601 format representing the date and time.2022-02-03T13:17:30.630Z
loyalty_pointsSum of customer's loyalty points to go across all loyalty cards.
loyalty_referred_customersHow many customers were referred by this customer.
updated_atTimestamp in ISO 8601 format representing the date and time when the customer was updated.2022-02-14T14:10:14.305Z
phoneCustomer's phone number.+1 (294) 752-1846
birthdayCustomer's birthday.2022-01-01
birthdateCustomer's birthdate.2022-04-29
metadataReturns all customer metadata.Response will include all customer metadata.
metadata.XWhere X is the name of a particular customer metadata property.The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. Read more here
Available values: `name,id,description,email,source_id,created_at,address_city,address_state,address_line_1,address_line_2,address_country,address_postal_code,redemptions_total_redeemed,redemptions_total_failed,redemptions_total_succeeded,redemptions_total_rolled_back,redemptions_total_rollback_failed,redemptions_total_rollback_succeeded,orders_total_amount,orders_total_count,orders_average_amount,orders_last_order_amount,orders_last_order_date,loyalty_points,loyalty_referred_customers,updated_at,phone,birthday,metadata,birthdate` | +| filters
`object` |

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

| +## points expiration | Attributes | Description | |:-----|:--------| -| order |

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

FieldDefinitionExample Export
idUnique transaction ID.vtx_0cb7811f1c07765800
typeTransaction type.- CREDITS_REMOVAL
- CREDITS_ADDITION
- CREDITS_REFUND
- CREDITS_REDEMPTION
source_idUnique transaction source ID.8638
reasonContains the reason for the transaction if one was included originally.
balanceThe gift card balance after the transaction.
amountThe amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction.
created_atTimestamp in ISO 8601 format representing the date and time when the transaction was created.2022-03-09T09:16:32.521Z
voucher_idUnique Voucher ID.v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
campaign_idParent campaign ID.camp_FNYR4jhqZBM9xTptxDGgeNBV
sourceChannel through which the transaction was initiated.API
detailsMore detailed information stored in the form of a JSON.Provides more details related to the transaction in the form of an object.
Available values: `id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details` | +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

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

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

FieldDefinitionExample Export
idUnique transaction ID assigned by Voucherify.vtx_0cb7811f1c07765800
typeTransaction type.- POINTS_EXPIRATION
- POINTS_ADDITION
- POINTS_REMOVAL
- POINTS_TRANSFER_OUT
- POINTS_ACCRUAL
- POINTS_REFUND
- POINTS_REDEMPTION
source_idCustom source ID of the transaction if one was included originally.source_id_custom
reasonContains the reason for the transaction if one was included originally.
balanceThe loyalty card balance after the transaction.
amountThe amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction.
created_atTimestamp in ISO 8601 format representing the date and time when the transaction was created.2022-03-09T09:16:32.521Z
voucher_idUnique Voucher ID.v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
campaign_idParent campaign ID.camp_FNYR4jhqZBM9xTptxDGgeNBV
sourceChannel through which the transaction was initiated.- API
- voucherify-web-ui
- Automation
detailsMore detailed information stored in the form of a JSON.Provides more details related to the transaction in the form of an object.
related_transaction_idUnique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card.vtx_0c9afe802593b34b80
Available values: `id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,details,related_transaction_id` | +| order
`string` |

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

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

Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

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

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

AttributesDescription
$in

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

$not_in

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

$is

Value is exactly this value. (single value)

$is_not

Results omit this value. (single value)

$has_value

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

$is_unknown

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

$starts_with

Value starts with the specified string.

$ends_with

Value ends with the specified string.

| -# Logical Operator Between Filters +| conditions
`object` |

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

AttributesDescription
$in
array

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

$not_in
array

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

$is
string

Value is exactly this value. (single value)

$is_not
string

Results omit this value. (single value)

$has_value
string

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

$is_unknown
string

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

$starts_with
string

Value starts with the specified string.

$ends_with
string

Value ends with the specified string.

| +## Logical Operator Between Filters

Filter by conditions set on the junction parameter indicating how the conditions should be accounted for in the query. An AND is an all-inclusive logical operator, meaning the AND operator displays a record if ALL the conditions separated by AND are TRUE, while an OR operator displays a record if ANY of the conditions separated by OR is TRUE.

Available values: `AND`, `OR` -# Filter by conditions +## Filter by conditions | Attributes | Description | |:-----|:--------| -| conditions |

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

AttributesDescription
$in

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

$not_in

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

$is

Value is exactly this value. (single value)

$is_not

Results omit this value. (single value)

$has_value

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

$is_unknown

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

$more_than

Value is more than the specified number.

$more_than_equal

Value is more than or equal to the specified number.

$less_than

Value is less than the specified number.

$less_than_equal

Value is less than or equal to the specified number.

| -# Filter by conditions +| conditions
`object` |

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

AttributesDescription
$in
array

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

$not_in
array

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

$is
integer

Value is exactly this value. (single value)

$is_not
integer

Results omit this value. (single value)

$has_value
string

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

$is_unknown
string

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

$more_than
integer

Value is more than the specified number.

$more_than_equal
integer

Value is more than or equal to the specified number.

$less_than
integer

Value is less than the specified number.

$less_than_equal
integer

Value is less than or equal to the specified number.

| +## Filter by conditions | Attributes | Description | |:-----|:--------| -| conditions |

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

AttributesDescription
$is

Value is exactly this value. (single value)

$is_not

Results omit this value. (single value)

$has_value

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

$is_unknown

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

| +| conditions
`object` |

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

AttributesDescription
$is
string

Value is exactly this value. (single value)

$is_not
string

Results omit this value. (single value)

$has_value
string

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

$is_unknown
string

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

| [block:html] { diff --git a/docs/reference-docs/LOYALTIES-API-Loyalty-Campaign-Object.md b/docs/reference-docs/LOYALTIES-API-Loyalty-Campaign-Object.md index ceac29df7..c8e42538d 100644 --- a/docs/reference-docs/LOYALTIES-API-Loyalty-Campaign-Object.md +++ b/docs/reference-docs/LOYALTIES-API-Loyalty-Campaign-Object.md @@ -8,87 +8,87 @@ hidden: false order: 1 --- - +## Loyalty Campaign Object | Attributes | Description | |:-----|:--------| -| id |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_f7fBbQxUuTN7dI7tGOo5XMDA

| -| name |

Loyalty campaign name.

| -| campaign_type |

Type of campaign.

Available values: `LOYALTY_PROGRAM` | -| type |

Defines whether the campaign can be updated with new vouchers after campaign creation.

Available values: `AUTO_UPDATE`, `STATIC` | +| id
`string` |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_f7fBbQxUuTN7dI7tGOo5XMDA

| +| name
`string` |

Loyalty campaign name.

| +| campaign_type
`string` |

Type of campaign.

Available values: `LOYALTY_PROGRAM` | +| type
`string` |

Defines whether the campaign can be updated with new vouchers after campaign creation.

Available values: `AUTO_UPDATE`, `STATIC` | | voucher | See: [Loyalty Card](#loyalty-card) | -| auto_join |

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

| -| join_once |

If this value is set to true, customers will be able to join the campaign only once.

| -| use_voucher_metadata_schema |

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

| -| start_date |

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

**Example:**

2022-09-20T00:00:00.000Z

| -| expiration_date |

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

**Example:**

2022-09-30T00:00:00.000Z

| -| validity_timeframe |

Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

| -| validity_day_of_week |

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

| -| activity_duration_after_publishing |

Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a duration of P24D will be valid for a duration of 24 days.

| -| description |

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

| -| vouchers_count |

Total number of unique vouchers in campaign.

| -| active |

A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the start_date and expiration_date.

| -| metadata |

The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.

| -| created_at |

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

**Example:**

2021-12-01T08:00:50.038Z

| -| updated_at |

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

**Example:**

2022-09-20T09:18:19.623Z

| -| creation_status |

Indicates the status of the campaign creation.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT`, `MODIFYING` | -| vouchers_generation_status |

Indicates the status of the campaign's vouchers.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT` | -| protected |

Indicates whether the resource can be deleted.

| -| category_id |

Unique category ID that this campaign belongs to.

**Example:**

cat_0b688929a2476386a7

| +| auto_join
`boolean` |

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

| +| join_once
`boolean` |

If this value is set to true, customers will be able to join the campaign only once.

| +| use_voucher_metadata_schema
`boolean` |

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

| +| start_date
`string` |

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

**Example:**

2022-09-20T00:00:00.000Z

| +| expiration_date
`string` |

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

**Example:**

2022-09-30T00:00:00.000Z

| +| validity_timeframe
`object` |

Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration
string

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

| +| validity_day_of_week
`array` |

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

| +| activity_duration_after_publishing
`string` |

Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a duration of P24D will be valid for a duration of 24 days.

| +| description
`string` |

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

| +| vouchers_count
`integer` |

Total number of unique vouchers in campaign.

| +| active
`boolean` |

A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the start_date and expiration_date.

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.

| +| created_at
`string` |

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

**Example:**

2021-12-01T08:00:50.038Z

| +| updated_at
`string` |

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

**Example:**

2022-09-20T09:18:19.623Z

| +| creation_status
`string` |

Indicates the status of the campaign creation.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT`, `MODIFYING` | +| vouchers_generation_status
`string` |

Indicates the status of the campaign's vouchers.

Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT` | +| protected
`boolean` |

Indicates whether the resource can be deleted.

| +| category_id
`string` |

Unique category ID that this campaign belongs to.

**Example:**

cat_0b688929a2476386a7

| | categories | See: [Category Object](#category-object) | -| loyalty_tiers_expiration |

Defines the expiration mechanism for loyalty tiers.

Any of: [Balance](#balance), [Points in Period](#points-in-period) | -| object |

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

| -# Loyalty Card +| loyalty_tiers_expiration
`object` |

Defines the expiration mechanism for loyalty tiers.

Any of: [Balance](#balance), [Points in Period](#points-in-period) | +| object
`string` |

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

| +## Loyalty Card | Attributes | Description | |:-----|:--------| -| type |

Type of voucher.

| -| loyalty_card |

Defines the loyalty card details.

AttributesDescription
points

Initial loyalty card income in points to be applied to the loyalty card at voucher generation.

expiration_rules

Defines point expiration rules.

AttributesDescription
period_type

The expiration period.

Available values: MONTH
period_value

How many periods should pass before the expiration occurs.

rounding_type

Round up expiration till the end of the given period type.

Available values: END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH
| -| redemption |

Defines the redemption limits on vouchers.

AttributesDescription
quantity

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

| -| code_config |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length

Number of characters in a generated code (excluding prefix and postfix).

charset

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix

A text appended before the code.

postfix

A text appended after the code.

pattern

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| -| is_referral_code |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| -# Category Object +| type
`string` |

Type of voucher.

| +| loyalty_card
`object` |

Defines the loyalty card details.

AttributesDescription
points
integer

Initial loyalty card income in points to be applied to the loyalty card at voucher generation.

expiration_rules
object

Defines point expiration rules.

AttributesDescription
period_type
string

The expiration period.

Available values: MONTH
period_value
integer

How many periods should pass before the expiration occurs.

rounding_type
string

Round up expiration till the end of the given period type.

Available values: END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH
| +| redemption
`object` |

Defines the redemption limits on vouchers.

AttributesDescription
quantity
integer

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

| +| code_config
`object` |

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length
string

Number of characters in a generated code (excluding prefix and postfix).

charset
string

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix
string

A text appended before the code.

postfix
string

A text appended after the code.

pattern
string

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

| +| is_referral_code
`boolean` |

Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.

| +## Category Object | Attributes | Description | |:-----|:--------| -| id |

Unique category ID assigned by Voucherify.

| -| name |

Category name.

| -| hierarchy |

Category hierarchy.

| -| created_at |

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

**Example:**

2022-07-14T10:45:13.156Z

| -| updated_at |

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

**Example:**

2022-08-16T10:52:08.094Z

| -| object |

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

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

| +## Balance | Attributes | Description | |:-----|:--------| -| qualification_type |

Tier qualification.

BALANCE: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier.

Available values: `BALANCE` | -| start_date |

Defines the conditions for the start date of the tier.

AttributesDescription
type

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.

Available values: IMMEDIATE
| +| qualification_type
`string` |

Tier qualification.

BALANCE: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier.

Available values: `BALANCE` | +| start_date
`object` |

Defines the conditions for the start date of the tier.

AttributesDescription
type
string

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.

Available values: IMMEDIATE
| | expiration_date |

Defines the conditions for the expiration date of a tier.

Any of: [Balance Drop](#balance-drop), [Custom](#custom) | -# Points in Period +## Points in Period | Attributes | Description | |:-----|:--------| -| qualification_type |

Tier qualification.

POINTS_IN_PERIOD: A customer qualifies for the tier only if the sum of the accumulated points in a defined time interval reaches the tier threshold.

Available values: `POINTS_IN_PERIOD` | -| qualification_period |

Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.

PeriodDefinition
Calendar MonthPoints collected in one calendar month
January, February, March, etc.
Calendar QuarterPoints collected in the quarter
- January - March
- April - June
- July - September
- October - December
Calendar Half-yearPoints collected in the half-year
- January - June
- July - December
Calendar YearPoints collected in one calendar year
January - December
Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | -| start_date |

Defines the conditions for the start date of the tier.

AttributesDescription
type

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.
NEXT_PERIOD: When the next qualification period starts.

Available values: IMMEDIATE, NEXT_PERIOD
| -| expiration_date |

Defines the conditions for the expiration date of a tier.

AttributesDescription
type

What triggers the tier to expire for a customer.
END_OF_PERIOD: Expire tier at the end of the period.
END_OF_NEXT_PERIOD: Expire tier at the end of the next period.

Available values: END_OF_PERIOD, END_OF_NEXT_PERIOD
extend

Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of P3M will be valid for an additional duration of 3 months and a tier with a duration of P1D will be valid for an additional duration of 1 day.

| -# Balance Drop +| qualification_type
`string` |

Tier qualification.

POINTS_IN_PERIOD: A customer qualifies for the tier only if the sum of the accumulated points in a defined time interval reaches the tier threshold.

Available values: `POINTS_IN_PERIOD` | +| qualification_period
`string` |

Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.

PeriodDefinition
Calendar MonthPoints collected in one calendar month
January, February, March, etc.
Calendar QuarterPoints collected in the quarter
- January - March
- April - June
- July - September
- October - December
Calendar Half-yearPoints collected in the half-year
- January - June
- July - December
Calendar YearPoints collected in one calendar year
January - December
Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | +| start_date
`object` |

Defines the conditions for the start date of the tier.

AttributesDescription
type
string

What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.
NEXT_PERIOD: When the next qualification period starts.

Available values: IMMEDIATE, NEXT_PERIOD
| +| expiration_date
`object` |

Defines the conditions for the expiration date of a tier.

AttributesDescription
type
string

What triggers the tier to expire for a customer.
END_OF_PERIOD: Expire tier at the end of the period.
END_OF_NEXT_PERIOD: Expire tier at the end of the next period.

Available values: END_OF_PERIOD, END_OF_NEXT_PERIOD
extend
string

Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of P3M will be valid for an additional duration of 3 months and a tier with a duration of P1D will be valid for an additional duration of 1 day.

| +## Balance Drop | Attributes | Description | |:-----|:--------| -| type |

What triggers the tier to expire for a customer.
BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.

Available values: `BALANCE_DROP` | -# Custom +| type
`string` |

What triggers the tier to expire for a customer.
BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.

Available values: `BALANCE_DROP` | +## Custom | Attributes | Description | |:-----|:--------| -| type |

What triggers the tier to expire for a customer.
CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.

Available values: `CUSTOM` | -| extend |

Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months.

| +| type
`string` |

What triggers the tier to expire for a customer.
CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.

Available values: `CUSTOM` | +| extend
`string` |

Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months.

| | rounding |

Defines the rounding mechanism for tier expiration.

Any of: [Calendar Periods](#calendar-periods), [Specific Month](#specific-month) | -# Calendar Periods +## Calendar Periods | Attributes | Description | |:-----|:--------| -| type |

Period to which the expiration will be rounded to.

Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | -| strategy |

Which portion of the given period should the rounding be applied to.

Available values: `END` | -# Specific Month +| type
`string` |

Period to which the expiration will be rounded to.

Available values: `MONTH`, `QUARTER`, `HALF_YEAR`, `YEAR` | +| strategy
`string` |

Which portion of the given period should the rounding be applied to.

Available values: `END` | +## Specific Month | Attributes | Description | |:-----|:--------| -| type |

This mechanism describes a custom rounding for the expiration date.

Available values: `CUSTOM` | -| strategy |

Which portion of the given period should the rounding be applied to.

Available values: `END` | -| unit |

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

Available values: `MONTH` | -| value |

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

| +| type
`string` |

This mechanism describes a custom rounding for the expiration date.

Available values: `CUSTOM` | +| strategy
`string` |

Which portion of the given period should the rounding be applied to.

Available values: `END` | +| unit
`string` |

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

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

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

| [block:html] { diff --git a/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md b/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md index d8732e030..46bdc87bd 100644 --- a/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md +++ b/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md @@ -8,44 +8,44 @@ hidden: false order: 2 --- - +## Loyalty Card Object | Attributes | Description | |:-----|:--------| -| id |

Assigned by the Voucherify API, identifies the voucher.

**Example:**

v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV

| -| code |

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

**Example:**

WVPblOYX

| -| campaign |

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

**Example:**

Loyalty Card Campaign

| -| campaign_id |

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

**Example:**

camp_FNYR4jhqZBM9xTptxDGgeNBV

| -| category |

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

| -| category_id |

Unique category ID assigned by Voucherify.

**Example:**

cat_0bb343dee3cdb5ec0c

| -| categories |

Contains details about the category.

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

Defines the type of voucher.

Available values: `LOYALTY_CARD` | -| discount |

Object representing discount parameters. Child attributes are present only if type is DISCOUNT_VOUCHER. Defaults to null.

| -| gift |

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

| -| loyalty_card |

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

AttributesDescription
points

Total points incurred over lifespan of loyalty card.

Example:

7000

balance

Points available for reward redemption.

Example:

6970

next_expiration_date

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

Example:

2023-05-30

next_expiration_points

The amount of points that are set to expire next.

| -| start_date |

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 |

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 |

Set recurrent time periods when the voucher is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
duration

Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.

Example:

PT1H

interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.

Example:

P2D

| -| validity_day_of_week |

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

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

A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the start_date and expiration_date.

| -| additional_info |

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

| -| metadata |

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 |

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

AttributesDescription
qr

Stores Quick Response (QR) representation of encrypted code.

AttributesDescription
id

Encrypted voucher code ID.

Example:

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

url

URL to QR code

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

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

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

barcode

Stores barcode representation of encrypted code.

AttributesDescription
id

Encrypted voucher code ID.

Example:

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

url

URL to barcode

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

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

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

| -| is_referral_code |

Flag indicating whether this voucher is a referral code.

| -| created_at |

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

**Example:**

2021-12-22T10:13:06.487Z

| -| updated_at |

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 |

Unique customer ID of voucher owner.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| -| redemption |

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

AttributesDescription
quantity

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

redeemed_quantity

How many times a voucher has already been redeemed.

Example:

1

redeemed_points

Total loyalty points redeemed.

Example:

100000

object

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

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

Example:

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

| -| publish |

This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event. A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or publish voucher API method.

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

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

Publication events counter.

Example:

0

url

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

Example:

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

| -| object |

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

| -# Category Object +| 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:**

Loyalty 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: `LOYALTY_CARD` | +| discount
`null` |

Object representing discount parameters. Child attributes are present only if type is DISCOUNT_VOUCHER. Defaults to null.

| +| gift
`null` |

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

| +| loyalty_card
`object` |

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

AttributesDescription
points
integer

Total points incurred over lifespan of loyalty card.

Example:

7000

balance
integer

Points available for reward redemption.

Example:

6970

next_expiration_date
string

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

Example:

2023-05-30

next_expiration_points
integer

The amount of points that are set to expire next.

| +| start_date
`string` |

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

**Example:**

2021-12-01T00:00:00.000Z

| +| expiration_date
`string` |

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

**Example:**

2021-12-31T00:00:00.000Z

| +| validity_timeframe
`object` |

Set recurrent time periods when the voucher is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
duration
string

Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.

Example:

PT1H

interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.

Example:

P2D

| +| validity_day_of_week
`array` |

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

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

A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the start_date and expiration_date.

| +| additional_info
`string` |

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

| +| assets
`object` |

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

AttributesDescription
qr
object

Stores Quick Response (QR) representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

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

url
string

URL to QR code

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

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

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

barcode
object

Stores barcode representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

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

url
string

URL to barcode

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

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

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

| +| is_referral_code
`boolean` |

Flag indicating whether this voucher is a referral code.

| +| created_at
`string` |

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

**Example:**

2021-12-22T10:13:06.487Z

| +| updated_at
`string` |

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

**Example:**

2021-12-22T10:14:45.316Z

| +| holder_id
`string` |

Unique customer ID of voucher owner.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| +| redemption
`object` |

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

AttributesDescription
quantity
integer

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

redeemed_quantity
integer

How many times a voucher has already been redeemed.

Example:

1

redeemed_points
integer

Total loyalty points redeemed.

Example:

100000

object
string

The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.

url
string

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

Example:

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

| +| publish
`object` |

This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event. A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or publish voucher API method.

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

The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.

count
integer

Publication events counter.

Example:

0

url
string

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

Example:

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

| +| object
`string` |

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

| +## Category Object | Attributes | Description | |:-----|:--------| -| id |

Unique category ID assigned by Voucherify.

| -| name |

Category name.

| -| hierarchy |

Category hierarchy.

| -| created_at |

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

**Example:**

2022-07-14T10:45:13.156Z

| -| updated_at |

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

**Example:**

2022-08-16T10:52:08.094Z

| -| object |

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

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

| [block:html] { diff --git a/docs/reference-docs/LOYALTIES-API-Loyalty-Tier-Object.md b/docs/reference-docs/LOYALTIES-API-Loyalty-Tier-Object.md index 03bc82779..3d1d65827 100644 --- a/docs/reference-docs/LOYALTIES-API-Loyalty-Tier-Object.md +++ b/docs/reference-docs/LOYALTIES-API-Loyalty-Tier-Object.md @@ -8,30 +8,30 @@ hidden: false order: 3 --- - +## Loyalty Tier Object | Attributes | Description | |:-----|:--------| -| id |

Unique loyalty tier ID.

**Example:**

ltr_30KHciA0UG8B71Fo51GZqwgN

| -| name |

Loyalty Tier name.

| -| campaign_id |

Unique parent campaign ID.

**Example:**

camp_fkZ28pe7DUAEmmabofkxHI8N

| -| metadata |

The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format.

| -| created_at |

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

**Example:**

2022-11-10T12:20:52.755Z

| -| updated_at |

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

**Example:**

2022-11-25T10:59:43.231Z

| -| earning_rules |

Contains a list of earning rule IDs and their points mapping for the given earning rule.

AttributesDescription
unique_earning_rule_ID

ern_95aq3JaE5A8xzHjoJPYNRqXZ

Any of: Multiply Points, Fixed Points
| -| rewards |

Contains a list of reward IDs and their points mapping for the given reward.

AttributesDescription
unique_reward_ID

rewa_t88DnSdNnE0IzQX6gqH3jHGQ

Any of: Multiply Points, Fixed Points
| -| config |

Defines loyalty tier range in points.

AttributesDescription
points

Defines range of loyalty tier in points.

AttributesDescription
from

Bottom points threshold value.

to

Top points threshold value.

| -| points |

Defines range of loyalty tier in points.

AttributesDescription
from

Bottom points threshold value.

to

Top points threshold value.

| -| object |

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

| -# Multiply Points +| id
`string` |

Unique loyalty tier ID.

**Example:**

ltr_30KHciA0UG8B71Fo51GZqwgN

| +| name
`string` |

Loyalty Tier name.

| +| campaign_id
`string` |

Unique parent campaign ID.

**Example:**

camp_fkZ28pe7DUAEmmabofkxHI8N

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format.

| +| created_at
`string` |

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

**Example:**

2022-11-10T12:20:52.755Z

| +| updated_at
`string` |

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

**Example:**

2022-11-25T10:59:43.231Z

| +| earning_rules
`object` |

Contains a list of earning rule IDs and their points mapping for the given earning rule.

AttributesDescription
unique_earning_rule_ID

ern_95aq3JaE5A8xzHjoJPYNRqXZ

Any of: Multiply Points, Fixed Points
| +| rewards
`object` |

Contains a list of reward IDs and their points mapping for the given reward.

AttributesDescription
unique_reward_ID

rewa_t88DnSdNnE0IzQX6gqH3jHGQ

Any of: Multiply Points, Fixed Points
| +| config
`object` |

Defines loyalty tier range in points.

AttributesDescription
points
object

Defines range of loyalty tier in points.

AttributesDescription
from
integer

Bottom points threshold value.

to
integer

Top points threshold value.

| +| points
`object` |

Defines range of loyalty tier in points.

AttributesDescription
from
integer

Bottom points threshold value.

to
integer

Top points threshold value.

| +| object
`string` |

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

| +## Multiply Points | Attributes | Description | |:-----|:--------| -| type |

Type of calculation.

Available values: `MULTIPLY` | -| multiplier |

Multiplication factor used to multiply the points to obtain the mapped points.

| -# Fixed Points +| type
`string` |

Type of calculation.

Available values: `MULTIPLY` | +| multiplier
`integer` |

Multiplication factor used to multiply the points to obtain the mapped points.

| +## Fixed Points | Attributes | Description | |:-----|:--------| -| type |

Type of calculation.

Available values: `CUSTOM` | -| points |

Fixed number of points to be applied.

| +| type
`string` |

Type of calculation.

Available values: `CUSTOM` | +| points
`integer` |

Fixed number of points to be applied.

| [block:html] { diff --git a/docs/reference-docs/METADATA-SCHEMAS-API-Metadata-Schema-Object.md b/docs/reference-docs/METADATA-SCHEMAS-API-Metadata-Schema-Object.md index fbdd97fbe..491cb029a 100644 --- a/docs/reference-docs/METADATA-SCHEMAS-API-Metadata-Schema-Object.md +++ b/docs/reference-docs/METADATA-SCHEMAS-API-Metadata-Schema-Object.md @@ -8,16 +8,16 @@ hidden: false order: 1 --- - +## Metadata Schema Object | Attributes | Description | |:-----|:--------| -| id |

Unique metadata schema ID.

**Example:**

ms_OF36L2rk4EqhdxvZs56IW9iE

| -| related_object |

The resource type. There is an infinite number of possibilities for the resource type because you can define custom metadata schemas. Some examples are included here to show you the standard metadata schema resource types.

Available values: `campaign`, `customer`, `earning_rule`, `loyalty_tier`, `order`, `order_item`, `product`, `promotion_tier`, `publication`, `redemption`, `reward`, `voucher` | -| properties |

Contains the metadata definitions. There can be many properties within this object.

Any of:
AttributesDescription
custom_property_name

Custom property name. This is defined in Project Settings > Metadata Schema in the Dashboard.

AttributesDescription
typeAvailable values: string, number, object, date, datetime, geopoint, boolean, image_url
array

Indicates whether the definition is an array.

optional

Indicates whether this definition is optional or not optional for the resource.

objectType

Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object.

eq

Array of possible values when the setting for is equal to any of in the Dashboard is defined explicitly.

ne

Array of values that are not allowed when the setting for is not equal to any of in the Dashboard is defined explicitly.

lt

A property of number type must have less than this value.

lte

A property of number type must be less than or equal to this value.

gt

A property of number type must be greater than this value.

gte

A property of number type must be greater than or equal to this value.

deleted

Indicates whether the definition was deleted from the schema.

maxLength

Value for maximum length when the setting for has maximum length of in the Dashboard is defined explicitly.

minLength

Value indicating minimum length when the setting for has minimum length of in the Dashboard is defined explicitly.

exactLength

Value indicating exact length when the setting for has exact length of in the Dashboard is defined explicitly.

| -| allow_defined_only |

Restricts the creation of metadata fields when set to true. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values.

| -| created_at |

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

**Example:**

2021-12-03T13:33:44.556Z

| -| updated_at |

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

**Example:**

2022-08-11T08:05:30.695Z

| -| object |

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

| +| id
`string` |

Unique metadata schema ID.

**Example:**

ms_OF36L2rk4EqhdxvZs56IW9iE

| +| related_object
`string` |

The resource type. There is an infinite number of possibilities for the resource type because you can define custom metadata schemas. Some examples are included here to show you the standard metadata schema resource types.

Available values: `campaign`, `customer`, `earning_rule`, `loyalty_tier`, `order`, `order_item`, `product`, `promotion_tier`, `publication`, `redemption`, `reward`, `voucher` | +| properties
`object` |

Contains the metadata definitions. There can be many properties within this object.

Any of:
AttributesDescription
custom_property_name
object

Custom property name. This is defined in Project Settings > Metadata Schema in the Dashboard.

AttributesDescription
type
string
Available values: string, number, object, date, datetime, geopoint, boolean, image_url
array
boolean

Indicates whether the definition is an array.

optional
boolean

Indicates whether this definition is optional or not optional for the resource.

objectType
string,null

Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object.

eq
array

Array of possible values when the setting for is equal to any of in the Dashboard is defined explicitly.

ne
array

Array of values that are not allowed when the setting for is not equal to any of in the Dashboard is defined explicitly.

lt
integer

A property of number type must have less than this value.

lte
integer

A property of number type must be less than or equal to this value.

gt
integer

A property of number type must be greater than this value.

gte
integer

A property of number type must be greater than or equal to this value.

deleted
boolean

Indicates whether the definition was deleted from the schema.

maxLength
integer

Value for maximum length when the setting for has maximum length of in the Dashboard is defined explicitly.

minLength
integer

Value indicating minimum length when the setting for has minimum length of in the Dashboard is defined explicitly.

exactLength
integer

Value indicating exact length when the setting for has exact length of in the Dashboard is defined explicitly.

| +| allow_defined_only
`boolean` |

Restricts the creation of metadata fields when set to true. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values.

| +| created_at
`string` |

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

**Example:**

2021-12-03T13:33:44.556Z

| +| updated_at
`string` |

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

**Example:**

2022-08-11T08:05:30.695Z

| +| object
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/ORDERS-API-Order-Object.md b/docs/reference-docs/ORDERS-API-Order-Object.md index 6373cbe76..dfefedfab 100644 --- a/docs/reference-docs/ORDERS-API-Order-Object.md +++ b/docs/reference-docs/ORDERS-API-Order-Object.md @@ -8,35 +8,35 @@ hidden: false order: 1 --- - +## Order object | Attributes | Description | |:-----|:--------| -| id |

Unique order ID, assigned by Voucherify.

**Example:**

ord_GFDbbv2I0wnO0sFUBOOOXPj2

| -| source_id |

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 |

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

**Example:**

2022-03-09T11:19:04.819Z

| -| updated_at |

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

**Example:**

2022-08-12T13:34:10.681Z

| -| status |

Order status.

Available values: `CREATED`, `PAID`, `CANCELED`, `FULFILLED` | -| amount |

Order amount before applying any discount.

| -| discount_amount |

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

| -| items_discount_amount |

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

| -| total_discount_amount |

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

| -| total_amount |

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

| -| items |

Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.

Array of:
AttributesDescription
object

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

product_id

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

Example:

prod_5h0wc453_1

sku_id

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

Example:

sku_prod_5h0wc453_1_1

quantity

Quantity of the item in the cart.

amount

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

discount_amount

The item-level discount applied to the item.

price

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

subtotal_amount

Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount

product

This object stores more information about the related product.

AttributesDescription
id

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

Example:

prod_5h0wc453_1

source_id

A unique product identifier from your inventory system.

Example:

illy-arabica

name

Product name.

Example:

Brewing System

price

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

sku

This object stores more information about the related SKU.

AttributesDescription
id

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

Example:

sku_prod_5h0wc453_1_1

source_id

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku

SKU name.

price

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

| -| metadata |

The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.

| -| customer |

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

AttributesDescription
id

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object

Type of object represented by the customer object.

| -| referrer |

Object containing information about the referrer.

AttributesDescription
id

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

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object

Type of object represented by the referrer object.

| -| customer_id |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| -| referrer_id |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| -| object |

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

| +| id
`string` |

Unique order ID, assigned by Voucherify.

**Example:**

ord_GFDbbv2I0wnO0sFUBOOOXPj2

| +| 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-03-09T11:19:04.819Z

| +| updated_at
`string` |

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

**Example:**

2022-08-12T13:34:10.681Z

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

| +| items_discount_amount
`integer` |

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

| +| total_discount_amount
`integer` |

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

| +| total_amount
`integer` |

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

| +| items
`array` |

Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.

Array of:
AttributesDescription
object
string

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

product_id
string

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

Example:

prod_5h0wc453_1

sku_id
string

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

Example:

sku_prod_5h0wc453_1_1

quantity
integer

Quantity of the item in the cart.

amount
integer

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

discount_amount
integer

The item-level discount applied to the item.

price
integer

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

subtotal_amount
integer

Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount

product
object

This object stores more information about the related product.

AttributesDescription
id
string

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

Example:

prod_5h0wc453_1

source_id
string

A unique product identifier from your inventory system.

Example:

illy-arabica

name
string

Product name.

Example:

Brewing System

price
integer

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

sku
object

This object stores more information about the related SKU.

AttributesDescription
id
string

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

Example:

sku_prod_5h0wc453_1_1

source_id
string

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku
string

SKU name.

price
integer

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.

| +| customer
`object` |

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

AttributesDescription
id
string

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the customer object.

| +| referrer
`object` |

Object containing information about the referrer.

AttributesDescription
id
string

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

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the referrer object.

| +| customer_id
`string` |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| +| referrer_id
`string` |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| +| object
`string` |

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

| | redemptions | One of: [Unstacked Redemption](#unstacked-redemption), [Stacked Redemption](#stacked-redemption) | -# Unstacked Redemption +## Unstacked Redemption | Attributes | Description | |:-----|:--------| -| redemption_ID |

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

AttributesDescription
date

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

Example:

2022-09-02T17:06:56.649Z

related_object_type

The source of the incentive.

Available values: voucher, promotion_tier
related_object_id

Unique ID of the related object that defines the incentive.

related_object_parent_id

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.

| -# Stacked Redemption +| redemption_ID
`object` |

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

AttributesDescription
date
string

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

Example:

2022-09-02T17:06:56.649Z

related_object_type
string

The source of the incentive.

Available values: voucher, promotion_tier
related_object_id
string

Unique ID of the related object that defines the incentive.

related_object_parent_id
string

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

| +## Stacked Redemption | Attributes | Description | |:-----|:--------| -| redemption_ID |

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

AttributesDescription
date

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

Example:

2022-09-02T17:06:56.649Z

related_object_type

The source of the incentive.

related_object_id

Unique ID of the parent redemption.

Example:

r_0ba186c4824e4881e1

stacked

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

| +| redemption_ID
`object` |

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

AttributesDescription
date
string

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

Example:

2022-09-02T17:06:56.649Z

related_object_type
string

The source of the incentive.

related_object_id
string

Unique ID of the parent redemption.

Example:

r_0ba186c4824e4881e1

stacked
array

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

| [block:html] { diff --git a/docs/reference-docs/PRODUCTS-API-Product-Object.md b/docs/reference-docs/PRODUCTS-API-Product-Object.md index 53f071c0a..9edd37d11 100644 --- a/docs/reference-docs/PRODUCTS-API-Product-Object.md +++ b/docs/reference-docs/PRODUCTS-API-Product-Object.md @@ -8,42 +8,42 @@ hidden: false order: 1 --- - +## Product Object | Attributes | Description | |:-----|:--------| -| id |

Unique product ID assigned by Voucherify.

**Example:**

prod_0b1da8105693710357

| -| source_id |

Unique product source ID from your inventory system.

**Example:**

productSourceID16

| -| name |

Unique user-defined product name.

**Example:**

T-shirt

| -| price |

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

| -| attributes |

A list of product attributes whose values you can customize for given SKUs: ["color","size","ranking"]. Each child SKU can have a unique value for a given attribute.

| -| metadata |

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 |

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 |

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

**Example:**

2022-05-23T06:52:55.008Z

| -| updated_at |

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

**Example:**

2022-05-23T09:24:07.405Z

| -| object |

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

| +| id
`string` |

Unique product ID assigned by Voucherify.

**Example:**

prod_0b1da8105693710357

| +| source_id
`string` |

Unique product source ID from your inventory system.

**Example:**

productSourceID16

| +| name
`string` |

Unique user-defined product name.

**Example:**

T-shirt

| +| price
`integer` |

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

| +| attributes
`array` |

A list of product attributes whose values you can customize for given SKUs: ["color","size","ranking"]. Each child SKU can have a unique value for a given attribute.

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format.

| +| image_url
`string` |

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

**Example:**

https://images.com/original.jpg

| +| created_at
`string` |

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

**Example:**

2022-05-23T06:52:55.008Z

| +| updated_at
`string` |

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

**Example:**

2022-05-23T09:24:07.405Z

| +| object
`string` |

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

| | skus | See: [SKUs object](#skus-object) | -# SKUs object +## SKUs object | Attributes | Description | |:-----|:--------| -| object |

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

| -| data_ref |

Identifies the name of the JSON property that contains the array of SKUs.

| -| data |

A dictionary that contains an array of SKUs.

Array of [SKU Object](#sku-object) | -| total |

Total number of SKUs in the product.

| -# SKU Object +| object
`string` |

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

| +| data_ref
`string` |

Identifies the name of the JSON property that contains the array of SKUs.

| +| data
`array` |

A dictionary that contains an array of SKUs.

Array of [SKU Object](#sku-object) | +| total
`integer` |

Total number of SKUs in the product.

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

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

**Example:**

sku_0b1621b319d248b79f

| -| source_id |

A unique SKU identifier from your inventory system.

**Example:**

sku_source_id_4

| -| product_id |

The parent product's unique ID.

**Example:**

prod_0b15f6b9f650c16990

| -| sku |

Unique user-defined SKU name.

**Example:**

Large Pink Shirt

| -| price |

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

| -| currency |

SKU price currency.

**Example:**

USD

| -| attributes |

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 |

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

| -| metadata |

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 |

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

**Example:**

2022-05-17T10:36:30.187Z

| -| updated_at |

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

**Example:**

2022-05-17T10:55:09.137Z

| -| object |

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

| +| id
`string` |

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

**Example:**

sku_0b1621b319d248b79f

| +| source_id
`string` |

A unique SKU identifier from your inventory system.

**Example:**

sku_source_id_4

| +| product_id
`string` |

The parent product's unique ID.

**Example:**

prod_0b15f6b9f650c16990

| +| sku
`string` |

Unique user-defined SKU name.

**Example:**

Large Pink Shirt

| +| price
`integer` |

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

| +| currency
`string` |

SKU price currency.

**Example:**

USD

| +| attributes
`object` |

The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family.

| +| image_url
`string` |

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format.

| +| created_at
`string` |

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

**Example:**

2022-05-17T10:36:30.187Z

| +| updated_at
`string` |

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

**Example:**

2022-05-17T10:55:09.137Z

| +| object
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/PRODUCTS-API-SKU-Object.md b/docs/reference-docs/PRODUCTS-API-SKU-Object.md index 5459020f4..b01f02a47 100644 --- a/docs/reference-docs/PRODUCTS-API-SKU-Object.md +++ b/docs/reference-docs/PRODUCTS-API-SKU-Object.md @@ -8,21 +8,21 @@ hidden: false order: 2 --- - +## SKU Object | Attributes | Description | |:-----|:--------| -| id |

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

**Example:**

sku_0b1621b319d248b79f

| -| source_id |

A unique SKU identifier from your inventory system.

**Example:**

sku_source_id_4

| -| product_id |

The parent product's unique ID.

**Example:**

prod_0b15f6b9f650c16990

| -| sku |

Unique user-defined SKU name.

**Example:**

Large Pink Shirt

| -| price |

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

| -| currency |

SKU price currency.

**Example:**

USD

| -| attributes |

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 |

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

| -| metadata |

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 |

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

**Example:**

2022-05-17T10:36:30.187Z

| -| updated_at |

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

**Example:**

2022-05-17T10:55:09.137Z

| -| object |

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

| +| id
`string` |

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

**Example:**

sku_0b1621b319d248b79f

| +| source_id
`string` |

A unique SKU identifier from your inventory system.

**Example:**

sku_source_id_4

| +| product_id
`string` |

The parent product's unique ID.

**Example:**

prod_0b15f6b9f650c16990

| +| sku
`string` |

Unique user-defined SKU name.

**Example:**

Large Pink Shirt

| +| price
`integer` |

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

| +| currency
`string` |

SKU price currency.

**Example:**

USD

| +| attributes
`object` |

The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family.

| +| image_url
`string` |

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format.

| +| created_at
`string` |

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

**Example:**

2022-05-17T10:36:30.187Z

| +| updated_at
`string` |

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

**Example:**

2022-05-17T10:55:09.137Z

| +| object
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md index 87a8861c7..9add6c0ad 100644 --- a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md +++ b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md @@ -8,99 +8,99 @@ hidden: false order: 1 --- - +## Promotion Tier Object | Attributes | Description | |:-----|:--------| -| id |

Unique promotion tier ID.

**Example:**

promo_63fYCt81Aw0h7lzyRkrGZh9p

| -| created_at |

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 |

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

**Example:**

2022-02-09T09:20:05.603Z

| -| name |

Name of the promotion tier.

| -| banner |

Text to be displayed to your customers on your website.

| -| action |

Contains details about the discount applied by the promotion tier.

AttributesDescription
discount

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

Any of: Amount, Percentage, Fixed, Unit, single item, Unit, multiple items, Shipping
| -| metadata |

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 |

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 |

Contains details about promotion tier's parent campaign.

AttributesDescription
id

Unique campaign ID.

start_date

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

Example:

2022-09-22T00:00:00.000Z

expiration_date

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

Example:

2022-09-30T00:00:00.000Z

validity_timeframe

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

AttributesDescription
interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

validity_day_of_week

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

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

A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the start_date and expiration_date using the Disable Campaign endpoint.

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

Unique category ID that this campaign belongs to.

Example:

cat_0b688929a2476386a6

object

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

| -| campaign_id |

Promotion tier's parent campaign's unique ID.

| -| active |

A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the start_date and expiration_date.

| -| start_date |

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

**Example:**

2022-09-23T00:00:00.000Z

| -| expiration_date |

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 |

Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an interval of P2D will be active every other day.

duration

Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a duration of P1D will be valid for a duration of one day.

| -| validity_day_of_week |

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

| -| summary |

Contains statistics about promotion tier redemptions and orders.

AttributesDescription
redemptions

Contains statistics about promotion tier redemptions.

AttributesDescription
total_redeemed

Number of times the promotion tier was redeemed.

orders

Contains statistics about orders related to the promotion tier.

AttributesDescription
total_amount

Sum of order totals.

total_discount_amount

Sum of total discount applied using the promotion tier.

| -| object |

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

| +| id
`string` |

Unique promotion tier ID.

**Example:**

promo_63fYCt81Aw0h7lzyRkrGZh9p

| +| created_at
`string` |

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

**Example:**

2021-12-15T11:34:01.333Z

| +| updated_at
`string` |

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

**Example:**

2022-02-09T09:20:05.603Z

| +| name
`string` |

Name of the promotion tier.

| +| banner
`string` |

Text to be displayed to your customers on your website.

| +| action
`object` |

Contains details about the discount applied by the promotion tier.

AttributesDescription
discount

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

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

The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format.

| +| hierarchy
`integer` |

The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy.

| +| campaign
`object` |

Contains details about promotion tier's parent campaign.

AttributesDescription
id
string

Unique campaign ID.

start_date
string

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

Example:

2022-09-22T00:00:00.000Z

expiration_date
string

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

Example:

2022-09-30T00:00:00.000Z

validity_timeframe
object

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

AttributesDescription
interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.

duration
string

Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.

validity_day_of_week
array

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

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

A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the start_date and expiration_date using the Disable Campaign endpoint.

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

Unique category ID that this campaign belongs to.

Example:

cat_0b688929a2476386a6

object
string

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

| +| campaign_id
`string` |

Promotion tier's parent campaign's unique ID.

| +| active
`boolean` |

A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the start_date and expiration_date.

| +| start_date
`string` |

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

**Example:**

2022-09-23T00:00:00.000Z

| +| expiration_date
`string` |

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

**Example:**

2022-09-26T00:00:00.000Z

| +| validity_timeframe
`object` |

Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an interval of P2D will be active every other day.

duration
string

Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a duration of P1D will be valid for a duration of one day.

| +| validity_day_of_week
`array` |

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

| +| summary
`object` |

Contains statistics about promotion tier redemptions and orders.

AttributesDescription
redemptions
object

Contains statistics about promotion tier redemptions.

AttributesDescription
total_redeemed
integer

Number of times the promotion tier was redeemed.

orders
object

Contains statistics about orders related to the promotion tier.

AttributesDescription
total_amount
integer

Sum of order totals.

total_discount_amount
integer

Sum of total discount applied using the promotion tier.

| +| object
`string` |

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

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

Promotion tier category ID.

**Example:**

cat_0c9da30e7116ba6bba

| +| 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) | -# Amount +## Amount | Attributes | Description | |:-----|:--------| -| type |

Applies an amount discount.

| -| amount_off |

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

**Example:**

100

| -| amount_off_formula |

Formula used to calculate the discount.

| -| aggregated_amount_limit |

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

| -| effect |

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

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

Applies an amount discount.

| +| amount_off
`integer` |

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

**Example:**

100

| +| amount_off_formula
`string` |

Formula used to calculate the discount.

| +| aggregated_amount_limit
`integer` |

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

| +| effect
`string` |

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

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

Applies a percentage discount.

| -| amount_limit |

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 |

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

| -| percent_off |

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

| -| percent_off_formula |

Formula used to calculate the discount.

| -| effect |

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

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

Applies a percentage discount.

| +| amount_limit
`string` |

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

| +| aggregated_amount_limit
`integer` |

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

| +| percent_off
`integer` |

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

| +| percent_off_formula
`string` |

Formula used to calculate the discount.

| +| effect
`string` |

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

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

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

| -| fixed_amount |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| -| fixed_amount_formula |

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

| -| effect |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | -# Unit, single item +| type
`string` |

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

| +| fixed_amount
`integer` |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| +| fixed_amount_formula
`string` |

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

| +| effect
`string` |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | +## Unit, single item | Attributes | Description | |:-----|:--------| -| type |

Applies a full value discount to item(s).

| -| unit_off |

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

**Example:**

1

| -| unit_off_formula |

Formula used to calculate the number of units.

| -| unit_type |

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

**Example:**

prod_f1r5Tpr0DuC7

| -| effect |

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

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

Applies a full value discount to item(s).

| +| unit_off
`number` |

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

**Example:**

1

| +| unit_off_formula
`string` |

Formula used to calculate the number of units.

| +| unit_type
`string` |

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

**Example:**

prod_f1r5Tpr0DuC7

| +| effect
`string` |

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

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

Applies a full value discount to item(s).

| -| effect |

Defines the effect for adding multiple item types.

| -| units |

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

Array of:
AttributesDescription
unit_off

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

Example:

1

unit_off_formula

Formula used to calculate the number of units.

unit_type

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

Example:

prod_f1r5Tpr0DuC7

effect

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

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

Applies a full value discount to item(s).

| +| effect
`string` |

Defines the effect for adding multiple item types.

| +| units
`array` |

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

Array of:
AttributesDescription
unit_off
integer

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

Example:

1

unit_off_formula
string

Formula used to calculate the number of units.

unit_type
string

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

Example:

prod_f1r5Tpr0DuC7

effect
string

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

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

Applies a full value discount to item(s).

| -| unit_off |

Subtracts 1 shipping item from the subtotal.

| -| unit_type |

The shipping product deemed as free.

| -| effect |

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

| -# Validation Rule Assignments +| type
`string` |

Applies a full value discount to item(s).

| +| unit_off
`number` |

Subtracts 1 shipping item from the subtotal.

| +| unit_type
`string` |

The shipping product deemed as free.

| +| effect
`string` |

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

| +## Validation Rule Assignments | Attributes | Description | |:-----|:--------| -| object |

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

| -| data_ref |

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

| -| data |

A dictionary that contains an array of validation rule assignments.

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

Total number of validation rule assignments.

| -# Category Object +| 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.

| +## Category Object | Attributes | Description | |:-----|:--------| -| id |

Unique category ID assigned by Voucherify.

| -| name |

Category name.

| -| hierarchy |

Category hierarchy.

| -| created_at |

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

**Example:**

2022-07-14T10:45:13.156Z

| -| updated_at |

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

**Example:**

2022-08-16T10:52:08.094Z

| -| object |

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

| -# Validation Rule Assignment Object +| 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.

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

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| -| rule_id |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| -| related_object_id |

The resource ID to which the validation rule was assigned.

**Example:**

v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

| -| related_object_type |

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

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

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

**Example:**

2022-02-17T08:18:15.085Z

| -| object |

The type of object represented by the ID.

| +| id
`string` |

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| +| rule_id
`string` |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| +| related_object_id
`string` |

The resource ID to which the validation rule was assigned.

**Example:**

v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

| +| related_object_type
`string` |

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

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

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

**Example:**

2022-02-17T08:18:15.085Z

| +| object
`string` |

The type of object represented by the ID.

| [block:html] { diff --git a/docs/reference-docs/PUBLICATIONS-API-Publication-Object.md b/docs/reference-docs/PUBLICATIONS-API-Publication-Object.md index f36979c7c..61326f329 100644 --- a/docs/reference-docs/PUBLICATIONS-API-Publication-Object.md +++ b/docs/reference-docs/PUBLICATIONS-API-Publication-Object.md @@ -8,90 +8,90 @@ hidden: false order: 1 --- - +## Publication Object | Attributes | Description | |:-----|:--------| -| id |

Unique publication ID, assigned by Voucherify.

**Example:**

pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp

| -| object |

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

| -| created_at |

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

**Example:**

2022-09-23T09:57:00.434Z

| -| customer_id |

Unique customer ID of the customer receiving the publication.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| -| tracking_id |

Customer's source_id.

| -| metadata |

The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.

| -| channel |

How the publication was originated. It can be your own custom channel or an example value provided here.

Available values: `voucherify-website`, `Dashboard`, `Automation`, `API`, `Braze`, `Reward`, `SMS`, `Email`, `Activecampaign`, `Webhook`, `Intercom`, `Mailchimp`, `Shopify` | -| source_id |

The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service.

| -| result |

Status of the publication attempt.

Available values: `SUCCESS`, `FAILURE` | -| customer |

Contains information about the customer to whom the publication was directed.

AttributesDescription
id

Unique customer ID, assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name

Customer's name.

email

Customer's email.

source_id

The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service.

metadata

A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

object

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

| +| id
`string` |

Unique publication ID, assigned by Voucherify.

**Example:**

pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp

| +| object
`string` |

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

| +| created_at
`string` |

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

**Example:**

2022-09-23T09:57:00.434Z

| +| customer_id
`string` |

Unique customer ID of the customer receiving the publication.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| +| tracking_id
`string` |

Customer's source_id.

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.

| +| channel
`string` |

How the publication was originated. It can be your own custom channel or an example value provided here.

Available values: `voucherify-website`, `Dashboard`, `Automation`, `API`, `Braze`, `Reward`, `SMS`, `Email`, `Activecampaign`, `Webhook`, `Intercom`, `Mailchimp`, `Shopify` | +| source_id
`string` |

The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service.

| +| result
`string` |

Status of the publication attempt.

Available values: `SUCCESS`, `FAILURE` | +| customer
`object` |

Contains information about the customer to whom the publication was directed.

AttributesDescription
id
string

Unique customer ID, assigned by Voucherify.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's name.

email
string

Customer's email.

source_id
string

The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service.

metadata
object

A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

object
string

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

| | voucher |

Contains information about the voucher being published.

Any of: [Discount Voucher](#discount-voucher), [Loyalty Card](#loyalty-card), [Gift Card](#gift-card) | -| vouchers_id |

Contains the unique internal voucher ID that was assigned by Voucherify.

| -# Discount Voucher +| vouchers_id
`array` |

Contains the unique internal voucher ID that was assigned by Voucherify.

| +## Discount Voucher | Attributes | Description | |:-----|:--------| -| code |

Voucher code.

| -| object |

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

| -| campaign |

Name of voucher's parent campaign.

| +| code
`string` |

Voucher code.

| +| object
`string` |

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

| +| campaign
`string` |

Name of voucher's parent campaign.

| | discount | Any of: [Amount](#amount), [Percentage](#percentage), [Fixed](#fixed), [Unit, single item](#unit-single-item), [Unit, multiple items](#unit-multiple-items), [Shipping](#shipping) | -| is_referral_code |

Whether this voucher is a referral code.

| -# Loyalty Card +| is_referral_code
`boolean` |

Whether this voucher is a referral code.

| +## Loyalty Card | Attributes | Description | |:-----|:--------| -| code |

Voucher code.

| -| object |

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

| -| campaign |

Name of voucher's parent campaign.

| -| loyalty_card |

Contains information about the loyalty card being published.

AttributesDescription
points

The incremental points to be added to the loyalty card as the initial balance on the card.

balance

The points balance after the incremental points are added to the loyalty card.

| -| is_referral_code |

Whether this voucher is a referral code.

| -# Gift Card +| code
`string` |

Voucher code.

| +| object
`string` |

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

| +| campaign
`string` |

Name of voucher's parent campaign.

| +| loyalty_card
`object` |

Contains information about the loyalty card being published.

AttributesDescription
points
integer

The incremental points to be added to the loyalty card as the initial balance on the card.

balance
integer

The points balance after the incremental points are added to the loyalty card.

| +| is_referral_code
`boolean` |

Whether this voucher is a referral code.

| +## Gift Card | Attributes | Description | |:-----|:--------| -| code |

Voucher code.

| -| object |

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

| -| campaign |

Name of voucher's parent campaign.

| -| gift |

Contains information about the gift card being published.

AttributesDescription
amount

The incremental amount to be added as the initial balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

balance

The credit balance on the gift card after the initial incremental amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

effect

How the credits are applied to the customer's order.

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
| -| is_referral_code |

Whether this voucher is a referral code.

| -# Amount +| code
`string` |

Voucher code.

| +| object
`string` |

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

| +| campaign
`string` |

Name of voucher's parent campaign.

| +| gift
`object` |

Contains information about the gift card being published.

AttributesDescription
amount
integer

The incremental amount to be added as the initial balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

balance
integer

The credit balance on the gift card after the initial incremental amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

effect
string

How the credits are applied to the customer's order.

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
| +| is_referral_code
`boolean` |

Whether this voucher is a referral code.

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

Applies an amount discount.

| -| amount_off |

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

**Example:**

100

| -| amount_off_formula |

Formula used to calculate the discount.

| -| aggregated_amount_limit |

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

| -| effect |

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

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

Applies an amount discount.

| +| amount_off
`integer` |

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

**Example:**

100

| +| amount_off_formula
`string` |

Formula used to calculate the discount.

| +| aggregated_amount_limit
`integer` |

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

| +| effect
`string` |

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

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

Applies a percentage discount.

| -| amount_limit |

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 |

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

| -| percent_off |

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

| -| percent_off_formula |

Formula used to calculate the discount.

| -| effect |

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

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

Applies a percentage discount.

| +| amount_limit
`string` |

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

| +| aggregated_amount_limit
`integer` |

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

| +| percent_off
`integer` |

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

| +| percent_off_formula
`string` |

Formula used to calculate the discount.

| +| effect
`string` |

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

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

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

| -| fixed_amount |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| -| fixed_amount_formula |

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

| -| effect |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | -# Unit, single item +| type
`string` |

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

| +| fixed_amount
`integer` |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| +| fixed_amount_formula
`string` |

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

| +| effect
`string` |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | +## Unit, single item | Attributes | Description | |:-----|:--------| -| type |

Applies a full value discount to item(s).

| -| unit_off |

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

**Example:**

1

| -| unit_off_formula |

Formula used to calculate the number of units.

| -| unit_type |

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

**Example:**

prod_f1r5Tpr0DuC7

| -| effect |

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

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

Applies a full value discount to item(s).

| +| unit_off
`number` |

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

**Example:**

1

| +| unit_off_formula
`string` |

Formula used to calculate the number of units.

| +| unit_type
`string` |

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

**Example:**

prod_f1r5Tpr0DuC7

| +| effect
`string` |

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

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

Applies a full value discount to item(s).

| -| effect |

Defines the effect for adding multiple item types.

| -| units |

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

Array of:
AttributesDescription
unit_off

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

Example:

1

unit_off_formula

Formula used to calculate the number of units.

unit_type

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

Example:

prod_f1r5Tpr0DuC7

effect

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

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

Applies a full value discount to item(s).

| +| effect
`string` |

Defines the effect for adding multiple item types.

| +| units
`array` |

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

Array of:
AttributesDescription
unit_off
integer

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

Example:

1

unit_off_formula
string

Formula used to calculate the number of units.

unit_type
string

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

Example:

prod_f1r5Tpr0DuC7

effect
string

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

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

Applies a full value discount to item(s).

| -| unit_off |

Subtracts 1 shipping item from the subtotal.

| -| unit_type |

The shipping product deemed as free.

| -| effect |

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

| +| type
`string` |

Applies a full value discount to item(s).

| +| unit_off
`number` |

Subtracts 1 shipping item from the subtotal.

| +| unit_type
`string` |

The shipping product deemed as free.

| +| effect
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/QUALIFICATIONS-API-Qualification-Object.md b/docs/reference-docs/QUALIFICATIONS-API-Qualification-Object.md index a96ac6866..429a710a0 100644 --- a/docs/reference-docs/QUALIFICATIONS-API-Qualification-Object.md +++ b/docs/reference-docs/QUALIFICATIONS-API-Qualification-Object.md @@ -8,46 +8,46 @@ hidden: false order: 1 --- - +## Qualification object | Attributes | Description | |:-----|:--------| | redeemables | See: [Redeemables](#redeemables) | -| tracking_id |

This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID.

| -| order |

The order object sent in the request.

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

This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID.

| +| order
`object` |

The order object sent in the request.

See: [Order object](#order-object) | | stacking_rules | See: [Examine Qualification Stacking Rules](#examine-qualification-stacking-rules) | -# Redeemables +## Redeemables | Attributes | Description | |:-----|:--------| -| object |

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

| -| data_ref |

Identifies the name of the attribute that contains the array of qualified redeemables.

| -| data |

Array of qualified redeemables.

| -| total |

The number of redeemables returned in the API request.

**Example:**

5

| -| has_more |

As results are always limited, the has_more flag indicates whether there are more records for given parameters. This let's you know if you are able to run another request (with different options) to get more records returned in the results.

| -# Order object +| object
`string` |

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

| +| data_ref
`string` |

Identifies the name of the attribute that contains the array of qualified redeemables.

| +| data
`array` |

Array of qualified redeemables.

| +| total
`integer` |

The number of redeemables returned in the API request.

**Example:**

5

| +| has_more
`boolean` |

As results are always limited, the has_more flag indicates whether there are more records for given parameters. This let's you know if you are able to run another request (with different options) to get more records returned in the results.

| +## Order object | Attributes | Description | |:-----|:--------| -| id |

Unique order ID, assigned by Voucherify.

**Example:**

ord_GFDbbv2I0wnO0sFUBOOOXPj2

| -| source_id |

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 |

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

**Example:**

2022-03-09T11:19:04.819Z

| -| updated_at |

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

**Example:**

2022-08-12T13:34:10.681Z

| -| status |

Order status.

Available values: `CREATED`, `PAID`, `CANCELED`, `FULFILLED` | -| amount |

Order amount before applying any discount.

| -| discount_amount |

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

| -| items_discount_amount |

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

| -| total_discount_amount |

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

| -| total_amount |

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

| -| items |

Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.

Array of:
AttributesDescription
object

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

product_id

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

Example:

prod_5h0wc453_1

sku_id

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

Example:

sku_prod_5h0wc453_1_1

quantity

Quantity of the item in the cart.

amount

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

discount_amount

The item-level discount applied to the item.

price

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

subtotal_amount

Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount

product

This object stores more information about the related product.

AttributesDescription
id

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

Example:

prod_5h0wc453_1

source_id

A unique product identifier from your inventory system.

Example:

illy-arabica

name

Product name.

Example:

Brewing System

price

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

sku

This object stores more information about the related SKU.

AttributesDescription
id

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

Example:

sku_prod_5h0wc453_1_1

source_id

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku

SKU name.

price

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

| -| metadata |

The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.

| -| customer |

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

AttributesDescription
id

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object

Type of object represented by the customer object.

| -| referrer |

Object containing information about the referrer.

AttributesDescription
id

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

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object

Type of object represented by the referrer object.

| -| customer_id |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| -| referrer_id |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| -| object |

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

| -# Examine Qualification Stacking Rules +| id
`string` |

Unique order ID, assigned by Voucherify.

**Example:**

ord_GFDbbv2I0wnO0sFUBOOOXPj2

| +| 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-03-09T11:19:04.819Z

| +| updated_at
`string` |

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

**Example:**

2022-08-12T13:34:10.681Z

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

| +| items_discount_amount
`integer` |

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

| +| total_discount_amount
`integer` |

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

| +| total_amount
`integer` |

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

| +| items
`array` |

Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.

Array of:
AttributesDescription
object
string

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

product_id
string

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

Example:

prod_5h0wc453_1

sku_id
string

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

Example:

sku_prod_5h0wc453_1_1

quantity
integer

Quantity of the item in the cart.

amount
integer

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

discount_amount
integer

The item-level discount applied to the item.

price
integer

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

subtotal_amount
integer

Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount

product
object

This object stores more information about the related product.

AttributesDescription
id
string

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

Example:

prod_5h0wc453_1

source_id
string

A unique product identifier from your inventory system.

Example:

illy-arabica

name
string

Product name.

Example:

Brewing System

price
integer

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

sku
object

This object stores more information about the related SKU.

AttributesDescription
id
string

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

Example:

sku_prod_5h0wc453_1_1

source_id
string

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku
string

SKU name.

price
integer

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.

| +| customer
`object` |

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

AttributesDescription
id
string

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the customer object.

| +| referrer
`object` |

Object containing information about the referrer.

AttributesDescription
id
string

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

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the referrer object.

| +| customer_id
`string` |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| +| referrer_id
`string` |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| +| object
`string` |

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

| +## Examine Qualification Stacking Rules | Attributes | Description | |:-----|:--------| -| redeemables_limit |

Defines how many redeemables can be sent with one stacking request. We have extended the maximum value from 5 to 30 (comment: but more redeemables means more processing time!). Default limit is 30.

| -| applicable_redeemables_limit |

Defines how many of sent redeemables will be actually applied to the order (e.g. user can select 30 discounts but only 5 will be applied to the order, the remaining will be marked as SKIPPED). Default limit is 5.

| +| redeemables_limit
`integer` |

Defines how many redeemables can be sent with one stacking request. We have extended the maximum value from 5 to 30 (comment: but more redeemables means more processing time!). Default limit is 30.

| +| applicable_redeemables_limit
`integer` |

Defines how many of sent redeemables will be actually applied to the order (e.g. user can select 30 discounts but only 5 will be applied to the order, the remaining will be marked as SKIPPED). Default limit is 5.

| [block:html] { diff --git a/docs/reference-docs/REWARDS-API-Reward-Assignment-Object.md b/docs/reference-docs/REWARDS-API-Reward-Assignment-Object.md index 815d73c2b..50df95391 100644 --- a/docs/reference-docs/REWARDS-API-Reward-Assignment-Object.md +++ b/docs/reference-docs/REWARDS-API-Reward-Assignment-Object.md @@ -8,17 +8,17 @@ hidden: false order: 2 --- - +## Reward Assignment Object | Attributes | Description | |:-----|:--------| -| id |

Unique reward assignment ID, assigned by Voucherify.

**Example:**

rewa_PbIRoMXpwe5QhobW4JKu0VjH

| -| reward_id |

Associated reward ID.

**Example:**

rew_C7wS9eHFDN4CIbXI5PpLSkGY

| -| related_object_id |

Related object ID to which the reward was assigned.

**Example:**

camp_wciTvaOfYmAa3EmIIW3QpXXZ

| -| related_object_type |

Related object type to which the reward was assigned.

**Example:**

campaign

| -| parameters |

Defines the cost of the reward.

AttributesDescription
loyalty

Defines the equivalent points value of the reward.

AttributesDescription
points

The number of points required to redeem the reward.

| -| created_at |

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

**Example:**

2022-08-11T14:49:22.586Z

| -| updated_at |

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

**Example:**

2022-08-11T16:01:34.885Z

| -| object |

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

| +| id
`string` |

Unique reward assignment ID, assigned by Voucherify.

**Example:**

rewa_PbIRoMXpwe5QhobW4JKu0VjH

| +| reward_id
`string` |

Associated reward ID.

**Example:**

rew_C7wS9eHFDN4CIbXI5PpLSkGY

| +| related_object_id
`string` |

Related object ID to which the reward was assigned.

**Example:**

camp_wciTvaOfYmAa3EmIIW3QpXXZ

| +| related_object_type
`string` |

Related object type to which the reward was assigned.

**Example:**

campaign

| +| parameters
`object` |

Defines the cost of the reward.

AttributesDescription
loyalty
object

Defines the equivalent points value of the reward.

AttributesDescription
points
integer

The number of points required to redeem the reward.

| +| created_at
`string` |

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

**Example:**

2022-08-11T14:49:22.586Z

| +| updated_at
`string` |

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

**Example:**

2022-08-11T16:01:34.885Z

| +| object
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/REWARDS-API-Reward-Object.md b/docs/reference-docs/REWARDS-API-Reward-Object.md index e38fa857f..6b618a738 100644 --- a/docs/reference-docs/REWARDS-API-Reward-Object.md +++ b/docs/reference-docs/REWARDS-API-Reward-Object.md @@ -8,49 +8,49 @@ hidden: false order: 1 --- - +## Reward Object | Attributes | Description | |:-----|:--------| -| id |

Unique reward ID, assigned by Voucherify.

**Example:**

rew_nIy4gHpQHle2c3pNMwuj7G6j

| -| name |

Reward name.

| -| type |

Reward type.

Available values: `CAMPAIGN`, `COIN`, `MATERIAL` | +| id
`string` |

Unique reward ID, assigned by Voucherify.

**Example:**

rew_nIy4gHpQHle2c3pNMwuj7G6j

| +| name
`string` |

Reward name.

| +| type
`string` |

Reward type.

Available values: `CAMPAIGN`, `COIN`, `MATERIAL` | | parameters |

Defines how the reward is generated.

One of: [Digital](#digital), [Pay with Points](#pay-with-points), [Material](#material) | -| stock |

Configurable for material rewards. The number of units of the product that you want to share as reward.

| -| redeemed |

Defines the number of already invoked (successful) reward redemptions.

| -| attributes |

These properties are configurable for material rewards.

AttributesDescription
image_url

The HTTPS URL pointing to the .png or .jpg file.

description

An arbitrary string that you can attach to a material reward.

| -| created_at |

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

**Example:**

2022-08-11T14:49:22.586Z

| -| updated_at |

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

**Example:**

2022-08-11T16:01:34.885Z

| -| metadata |

The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format.

| -| object |

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

| -# Digital +| stock
`integer` |

Configurable for material rewards. The number of units of the product that you want to share as reward.

| +| redeemed
`integer` |

Defines the number of already invoked (successful) reward redemptions.

| +| attributes
`object` |

These properties are configurable for material rewards.

AttributesDescription
image_url
string

The HTTPS URL pointing to the .png or .jpg file.

description
string

An arbitrary string that you can attach to a material reward.

| +| created_at
`string` |

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

**Example:**

2022-08-11T14:49:22.586Z

| +| updated_at
`string,null` |

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

**Example:**

2022-08-11T16:01:34.885Z

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format.

| +| object
`string` |

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

| +## Digital | Attributes | Description | |:-----|:--------| | campaign |

Objects stores information about the campaign related to the reward.

Any of: [Discount Coupons](#discount-coupons), [Gift Vouchers](#gift-vouchers), [Points on loyalty card](#points-on-loyalty-card) | -# Pay with Points +## Pay with Points | Attributes | Description | |:-----|:--------| -| coin |

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

AttributesDescription
exchange_ratio

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

points_ratio

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

| -# Material +| coin
`object` |

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

AttributesDescription
exchange_ratio
integer

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

points_ratio
integer

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

| +## Material | Attributes | Description | |:-----|:--------| -| product |

Contains information about the product given as a reward.

AttributesDescription
id

Unique product ID, assigned by Voucherify.

Example:

prod_0b7d7dfb05cbe5c616

sku_id

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

Example:

sku_0b7d7dfb090be5c619

| -# Discount Coupons +| product
`object` |

Contains information about the product given as a reward.

AttributesDescription
id
string

Unique product ID, assigned by Voucherify.

Example:

prod_0b7d7dfb05cbe5c616

sku_id
string,null

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

Example:

sku_0b7d7dfb090be5c619

| +## Discount Coupons | Attributes | Description | |:-----|:--------| -| id |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_13BbZ0kQsNinhqsX3wUts2UP

| -| type |

Campaign type.

| -# Gift Vouchers +| id
`string` |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_13BbZ0kQsNinhqsX3wUts2UP

| +| type
`string` |

Campaign type.

| +## Gift Vouchers | Attributes | Description | |:-----|:--------| -| id |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_13BbZ0kQsNinhqsX3wUts2UP

| -| balance |

The incremental amout to be added to the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

| -| type |

Campaign type.

| -# Points on loyalty card +| id
`string` |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_13BbZ0kQsNinhqsX3wUts2UP

| +| balance
`integer` |

The incremental amout to be added to the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

| +| type
`string` |

Campaign type.

| +## Points on loyalty card | Attributes | Description | |:-----|:--------| -| id |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_13BbZ0kQsNinhqsX3wUts2UP

| -| balance |

The incremental points to be added to the current balance on the loyalty card.

| -| type |

Campaign type.

| +| id
`string` |

Unique campaign ID, assigned by Voucherify.

**Example:**

camp_13BbZ0kQsNinhqsX3wUts2UP

| +| balance
`integer` |

The incremental points to be added to the current balance on the loyalty card.

| +| type
`string` |

Campaign type.

| [block:html] { diff --git a/docs/reference-docs/SEGMENTS-API-Customer-Segment-Object.md b/docs/reference-docs/SEGMENTS-API-Customer-Segment-Object.md index c4f7340d2..ff18ee0c0 100644 --- a/docs/reference-docs/SEGMENTS-API-Customer-Segment-Object.md +++ b/docs/reference-docs/SEGMENTS-API-Customer-Segment-Object.md @@ -8,16 +8,16 @@ hidden: false order: 1 --- - +## Customer Segment Object | Attributes | Description | |:-----|:--------| -| id |

Unique segment ID.

**Example:**

seg_1wc52c5z6r1kQ81brO8j9Hk2

| -| name |

Segment name.

| -| created_at |

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

**Example:**

2022-05-12T13:01:56.896Z

| -| type |

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

Available values: `auto-update`, `static` | -| filter |

Defines a set of criteria for an auto-update segment type.

| -| initial_sync_status | Available values: `IN_PROGRESS`, `DONE` | -| object |

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

| +| id
`string` |

Unique segment ID.

**Example:**

seg_1wc52c5z6r1kQ81brO8j9Hk2

| +| name
`string` |

Segment name.

| +| created_at
`string` |

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

**Example:**

2022-05-12T13:01:56.896Z

| +| type
`string` |

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

Available values: `auto-update`, `static` | +| filter
`object,null` |

Defines a set of criteria for an auto-update segment type.

| +| initial_sync_status
`string` | Available values: `IN_PROGRESS`, `DONE` | +| object
`string` |

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

| [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 aabb9ba7c..bbd79fbee 100644 --- a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md +++ b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md @@ -8,40 +8,40 @@ hidden: false order: 3 --- - +## Stackable Redemptions Response Body | Attributes | Description | |:-----|:--------| -| redemptions | | -| parent_redemption |

This is an object representing a stacked redemption.

Stacked Redemption

AttributesDescription
id

Unique redemption ID.

Example:

r_0bc92f81a6801f9bca

object

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

date

Timestamp in ISO 8601 format indicating when the redemption occured.

Example:

2022-10-03T12:24:58.008Z

customer_id

Unique customer ID of the redeeming customer.

Example:

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

tracking_id

Hashed customer source ID.

Example:

track_fxEMFiLowFHg==

metadata

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

result

Redemption result.

Available values: SUCCESS, FAILURE
order

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

See: Order
customer

Defines the customer making the stacked redemption.

AttributesDescription
id

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

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name

Customer's first and last name.

email

Customer's email address.

source_id

The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service.

metadata

The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

object

Type of object represented is customer.

related_object_type

Defines the related object.

Available values: redemption
related_object_id

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

voucher
| +| redemptions
`array` | | +| parent_redemption
`object` |

This is an object representing a stacked redemption.

Stacked Redemption

AttributesDescription
id
string

Unique redemption ID.

Example:

r_0bc92f81a6801f9bca

object
string

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

date
string

Timestamp in ISO 8601 format indicating when the redemption occured.

Example:

2022-10-03T12:24:58.008Z

customer_id
string

Unique customer ID of the redeeming customer.

Example:

cust_i8t5Tt6eiKG5K79KQlJ0Vs64

tracking_id
string

Hashed customer source ID.

Example:

track_fxEMFiLowFHg==

metadata
object

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

result
string

Redemption result.

Available values: SUCCESS, FAILURE
order

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

See: Order
customer
object

Defines the customer making the stacked redemption.

AttributesDescription
id
string

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

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

name
string

Customer's first and last name.

email
string

Customer's email address.

source_id
string

The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service.

metadata
object

The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.

object
string

Type of object represented is customer.

related_object_type
string

Defines the related object.

Available values: redemption
related_object_id
string

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

voucher
null
| | order |

Contains the order details associated with the redemption.

See: [Order](#order) | -# Order +## Order | Attributes | Description | |:-----|:--------| -| id |

Unique order ID, assigned by Voucherify.

**Example:**

ord_OLWs41pBk7VFn6ZTyX9U6keh

| -| source_id |

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 |

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

**Example:**

2022-10-06T11:40:48.705Z

| -| updated_at |

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

**Example:**

2022-10-06T11:47:20.760Z

| -| status |

Order status.

Available values: `CREATED`, `PAID`, `CANCELED`, `FULFILLED` | -| amount |

Order amount before applying any discount.

| -| discount_amount |

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

| -| items_discount_amount |

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

| -| total_discount_amount |

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

| -| total_amount |

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

| -| applied_discount_amount |

This field shows the sum of all order-level discounts applied.

| -| items_applied_discount_amount |

Sum of all product-specific discounts applied.
sum(items, i => i.applied_discount_amount)

| -| total_applied_discount_amount |

Sum of all order-level AND all product-specific discounts applied to the order.
total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount

| -| items |

Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.

Array of:
AttributesDescription
object

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

product_id

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

Example:

prod_5h0wc453_1

sku_id

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

Example:

sku_prod_5h0wc453_1_1

quantity

Quantity of the item in the cart.

amount

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

discount_amount

The item-level discount applied to the item.

applied_discount_amount

The item-level discount applied to the item.

price

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

subtotal_amount

Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount

product

This object stores more information about the related product.

AttributesDescription
id

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

Example:

prod_5h0wc453_1

source_id

A unique product identifier from your inventory system.

Example:

illy-arabica

name

Product name.

Example:

Brewing System

price

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

sku

This object stores more information about the related SKU.

AttributesDescription
id

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

Example:

sku_prod_5h0wc453_1_1

source_id

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku

SKU name.

price

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

| -| metadata |

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 containing information about the customer that is making the purchase.

AttributesDescription
id

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object

Type of object represented by the customer object.

| -| referrer |

Object containing information about the referrer.

AttributesDescription
id

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

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object

Type of object represented by the referrer object.

| -| customer_id |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| -| referrer_id |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| -| object |

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

| +| id
`string` |

Unique order ID, assigned by Voucherify.

**Example:**

ord_OLWs41pBk7VFn6ZTyX9U6keh

| +| source_id
`string` |

The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service.

| +| created_at
`string` |

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

**Example:**

2022-10-06T11:40:48.705Z

| +| updated_at
`string` |

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

**Example:**

2022-10-06T11:47:20.760Z

| +| status
`string` |

Order status.

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

Order amount before applying any discount.

| +| discount_amount
`integer` |

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

| +| items_discount_amount
`integer` |

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

| +| total_discount_amount
`integer` |

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

| +| total_amount
`integer` |

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

| +| applied_discount_amount
`integer` |

This field shows the sum of all order-level discounts applied.

| +| items_applied_discount_amount
`integer` |

Sum of all product-specific discounts applied.
sum(items, i => i.applied_discount_amount)

| +| total_applied_discount_amount
`integer` |

Sum of all order-level AND all product-specific discounts applied to the order.
total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount

| +| items
`array` |

Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.

Array of:
AttributesDescription
object
string

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

product_id
string

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

Example:

prod_5h0wc453_1

sku_id
string

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

Example:

sku_prod_5h0wc453_1_1

quantity
integer

Quantity of the item in the cart.

amount
integer

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

discount_amount
integer

The item-level discount applied to the item.

applied_discount_amount
integer

The item-level discount applied to the item.

price
integer

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

subtotal_amount
integer

Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount

product
object

This object stores more information about the related product.

AttributesDescription
id
string

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

Example:

prod_5h0wc453_1

source_id
string

A unique product identifier from your inventory system.

Example:

illy-arabica

name
string

Product name.

Example:

Brewing System

price
integer

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

sku
object

This object stores more information about the related SKU.

AttributesDescription
id
string

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

Example:

sku_prod_5h0wc453_1_1

source_id
string

A unique SKU identifier from your inventory system.

Example:

illy-arabica-250g

sku
string

SKU name.

price
integer

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.

| +| customer
`object` |

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

AttributesDescription
id
string

Unique customer ID of the customer making the purchase.

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the customer object.

| +| referrer
`object` |

Object containing information about the referrer.

AttributesDescription
id
string

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

Example:

cust_7iUa6ICKyU6gH40dBU25kQU1

object
string

Type of object represented by the referrer object.

| +| customer_id
`string` |

Unique customer ID of the customer making the purchase.

**Example:**

cust_7iUa6ICKyU6gH40dBU25kQU1

| +| referrer_id
`string` |

Unique referrer ID.

**Example:**

cust_nM4jqPiaXUvQdVSA6vTRUnix

| +| object
`string` |

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

| | redemptions |

Lists details related to the redemption

See: [Stacked Redemption](#stacked-redemption) | -# Stacked Redemption +## Stacked Redemption | Attributes | Description | |:-----|:--------| -| redemption_ID |

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

AttributesDescription
date

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

Example:

2022-09-02T17:06:56.649Z

related_object_type

The source of the incentive.

related_object_id

Unique ID of the parent redemption.

Example:

r_0ba186c4824e4881e1

stacked

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

| +| redemption_ID
`object` |

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

AttributesDescription
date
string

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

Example:

2022-09-02T17:06:56.649Z

related_object_type
string

The source of the incentive.

related_object_id
string

Unique ID of the parent redemption.

Example:

r_0ba186c4824e4881e1

stacked
array

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

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

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| -| rule_id |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| -| related_object_id |

The resource ID to which the validation rule was assigned.

**Example:**

v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

| -| related_object_type |

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

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

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

**Example:**

2022-02-17T08:18:15.085Z

| -| object |

The type of object represented by the ID.

| +| id
`string` |

Validation rule assignment ID.

**Example:**

asgm_74F7QZoYbUoljwQO

| +| rule_id
`string` |

Validation rule ID.

**Example:**

val_4j7DCRm2IS59

| +| related_object_id
`string` |

The resource ID to which the validation rule was assigned.

**Example:**

v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

| +| related_object_type
`string` |

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

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

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

**Example:**

2022-02-17T08:18:15.085Z

| +| object
`string` |

The type of object represented by the ID.

| [block:html] { diff --git a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Object.md b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Object.md index 0d766978f..703c3ad51 100644 --- a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Object.md +++ b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Object.md @@ -8,19 +8,19 @@ hidden: false order: 1 --- - +## Validation Rule Object | Attributes | Description | |:-----|:--------| -| id |

Unique validation rule ID.

**Example:**

val_eR1c41hu0vUU

| -| name |

Custom, unique name for set of validation rules.

**Example:**

Business Validation Rule

| -| rules |

Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from 1. The values are objects containing the rule conditions.

AttributesDescription
1

Defines the rule.

AttributesDescription
name

Voucherify specific rule name. The list of available names is provided below.

Name

property

Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata

conditions

A set of key value pairs representing the condition name and value. The list of available conditions is provided below:

Condition (key)DefinitionDoes not support Types
$isA property is a predefined value.
$is_notA property is not a predefined value.
$inA property either one value in a predefined list of values.
$less_thanA property is less than a predefined value.boolean
$less_than_or_equalA property is less than or equal to a predefined value.boolean
$more_thanA property is more than a predefined value.boolean
$more_than_or_equalA property is more than or equal to a predefined value.boolean
$starts_withA property starts with the predefined sequence of characters.boolean, number
$ends_withA property ends with the predefined sequence of characters.boolean, number
$containsA property contains the predefined sequence of characters.boolean, number
$timeframeboolean, number
$dowboolean, string
$countboolean, string
$count_moreboolean, string
$count_lessboolean, string
AttributesDescription
$one_of_voucherify_conditions

Contains a set of conditions for the rule.

rules

Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from 1. The values are objects containing the rule conditions.

AttributesDescription
1

Defines the nested rule.

AttributesDescription
name
property
conditions
rules
logic
error

Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.

AttributesDescription
message

The error message returned from API when validation / redemption fails to meet requirements of defined rule.

logic

Defines the logic between the rules.

Example:

(1 and 2) and (3)

| -| error |

Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.

AttributesDescription
message

The error message returned from API when validation / redemption fails to meet requirements of defined rules.

| -| applicable_to |
AttributesDescription
excluded

Defines which items are excluded from a discount.

Array of:
AttributesDescription
object

The type of object being excluded from the rule.

Available values: product, sku, products_collection
id

Unique product ID, SKU ID, product collection ID i.e. prod_0b72b00ffed198e344z, sku_0b7d7dfb090be5c619, pc_4ndRXAsTOzwSdHcQcxf489uU.

source_id
strict
effect

Discount effect for an excluded resource.

Available values: APPLY_TO_EVERY
included

Defines which items are included in a discount.

Array of:
AttributesDescription
object

The type of object being included in the rule.

Available values: product, sku, products_collection
id

Unique product ID, SKU ID, product collection ID i.e. prod_0b72b00ffed198e344z, sku_0b7d7dfb090be5c619, pc_4ndRXAsTOzwSdHcQcxf489uU.

source_id
strict
effect

Discount effect for an included resource.

Available values: APPLY_TO_EVERY, APPLY_TO_CHEAPEST, APPLY_TO_MOST_EXPENSIVE
quantity_limit

A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value.

included_all

Indicates whether all items are included in the discount.

| -| created_at |

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

**Example:**

2022-03-23T07:44:00.444Z

| -| updated_at |

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

**Example:**

2022-04-26T08:35:54.960Z

| -| type |

Type of validation rule.

Available values: `basic`, `advanced`, `complex` | -| context_type |

Validation rule context type.

Context TypeDefinition
earning_rule.order.paid
earning_rule.custom_event
earning_rule.customer.segment.entered
campaign.discount_coupons
campaign.discount_coupons.discount.apply_to_order
campaign.discount_coupons.discount.apply_to_items
campaign.discount_coupons.discount.apply_to_items_proportionally
campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity
campaign.discount_coupons.discount.fixed.apply_to_items
campaign.gift_vouchers
campaign.gift_vouchers.gift.apply_to_order
campaign.gift_vouchers.gift.apply_to_items
campaign.referral_program
campaign.referral_program.discount.apply_to_order
campaign.referral_program.discount.apply_to_items
campaign.referral_program.discount.apply_to_items_proportionally
campaign.referral_program.discount.apply_to_items_proportionally_by_quantity
campaign.referral_program.discount.fixed.apply_to_items
campaign.promotion
campaign.promotion.discount.apply_to_order
campaign.promotion.discount.apply_to_items
campaign.promotion.discount.apply_to_items_proportionally
campaign.promotion.discount.apply_to_items_proportionally_by_quantity
campaign.promotion.discount.fixed.apply_to_items
campaign.loyalty_program
campaign.lucky_draw
voucher.discount_voucher
voucher.discount_voucher.discount.apply_to_order
voucher.discount_voucher.discount.apply_to_items
voucher.discount_voucher.discount.apply_to_items_proportionally
voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity
voucher.discount_voucher.discount.fixed.apply_to_items
voucher.gift_voucher
voucher.gift_voucher.gift.apply_to_order
voucher.gift_voucher.gift.apply_to_items
voucher.loyalty_card
voucher.lucky_draw_code
distribution.custom_event
reward_assignment.pay_with_points
global
Available values: `earning_rule.order.paid`, `earning_rule.custom_event`, `earning_rule.customer.segment.entered`, `campaign.discount_coupons`, `campaign.discount_coupons.discount.apply_to_order`, `campaign.discount_coupons.discount.apply_to_items`, `campaign.discount_coupons.discount.apply_to_items_proportionally`, `campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity`, `campaign.discount_coupons.discount.fixed.apply_to_items`, `campaign.gift_vouchers`, `campaign.gift_vouchers.gift.apply_to_order`, `campaign.gift_vouchers.gift.apply_to_items`, `campaign.referral_program`, `campaign.referral_program.discount.apply_to_order`, `campaign.referral_program.discount.apply_to_items`, `campaign.referral_program.discount.apply_to_items_proportionally`, `campaign.referral_program.discount.apply_to_items_proportionally_by_quantity`, `campaign.referral_program.discount.fixed.apply_to_items`, `campaign.promotion`, `campaign.promotion.discount.apply_to_order`, `campaign.promotion.discount.apply_to_items`, `campaign.promotion.discount.apply_to_items_proportionally`, `campaign.promotion.discount.apply_to_items_proportionally_by_quantity`, `campaign.promotion.discount.fixed.apply_to_items`, `campaign.loyalty_program`, `campaign.lucky_draw`, `voucher.discount_voucher`, `voucher.discount_voucher.discount.apply_to_order`, `voucher.discount_voucher.discount.apply_to_items`, `voucher.discount_voucher.discount.apply_to_items_proportionally`, `voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity`, `voucher.discount_voucher.discount.fixed.apply_to_items`, `voucher.gift_voucher`, `voucher.gift_voucher.gift.apply_to_order`, `voucher.gift_voucher.gift.apply_to_items`, `voucher.loyalty_card`, `voucher.lucky_draw_code`, `distribution.custom_event`, `reward_assignment.pay_with_points`, `global` | -| object |

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

| +| id
`string` |

Unique validation rule ID.

**Example:**

val_eR1c41hu0vUU

| +| name
`string` |

Custom, unique name for set of validation rules.

**Example:**

Business Validation Rule

| +| rules
`object` |

Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from 1. The values are objects containing the rule conditions.

AttributesDescription
1
object

Defines the rule.

AttributesDescription
name
string

Voucherify specific rule name. The list of available names is provided below.

Name

property
string,null

Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata

conditions
object

A set of key value pairs representing the condition name and value. The list of available conditions is provided below:

Condition (key)DefinitionDoes not support Types
$isA property is a predefined value.
$is_notA property is not a predefined value.
$inA property either one value in a predefined list of values.
$less_thanA property is less than a predefined value.boolean
$less_than_or_equalA property is less than or equal to a predefined value.boolean
$more_thanA property is more than a predefined value.boolean
$more_than_or_equalA property is more than or equal to a predefined value.boolean
$starts_withA property starts with the predefined sequence of characters.boolean, number
$ends_withA property ends with the predefined sequence of characters.boolean, number
$containsA property contains the predefined sequence of characters.boolean, number
$timeframeboolean, number
$dowboolean, string
$countboolean, string
$count_moreboolean, string
$count_lessboolean, string
AttributesDescription
$one_of_voucherify_conditions
array

Contains a set of conditions for the rule.

rules
object

Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from 1. The values are objects containing the rule conditions.

AttributesDescription
1
object

Defines the nested rule.

AttributesDescription
name
string
property
string
conditions
object
rules
object
logic
string
error
object

Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.

AttributesDescription
message
string

The error message returned from API when validation / redemption fails to meet requirements of defined rule.

logic
string

Defines the logic between the rules.

Example:

(1 and 2) and (3)

| +| error
`object` |

Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.

AttributesDescription
message
string

The error message returned from API when validation / redemption fails to meet requirements of defined rules.

| +| applicable_to
`object` |
AttributesDescription
excluded
array

Defines which items are excluded from a discount.

Array of:
AttributesDescription
object
string

The type of object being excluded from the rule.

Available values: product, sku, products_collection
id
string

Unique product ID, SKU ID, product collection ID i.e. prod_0b72b00ffed198e344z, sku_0b7d7dfb090be5c619, pc_4ndRXAsTOzwSdHcQcxf489uU.

source_id
string
strict
boolean
effect
string

Discount effect for an excluded resource.

Available values: APPLY_TO_EVERY
included
array

Defines which items are included in a discount.

Array of:
AttributesDescription
object
string

The type of object being included in the rule.

Available values: product, sku, products_collection
id
string

Unique product ID, SKU ID, product collection ID i.e. prod_0b72b00ffed198e344z, sku_0b7d7dfb090be5c619, pc_4ndRXAsTOzwSdHcQcxf489uU.

source_id
string
strict
boolean
effect
string

Discount effect for an included resource.

Available values: APPLY_TO_EVERY, APPLY_TO_CHEAPEST, APPLY_TO_MOST_EXPENSIVE
quantity_limit
integer

A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value.

included_all
boolean

Indicates whether all items are included in the discount.

| +| created_at
`string` |

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

**Example:**

2022-03-23T07:44:00.444Z

| +| updated_at
`string` |

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

**Example:**

2022-04-26T08:35:54.960Z

| +| type
`string` |

Type of validation rule.

Available values: `basic`, `advanced`, `complex` | +| context_type
`string` |

Validation rule context type.

Context TypeDefinition
earning_rule.order.paid
earning_rule.custom_event
earning_rule.customer.segment.entered
campaign.discount_coupons
campaign.discount_coupons.discount.apply_to_order
campaign.discount_coupons.discount.apply_to_items
campaign.discount_coupons.discount.apply_to_items_proportionally
campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity
campaign.discount_coupons.discount.fixed.apply_to_items
campaign.gift_vouchers
campaign.gift_vouchers.gift.apply_to_order
campaign.gift_vouchers.gift.apply_to_items
campaign.referral_program
campaign.referral_program.discount.apply_to_order
campaign.referral_program.discount.apply_to_items
campaign.referral_program.discount.apply_to_items_proportionally
campaign.referral_program.discount.apply_to_items_proportionally_by_quantity
campaign.referral_program.discount.fixed.apply_to_items
campaign.promotion
campaign.promotion.discount.apply_to_order
campaign.promotion.discount.apply_to_items
campaign.promotion.discount.apply_to_items_proportionally
campaign.promotion.discount.apply_to_items_proportionally_by_quantity
campaign.promotion.discount.fixed.apply_to_items
campaign.loyalty_program
campaign.lucky_draw
voucher.discount_voucher
voucher.discount_voucher.discount.apply_to_order
voucher.discount_voucher.discount.apply_to_items
voucher.discount_voucher.discount.apply_to_items_proportionally
voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity
voucher.discount_voucher.discount.fixed.apply_to_items
voucher.gift_voucher
voucher.gift_voucher.gift.apply_to_order
voucher.gift_voucher.gift.apply_to_items
voucher.loyalty_card
voucher.lucky_draw_code
distribution.custom_event
reward_assignment.pay_with_points
global
Available values: `earning_rule.order.paid`, `earning_rule.custom_event`, `earning_rule.customer.segment.entered`, `campaign.discount_coupons`, `campaign.discount_coupons.discount.apply_to_order`, `campaign.discount_coupons.discount.apply_to_items`, `campaign.discount_coupons.discount.apply_to_items_proportionally`, `campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity`, `campaign.discount_coupons.discount.fixed.apply_to_items`, `campaign.gift_vouchers`, `campaign.gift_vouchers.gift.apply_to_order`, `campaign.gift_vouchers.gift.apply_to_items`, `campaign.referral_program`, `campaign.referral_program.discount.apply_to_order`, `campaign.referral_program.discount.apply_to_items`, `campaign.referral_program.discount.apply_to_items_proportionally`, `campaign.referral_program.discount.apply_to_items_proportionally_by_quantity`, `campaign.referral_program.discount.fixed.apply_to_items`, `campaign.promotion`, `campaign.promotion.discount.apply_to_order`, `campaign.promotion.discount.apply_to_items`, `campaign.promotion.discount.apply_to_items_proportionally`, `campaign.promotion.discount.apply_to_items_proportionally_by_quantity`, `campaign.promotion.discount.fixed.apply_to_items`, `campaign.loyalty_program`, `campaign.lucky_draw`, `voucher.discount_voucher`, `voucher.discount_voucher.discount.apply_to_order`, `voucher.discount_voucher.discount.apply_to_items`, `voucher.discount_voucher.discount.apply_to_items_proportionally`, `voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity`, `voucher.discount_voucher.discount.fixed.apply_to_items`, `voucher.gift_voucher`, `voucher.gift_voucher.gift.apply_to_order`, `voucher.gift_voucher.gift.apply_to_items`, `voucher.loyalty_card`, `voucher.lucky_draw_code`, `distribution.custom_event`, `reward_assignment.pay_with_points`, `global` | +| object
`string` |

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

| [block:html] { diff --git a/docs/reference-docs/VOUCHERS-API-Voucher-Object.md b/docs/reference-docs/VOUCHERS-API-Voucher-Object.md index 7d9e7013a..d6165b67d 100644 --- a/docs/reference-docs/VOUCHERS-API-Voucher-Object.md +++ b/docs/reference-docs/VOUCHERS-API-Voucher-Object.md @@ -8,90 +8,90 @@ hidden: false order: 1 --- - +## Voucher Object | Attributes | Description | |:-----|:--------| -| id |

Assigned by the Voucherify API, identifies the voucher.

**Example:**

v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV

| -| code |

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

**Example:**

WVPblOYX

| -| campaign |

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

**Example:**

Gift Card Campaign

| -| campaign_id |

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

**Example:**

camp_FNYR4jhqZBM9xTptxDGgeNBV

| -| category |

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

| -| category_id |

Unique category ID assigned by Voucherify.

**Example:**

cat_0bb343dee3cdb5ec0c

| -| categories |

Contains details about the category.

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

Defines the type of voucher.

Available values: `GIFT_VOUCHER`, `DISCOUNT_VOUCHER`, `LOYALTY_CARD` | +| 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 representing gift parameters. Child attributes are present only if type is GIFT_VOUCHER. Defaults to null.

AttributesDescription
amount

Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

Example:

10000

balance

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

Example:

500

effect

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

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
| -| loyalty_card |

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

AttributesDescription
points

Total points incurred over lifespan of loyalty card.

Example:

7000

balance

Points available for reward redemption.

Example:

6970

next_expiration_date

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

Example:

2023-05-30

next_expiration_points

The amount of points that are set to expire next.

| -| start_date |

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 |

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 |

Set recurrent time periods when the voucher is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
duration

Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.

Example:

PT1H

interval

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.

Example:

P2D

| -| validity_day_of_week |

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

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

A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the start_date and expiration_date.

| -| additional_info |

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

| -| metadata |

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 |

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

AttributesDescription
qr

Stores Quick Response (QR) representation of encrypted code.

AttributesDescription
id

Encrypted voucher code ID.

Example:

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

url

URL to QR code

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

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

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

barcode

Stores barcode representation of encrypted code.

AttributesDescription
id

Encrypted voucher code ID.

Example:

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

url

URL to barcode

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

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

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

| -| is_referral_code |

Flag indicating whether this voucher is a referral code.

| -| created_at |

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

**Example:**

2021-12-22T10:13:06.487Z

| -| updated_at |

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 |

Unique customer ID of voucher owner.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| -| validation_rules_assignments |

Stores information about validation rules assigned to the voucher.

AttributesDescription
object

The type of object represented is by default list.

data_ref

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

data

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

Array of:
AttributesDescription
id

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

Example:

asgm_N7t39epaQR2SkQcW

rule_id

Assigned by the Voucherify API, identifies the validation rule.

Example:

val_ssbxf1L9aKri

related_object_id

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

Example:

camp_AaP9MC1Y0GpBII84UTIuasvb

related_object_type

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

Example:

campaign

created_at

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

Example:

2022-02-14T15:12:06.817Z

object

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

total

Total number of validation rules assigned to the voucher.

| -| redemption |

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

AttributesDescription
quantity

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

redeemed_quantity

How many times a voucher has already been redeemed.

Example:

1

redeemed_amount

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

Example:

100000

redeemed_points

Total loyalty points redeemed.

Example:

100000

object

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

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

Example:

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

| -| publish |

This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event. A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or publish voucher API method.

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

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

Publication events counter.

Example:

0

url

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

Example:

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

| -| object |

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

| -# Category Object +| gift
`object` |

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

AttributesDescription
amount
integer

Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

Example:

10000

balance
integer

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

Example:

500

effect
string

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

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

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

AttributesDescription
points
integer

Total points incurred over lifespan of loyalty card.

Example:

7000

balance
integer

Points available for reward redemption.

Example:

6970

next_expiration_date
string

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

Example:

2023-05-30

next_expiration_points
integer

The amount of points that are set to expire next.

| +| start_date
`string` |

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

**Example:**

2021-12-01T00:00:00.000Z

| +| expiration_date
`string` |

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

**Example:**

2021-12-31T00:00:00.000Z

| +| validity_timeframe
`object` |

Set recurrent time periods when the voucher is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
duration
string

Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.

Example:

PT1H

interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.

Example:

P2D

| +| validity_day_of_week
`array` |

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

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

A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the start_date and expiration_date.

| +| additional_info
`string` |

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

| +| metadata
`object` |

The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

| +| assets
`object` |

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

AttributesDescription
qr
object

Stores Quick Response (QR) representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

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

url
string

URL to QR code

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

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

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

barcode
object

Stores barcode representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

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

url
string

URL to barcode

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

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

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

| +| is_referral_code
`boolean` |

Flag indicating whether this voucher is a referral code.

| +| created_at
`string` |

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

**Example:**

2021-12-22T10:13:06.487Z

| +| updated_at
`string` |

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

**Example:**

2021-12-22T10:14:45.316Z

| +| holder_id
`string` |

Unique customer ID of voucher owner.

**Example:**

cust_eWgXlBBiY6THFRJwX45Iakv4

| +| validation_rules_assignments
`object` |

Stores information about validation rules assigned to the voucher.

AttributesDescription
object
string

The type of object represented is by default list.

data_ref
string

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

data
array

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

Array of:
AttributesDescription
id
string

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

Example:

asgm_N7t39epaQR2SkQcW

rule_id
string

Assigned by the Voucherify API, identifies the validation rule.

Example:

val_ssbxf1L9aKri

related_object_id
string

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

Example:

camp_AaP9MC1Y0GpBII84UTIuasvb

related_object_type
string

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

Example:

campaign

created_at
string

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

Example:

2022-02-14T15:12:06.817Z

object
string

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

total
integer

Total number of validation rules assigned to the voucher.

| +| redemption
`object` |

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

AttributesDescription
quantity
integer

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

redeemed_quantity
integer

How many times a voucher has already been redeemed.

Example:

1

redeemed_amount
integer

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

Example:

100000

redeemed_points
integer

Total loyalty points redeemed.

Example:

100000

object
string

The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.

url
string

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

Example:

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

| +| publish
`object` |

This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event. A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or publish voucher API method.

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

The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.

count
integer

Publication events counter.

Example:

0

url
string

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

Example:

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

| +| object
`string` |

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

| +## Category Object | Attributes | Description | |:-----|:--------| -| id |

Unique category ID assigned by Voucherify.

| -| name |

Category name.

| -| hierarchy |

Category hierarchy.

| -| created_at |

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

**Example:**

2022-07-14T10:45:13.156Z

| -| updated_at |

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

**Example:**

2022-08-16T10:52:08.094Z

| -| object |

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

| -# Amount +| 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 |

Applies an amount discount.

| -| amount_off |

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

**Example:**

100

| -| amount_off_formula |

Formula used to calculate the discount.

| -| aggregated_amount_limit |

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

| -| effect |

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

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

Applies an amount discount.

| +| amount_off
`integer` |

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

**Example:**

100

| +| amount_off_formula
`string` |

Formula used to calculate the discount.

| +| aggregated_amount_limit
`integer` |

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

| +| effect
`string` |

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

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

Applies a percentage discount.

| -| amount_limit |

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 |

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

| -| percent_off |

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

| -| percent_off_formula |

Formula used to calculate the discount.

| -| effect |

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

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

Applies a percentage discount.

| +| amount_limit
`string` |

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

| +| aggregated_amount_limit
`integer` |

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

| +| percent_off
`integer` |

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

| +| percent_off_formula
`string` |

Formula used to calculate the discount.

| +| effect
`string` |

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

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

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

| -| fixed_amount |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| -| fixed_amount_formula |

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

| -| effect |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | -# Unit, single item +| type
`string` |

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

| +| fixed_amount
`integer` |

Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

**Example:**

1000

| +| fixed_amount_formula
`string` |

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

| +| effect
`string` |
EffectDefinition
APPLY_TO_ORDERSets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMSSets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | +## Unit, single item | Attributes | Description | |:-----|:--------| -| type |

Applies a full value discount to item(s).

| -| unit_off |

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

**Example:**

1

| -| unit_off_formula |

Formula used to calculate the number of units.

| -| unit_type |

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

**Example:**

prod_f1r5Tpr0DuC7

| -| effect |

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

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

Applies a full value discount to item(s).

| +| unit_off
`number` |

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

**Example:**

1

| +| unit_off_formula
`string` |

Formula used to calculate the number of units.

| +| unit_type
`string` |

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

**Example:**

prod_f1r5Tpr0DuC7

| +| effect
`string` |

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

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

Applies a full value discount to item(s).

| -| effect |

Defines the effect for adding multiple item types.

| -| units |

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

Array of:
AttributesDescription
unit_off

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

Example:

1

unit_off_formula

Formula used to calculate the number of units.

unit_type

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

Example:

prod_f1r5Tpr0DuC7

effect

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

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

Applies a full value discount to item(s).

| +| effect
`string` |

Defines the effect for adding multiple item types.

| +| units
`array` |

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

Array of:
AttributesDescription
unit_off
integer

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

Example:

1

unit_off_formula
string

Formula used to calculate the number of units.

unit_type
string

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

Example:

prod_f1r5Tpr0DuC7

effect
string

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

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

Applies a full value discount to item(s).

| -| unit_off |

Subtracts 1 shipping item from the subtotal.

| -| unit_type |

The shipping product deemed as free.

| -| effect |

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

| +| type
`string` |

Applies a full value discount to item(s).

| +| unit_off
`number` |

Subtracts 1 shipping item from the subtotal.

| +| unit_type
`string` |

The shipping product deemed as free.

| +| effect
`string` |

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

| [block:html] { diff --git a/scripts/src/schema-to-md-table.ts b/scripts/src/schema-to-md-table.ts index d40ef436a..59cc69e3f 100644 --- a/scripts/src/schema-to-md-table.ts +++ b/scripts/src/schema-to-md-table.ts @@ -250,15 +250,21 @@ export default class SchemaToMarkdownTable { relatedObjectsNames.push(...additionalRelatedObjectsNames); + const propertyLabel = [ + propertyId, + property.type? `\`${property.type}\`` : false + ].filter(e => !!e) + .join('
'); + if (this.examplesRenderedAs == ExamplesRenderedAs.Column) { - return this.getMarkdownTableRow([propertyId, descriptionArr.join(' '), example]); + return this.getMarkdownTableRow([propertyLabel, descriptionArr.join(' '), example]); } else { if (example) { descriptionArr.push('**Example:**') descriptionArr.push(example) } - return this.getMarkdownTableRow([propertyId, descriptionArr.join(' '),]); + return this.getMarkdownTableRow([propertyLabel, descriptionArr.join(' '),]); } }) @@ -279,7 +285,7 @@ export default class SchemaToMarkdownTable { const respopnseStrArr = []; if (title) { - respopnseStrArr.push(`${"#".repeat(level + 1)} ${title}`) + respopnseStrArr.push(`${"#".repeat(level + 2)} ${title}`) } else { if (typeof schemaNameOrSchemaObject === 'string') { throw new Error(`Missing title for ${schemaNameOrSchemaObject} object`) diff --git a/scripts/update-md-tables-in-doc.ts b/scripts/update-md-tables-in-doc.ts index 1b4a94405..311c476e3 100644 --- a/scripts/update-md-tables-in-doc.ts +++ b/scripts/update-md-tables-in-doc.ts @@ -30,8 +30,8 @@ const updateMdTablesInDoc = async () => { const contentAfterTable = fileContentBlocks.slice(contentBlockIndexWithTableToReplace + 1).join('') const newTable = (await fs.readFile(path.join(...PATH_TO_GERENATED_TABLES, `${objectName}.md`))) - .toString() - .replace((/^\# .*$/m), ''); // Remove first header as in readme.io it already exists + .toString(); + // .replace((/^\# .*$/m), ''); // Remove first header as in readme.io it already exists const newFileContent = [ contentBeforeTable,