# Analyze overview
Source: https://docs.voucherify.io/analyze/analyze-overview
Track campaign performance, voucher activity, redemption analytics, and project audit logs
After you build, optimize, and orchestrate campaigns, use the Analyze section to measure how they perform. Track campaign and voucher activity, review redemption analytics, and audit project changes to refine your incentive strategy.
## What you can analyze
Monitor campaign performance, customer activity, and incentive usage with dedicated dashboards for each campaign type.
Inspect individual vouchers, gift cards, and loyalty cards. Review redemption history and transaction details.
Review project-level redemptions, revenue impact, API usage, and team activity in the Dashboard and Settings.
Track API requests, user actions, background tasks, exports, and webhook deliveries across your project.
## Why analysis matters
Campaigns generate data with every validation, redemption, and customer interaction. Turning that data into insight lets you:
* **Measure ROI**: See which campaigns drive revenue, repeat purchases, and customer retention.
* **Spot issues early**: Use logs and activity feeds to debug failed validations, misconfigured rules, or webhook errors.
* **Iterate faster**: Compare performance across segments, channels, and time periods to refine the next iteration.
* **Stay accountable**: Audit logs give you a full history of who changed what and when.
## What's next?
Start with [campaign tracking](/analyze/campaign-tracking) for a high-level view of campaign performance. Use [voucher tracking](/analyze/voucher-tracking) to inspect individual codes, [performance analytics](/analyze/performance-analytics) for project-wide analytics, and [audit log](/analyze/audit-logs) to investigate specific changes or troubleshoot integrations.
# Audit log
Source: https://docs.voucherify.io/analyze/audit-logs
Learn what audit log is, what data it includes, and how to use it in Voucherify
The **Audit log** gives you a full history of activity in your Voucherify project. You can use them to track API requests, user actions, and system processes.
The **Audit log** consists of:
* **Logs**: Lists API requests and responses. Use logs for troubleshooting and debugging.
* **Background tasks**: Lists asynchronous operations. Use this tab to monitor imports and system jobs like campaign or voucher updates.
* **Exports**: Lists exported data files. Use this to download and review data.
* **Webhook sendouts**: Lists webhook deliveries. Use this to track and retry webhook sendouts.
## Logs
Data retention
**Logs** are stored for a limited time:
* Shared regions: 6 months
* Dedicated regions: 12 months
Use **Logs** to troubleshoot API requests, check errors, and inspect request and response data.
Each time a request is sent to Voucherify (in the dashboard, through the API, or from an SDK), a log entry is created.
By default, logs display data from the last 24 hours. You can change the time range using filters. Use other filters to narrow down results.
Click a log ID to open detailed information about the API call, including its request and response in a JSON format.
If a log is related to a CSV import, you can download the original file used in the import.
Export logs
You can export logs based on filters applied in the **Logs** tab.
To export logs:
1. Apply filters to narrow down results.
2. Click **Export**.
3. Download the file when it is ready.
Larger exports may take longer to generate.
Advanced filters (enterprise)
In addition to standard filters, you can narrow down the log results by text contained in the request or response body.
Example: Investigating a failed request
To investigate a failed request:
1. Go to the **Logs** tab.
2. Filter by **Status**: **Failure**.
3. Open the log ID.
4. Review the request and response details.
## Background tasks
Use **Background tasks** to monitor long-running operations such as imports, exports, or campaign updates. Asynchronous actions triggered through the API also appear here. You can see if the task is enqueued, in progress, done, or failed. **Background tasks** are stored indefinitely.
Click a task ID to view detailed information about the operation.
Use filters to narrow down results.
## Exports
Use **Exports** to list, manage, and download exported data files. It shows the history of generated export files.
Click an export ID to view details such as applied filters and parameters.
Use filters to narrow down results.
API log export: Dashboard browser
For API log exports, you can open the file directly in Voucherify without downloading the file.
Click **Browse data** on a ready export to open it in a browser view. This may take a moment to load. The data is displayed for the columns selected during the export.
Use the browser to search across the dataset or open the request and response bodies as JSONs.
Use filters to narrow down results.
Browsing is available only for:
* API log exports.
* Files ready for download.
* Files not older than 90 days.
## Webhook sendouts
Use **Webhook sendouts** to track webhook delivery. You can check if the webhook has been sent successfully, is being retried, or has failed.
Click the three-dot **⋮** menu to:
* See the sent data in the JSON format.
* See error (if any).
* Retry the sendout.
Use filters to narrow down results.
## Related features
Explore other features that complement audit logs when monitoring, debugging, and exporting project activity.
Use webhooks to receive event notifications in your application instead of searching the audit logs. The **Webhook sendouts** tab shows the delivery history of these webhooks.
Learn more about webhooks:
* [Introduction to Voucherify webhooks](/api-reference/introduction-to-webhooks): Overview of project- and distribution-level webhooks.
* [Project settings webhooks](/api-reference/project-settings-webhooks): Configure webhooks for project events such as redemptions, customer changes, or order updates.
* [Distribution webhooks](/api-reference/distribution-webhooks): Configure webhooks for distribution events such as voucher publication and message delivery.
The **Exports** tab lists files generated from the dashboard or through the API. Use the export API to trigger and download exports programmatically.
Learn more about the export API:
* [Export object](/api-reference/exports/export-object): Structure of the export resource.
* [Create export](/api-reference/exports/create-export): Start a new export job.
* [List exports](/api-reference/exports/list-exports): Retrieve all exports in your project.
* [Get export](/api-reference/exports/get-export): Check the status and result of an export.
* [Download export](/api-reference/exports/download-export): Download the generated file.
* [CSV export with API](/guides/csv-export): Guide to exporting vouchers, redemptions, publications, and customers through the API.
The **Background tasks** tab tracks the progress of long-running jobs such as imports and bulk updates.
Learn more about imports:
* [Customer import](/prepare/customers#data-import-and-synchronization)
* [Product import](/prepare/products#bulk-import-with-csv)
* [Discount code import](/build/discount-code-import)
* [Gift card import](/build/gift-card-import)
* [Loyalty card import](/build/loyalty-card-import)
* [Referral code import](/build/referral-code-import)
Use these resources to correlate audit log entries with your integration code:
* [API overview](/guides/api-overview): Authentication, rate limits, and request structure.
* [Management API](/guides/management-api): Manage projects, users, and resources programmatically.
* [Limits](/guides/limits): API rate limits and quotas that may surface as failed requests in the logs.
You can use **Background tasks** in combination with the following async actions endpoints:
* [List async actions](/api-reference/async-actions/list-async-actions)
* [Get async action](/api-reference/async-actions/get-async-action)
Use these endpoints to track the progress and status of all async actions or get details about the result of a specific async action, for example for debugging.
# Campaign tracking
Source: https://docs.voucherify.io/analyze/campaign-tracking
Track campaign performance, customer activity, and incentive usage across Voucherify campaigns
Use Voucherify dashboards and analytics to track campaign performance, customer activity, and incentive usage across all campaign types.
## Track campaign performance
Monitor performance, usage, and configuration details of each campaign with their dedicated dashboards and tabs. The available details depend on the campaign type.
Solving issues with campaigns
The **Activity** tab in campaign details is a great tool for solving issues you have with campaign configuration. The events listed contain all data regarding changes to the campaign as well as the API request and response payloads of those changes.
### Discount coupons
The campaign dashboard provides a high-level overview of coupon campaign performance and configuration.
The campaign dashboard shows:
* **Campaign details**: Overview of the campaign configuration.
* **Distribution overview**: Distributions related to the campaign.
* **Budget management**: Information about orders, values, and applied discounts.
* **Total validations, redemptions, rollbacks, publications** chart.
* **Total vouchers created/deleted** chart.
* **Access settings**: Lists assigned areas and stores (enterprise feature available on demand).
Additional tabs provide detailed insights:
* **Vouchers**: Manage all vouchers in the campaign.
* **Rules**: View and manage validation rules for the campaign.
* **Redemptions**: Track all redemption events with status and details.
* **Publications**: Track voucher publication history and delivery status.
* **Distributions**: Monitor campaign distributions and message delivery.
* **Metadata**: View custom attributes attached to the campaign.
* **Activity**: Track campaign-related events in chronological order (for example, configuration changes).
* **Analytics**: Analyze campaign performance with detailed charts.
### Gift cards
The campaign dashboard provides an overview of gift card campaign setup and usage.
The campaign dashboard shows:
* **Campaign details**: Overview of the campaign configuration.
* **Distribution overview**: Distributions related to the campaign.
* **Budget management**: Information about orders, values, and applied discounts.
* **Total validations, redemptions, rollbacks, publications** chart.
* **Total vouchers created/deleted** chart.
* **Access settings**: Lists assigned areas and stores (enterprise feature available on demand).
Additional tabs provide detailed insights:
* **Vouchers**: Manage all gift card codes and view their details.
* **Rules**: View and manage validation rules for the campaign.
* **Redemptions**: Track all redemption events with status and details.
* **Publications**: Track gift card publication history and delivery status.
* **Distributions**: View distributions related to the campaign.
* **Metadata**: View custom attributes attached to the campaign.
* **Activity**: Track campaign-related events in chronological order.
* **Transactions**: Track all balance changes (top-ups and redemptions) across all gift cards in the campaign. You can export transaction data for external analysis.
* **Analytics**: Analyze campaign performance with detailed charts.
### Loyalty programs
The campaign dashboard provides an overview of loyalty program performance, participation, and configuration.
The campaign dashboard shows:
* **Campaign details**: Overview of the campaign configuration.
* **Publications, messages delivered, redemptions by distributions**: Distribution performance.
* **Campaign point expiration**: Point expiration rules.
* **Total validations, redemptions, rollbacks, publications** chart.
* **Total points**: Aggregated points earned, redeemed, expired, and more.
* **Total vouchers created/deleted** chart.
* **Access settings**: Lists assigned areas and stores (enterprise feature available on demand).
Additional tabs provide detailed insights:
* **Loyalty cards**: Manage all loyalty cards and view balances and details.
* **Tiers**: View the setup of your program levels.
* **Earning rules**: View and manage earning rules.
* **Rewards catalog**: View available rewards and their point costs.
* **Participants**: View all customers with assigned loyalty cards.
* **Metadata**: View custom attributes attached to the campaign.
* **Reward redemptions**: Track points-for-rewards exchanges.
* **Distributions**: View distributions related to the campaign.
* **Activity**: Track campaign-related configuration events (for example, changes to rules or rewards).
* **Points expiration**: View upcoming point expirations and export the data as CSV.
* **Pending points**: Manage points that are not yet redeemable.
* **Transactions**: Track all point balance changes. You can export transaction data for external analysis.
* **Analytics**: Analyze campaign performance with detailed charts.
### Referral programs
The campaign dashboard provides an overview of referral performance, participants, and reward distribution.
The campaign dashboard shows:
* **Referral codes**: Number of created referral codes and general program details.
* **Publications, messages delivered, redemptions by distributions**: Distribution performance.
* **Conversion event**: The conversion event used in the campaign.
* **Program in numbers**: Overview of referrals and participants.
* **Total referred**: Total customers invited through the program, including a time-based chart.
* **Referrers rewards summary**: Overview of rewards granted to referrers.
* **Top 5 referrers**: Most successful advocates.
* **Access settings**: Lists assigned areas and stores (enterprise feature available on demand).
Additional tabs provide detailed insights:
* **Rewards**: View the referral workflow and reward tiers.
* **Referral codes**: Manage all referral codes and view their details.
* **Rules**: View and manage validation and eligibility rules.
* **Redemptions**: Track all redemption events with status and details.
* **Referrers**: View all program participants and their codes.
* **Referees**: View invited customers and their activity.
* **Distributions**: View distributions related to the campaign.
* **Reward redemptions**: Track referral reward redemptions by status.
* **Metadata**: View custom attributes attached to the campaign.
* **Activity**: Track campaign-related events in chronological order.
### Promotion campaigns
The promotion campaign dashboard gives you a compact overview of the campaign setup, promotion tiers, and redemption activity.
The campaign dashboard shows:
* **Campaign details**: Basic campaign information, such as the assigned category.
* **Access settings**: Assigned areas and stores, or a notice if the campaign is not assigned to any.
* **Redemption values**: A summary of promotion tiers with their order discount amounts and application scope.
* **Total validations, redemptions, rollbacks** chart: Campaign activity over time.
Additional tabs provide detailed insights:
* **Tiers**: View and manage all promotion tiers in the campaign.
* **Redemptions**: Track all redemption events with status and details.
* **Metadata**: View custom attributes attached to the campaign.
* **Activity**: Track campaign-related events in chronological order.
* **Analytics**: Analyze campaign performance with detailed charts.
## Track customer activity in campaigns
You can track individual customer activity across campaigns to troubleshoot issues or analyze behavior.
1. In **Engagement** in the left panel, go **Customers** and click on a given customer to open their profile.
2. Open the **Activity** tab.
3. **Add filter** to select a specific campaign or view activities from all campaigns.
4. Optionally, filter by **Occurrence date** to define a time range.
## Use Campaign calendar
The **Campaign calendar** provides a timeline view of all your campaigns.
Go to **Marketer Hub** > **Campaign calendar** to see:
* Active and scheduled campaigns
* Campaign start and end dates
* Campaign details when you select a campaign bar
The Campaign calendar shows campaigns after you save them or save them as drafts.
## Related features
Get better results when tracking your campaigns with the following ideas.
You can use [Get campaign summary](/api-reference/campaigns/get-campaign-summary) API endpoint to return campaign performance data for analytics. The data covers publications, validations, redemptions, and other data that's specific to a given campaign type.
You can programmatically manage transactions for loyalty and gift card campaigns with the following endpoints:
* [List campaign transactions](/api-reference/campaigns/list-campaign-transactions)
* [Export campaign transactions](/api-reference/campaigns/export-campaign-transactions)
You can track campaign behavior programmatically with webhooks configured in **Project settings**. When you set up project-level webhooks, Voucherify sends automatic notifications to your endpoint whenever campaign events occur.
Campaign-related webhook events you can subscribe to:
* [Campaign created](/api-reference/campaign/created)
* [Campaign updated](/api-reference/campaign/updated)
* [Campaign enabled](/api-reference/campaign/enabled)
* [Campaign disabled](/api-reference/campaign/disabled)
* [Campaign deleted](/api-reference/campaign/deleted)
* [Campaign voucher generation completed](/api-reference/campaign/vouchers-generation-completed)
You can also track promotion tier changes within campaigns:
* [Promotion tier created](/api-reference/campaign/promotion-tier-created)
* [Promotion tier updated](/api-reference/campaign/promotion-tier-updated)
* [Promotion tier enabled](/api-reference/campaign/promotion-tier-enabled)
* [Promotion tier disabled](/api-reference/campaign/promotion-tier-disabled)
* [Promotion tier deleted](/api-reference/campaign/promotion-tier-deleted)
To configure webhooks, go to **Project settings** > **Webhooks** and select the events you want to receive. See [Project settings webhooks](/api-reference/project-settings-webhooks) for setup instructions and [Introduction to webhooks](/api-reference/introduction-to-webhooks) for authentication and payload details.
# Performance analytics
Source: https://docs.voucherify.io/analyze/performance-analytics
Learn what analytics data Voucherify displays in the Dashboard, Team Settings, and Project Settings
Voucherify provides analytics tools that help you monitor promotional performance and system usage.
You can review data in three main places:
* **Dashboard**: Project-level overview of redemptions, API calls, and campaign performance for marketers.
* **Project Settings**: Project-specific usage analytics for project admins.
* **Team Settings**: Organization-level usage analytics for account owners.
## Dashboard overview
The home **Dashboard** shows a summary of activity in your project. You can select a time window in the top right corner.
### Key metrics
At the top of the dashboard, there are indicators that help you understand promotional activity and overall platform usage:
* **Total redemptions**: The total number of successful voucher and promotion redemptions in the selected period.
* **Revenue impact**: The total discount value applied to orders.
* **Active campaigns**: The number of campaigns that are currently running.
* **Daily API calls**: The total number of API requests in the selected period.
### Redemption trends
The **Redemption trends** chart shows how successful and failed redemptions change over time. This allows you to compare success and failure rates during the selected timeframe.
Use this data to monitor campaign health, promotion tactics, and weak points in the customer journey.
### Top campaigns
The Top campaigns table shows campaigns with the highest number of redemptions.
The table includes:
* Campaign name
* Number of redemptions
* Success rate
* Trend indicator
The trend indicator compares this period with the previous one to display the performance direction.
### Insights and alerts
The **Insights & alerts** section displays important notifications related to your campaigns, for example, a campaign is about to expire.
Each alert includes basic information and a direct action button, such as reviewing or extending a campaign.
## Project settings
Required permissions
By default, the account owner can access Project Settings. Users with proper access granted by the owner, such as users assigned the default Admin role, can also view and manage Project Settings.
**Project settings** provide analytics for the current project environment.
In the **API usage** tab, you can monitor:
* API calls per hour in the current project
* API calls during the subscription cycle
* Integration webhook calls per day
* Messages per day
* Messages per month
Some charts may show organization-level limits when those limits also apply to the project.
## Team settings
Required permissions
Only the account owner can view and manage **Team settings**.
The **Subscription** tab in **Team settings** provides organization-level analytics across all projects in your account. This way you can track API call, message, and webhook usage.
Go to **Team settings** > **Subscription** to view the following usage data:
* **Management API calls per hour**: Monitor the frequency of management API requests across the entire account.
Enterprise feature
The Management API is an enterprise feature. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager to enable this functionality.
* **API calls per hour in a project**: Track API traffic for specific projects. This chart displays the activity relative to the API limit defined in your current plan.
* **API calls per subscription cycle**: View the total number of API calls used during the current billing period to ensure your account remains within plan limits.
* **Integration webhook calls per day**: Analyze the volume of webhook traffic generated by external integrations connected to your Voucherify account.
* **Messages per day and per month**: Monitor the total volume of distribution messages sent across all projects to track communication outreach.
# Voucher tracking
Source: https://docs.voucherify.io/analyze/voucher-tracking
Track voucher activity and transactions for gift and loyalty cards
Open a voucher's detail view to see how it's used and managed."
The detailed view of a voucher shows its:
* Details, like its parent campaign, voucher owner, and info specific to the voucher type.
* Voucherify ID.
* Barcode and QR code.
* Redemption overview.
From the detailed view, you can go to other tabs to track voucher usage, check any failures, and use the data to debug errors.
## Find vouchers
Use the **Vouchers** view to browse and search all voucher types in one place.
Go to **Campaign Hub** > **Campaigns** > **Vouchers** to see all your codes, including:
* Discount coupons
* Gift cards
* Referral codes
* Loyalty cards
Use filters to narrow down the list of vouchers based on selected criteria.
You can also use **Search codes** on the left bar to find a voucher by its code.
### Use categories
Use **Categories** to organize vouchers and filter them faster.
You can create a category when you create a campaign or add it later in the voucher details. To manage categories, go to **Campaigns** > **Categories**.
Categories can also have a hierarchy. The lower the number, the higher the category priority in stacking rules.
## Redemptions and validations
The **Redemptions** and **Validations** tabs list successful and unsuccessful redemption and validation attempts.
**Add filter** to narrow down results.
Click on ID to learn more about the event, access its log, and request and response payloads.
You can also export redemption data to a CSV file.
Validation data is stored for 30 days.
**Logs** are stored for a limited time:
* Shared regions: 6 months
* Dedicated regions: 12 months
## Voucher activity
The **Activity** tab lists all events related to the voucher, like creation, updates, or deactivation.
**Add filter** to narrow down results.
Click **Log** to learn more about the event, see related events, and request and response payloads.
Solving issues with vouchers
The **Activity** tab in voucher details is a great tool for solving issues you have with voucher configuration, validation, and redemption. The events listed contain all data regarding changes to the campaign as well as the API request and response payloads of those changes.
## Track gift and loyalty card transactions
In the detailed view of a gift or loyalty card, use the **Transactions** tab to monitor balance changes.
The **Transactions** tab lists:
* Transaction type: For example, point or credit redemption.
* Balance: Current number of points or credits
* Creation date: When the transaction occurred.
* Transaction details (**+** button), which show the transaction in a JSON format.
## Export for data tracking
Use exports to download voucher and transaction data for reporting.
The export tool looks similar for all exports.
Choose which standard fields and custom attributes (metadata) to include in the exported CSV.
The date and times of the exported data are in the UTC time zone.
Once ready, **Export** your list. The file will be generated and delivered to your **Notifications Center**.
You can also find all your exported files in **Audit log** > **Exports**.
Larger exports may take longer to generate.
### Export vouchers
Export voucher data to review or analyze voucher usage.
To export all or filtered vouchers:
1. Go to **Vouchers**.
2. Apply filters (optional).
3. Click **Manage filtered vouchers**.
4. Click **Export filtered vouchers**.
You can also export vouchers by going to a campaign and clicking the three-dot **⋮** menu > **Export to CSV**. This exports all vouchers, even if filters are applied.
### Export transactions
Export transactions directly from the **Transactions** tab.
Click **Export**, then choose which fields to include in the CSV file.
You can export the following fields for gift card transactions:
* ID: Unique Voucherify transaction ID.
* Type: Type of the transaction, for example `CREDITS_ADDITION`.
* Source ID: Optional source ID of the transaction.
* Reason: Optional reason added to the transaction.
* Balance: The number of available credits after the transaction.
* Amount: The number of credits added or subtracted in the transaction.
* Creation date: The date and time when the transaction was created (in UTC time zone).
* Voucher ID: Unique Voucherify ID of the gift card.
* Campaign ID: Unique Voucherify ID of the parent campaign.
* Source: The origin of the transaction, for example Voucherify web UI.
* Details: JSON payload of the transaction details.
You can export the following fields for loyalty card transactions:
* ID: Unique Voucherify transaction ID.
* Type: Type of the transaction, for example `POINTS_ACCRUAL`.
* Source ID: Optional source ID of the transaction.
* Reason: Optional reason added to the transaction.
* Balance: The number of available points after the transaction.
* Amount: The number of points added or subtracted in the transaction.
* Creation date: The date and time when the transaction was created (in UTC time zone).
* Voucher ID: Unique Voucherify ID of the loyalty card.
* Campaign ID: Unique Voucherify ID of the parent campaign.
* Source: The origin of the transaction, for example Voucherify web UI.
* Details: JSON payload of the transaction details.
* Related transaction ID: Unique Voucherify transaction ID related to a receiver/donor card when points were transferred from/to another card.
### Export redemptions
You can export redemptions from the main **Redemptions** tab or from a selected campaign.
Use filters to narrow down the results.
To export redemptions for a specific voucher or vouchers, use the **Voucher code** filter.
## Related features
Learn more about features related to voucher tracking.
For campaign performance and analytics, see [Campaign tracking](/analyze/campaign-tracking).
Categories can be used to organize vouchers and campaigns, but they are primarily used for stacking rules.
Stacking rules define how incentives like vouchers behave when they're redeemed together. Stacking rules can influence the order of application, which incentives can be used exclusively, how discounts are calculated together, and many other details.
Learn more about [stacking rules and categories](/orchestrate/stacking-rules-overview).
Track voucher activity programmatically with the Voucherify API. Use these endpoints to inspect redemptions, validations, gift card and loyalty card transactions.
Redemptions:
* [List redemptions](/api-reference/redemptions/list-redemptions): List all redemptions across the project, with filters for voucher, customer, campaign, result, and date range.
* [Get voucher's redemptions](/api-reference/redemptions/get-vouchers-redemptions): List redemptions for a specific voucher code.
* [Redemption object](/api-reference/redemptions/redemption-object): Schema reference for redemption payloads.
* [Rollback redemption](/api-reference/redemptions/rollback-redemption) / [Rollback stackable redemptions](/api-reference/redemptions/rollback-stackable-redemptions): Reverse a redemption.
Gift card and loyalty card transactions:
* [List voucher transactions](/api-reference/vouchers/list-voucher-transactions): List credit or point transactions for a single voucher.
* [Export voucher transactions](/api-reference/vouchers/export-voucher-transactions): Trigger a CSV export of transactions for a voucher.
* [List campaign transactions](/api-reference/campaigns/list-campaign-transactions) / [Export campaign transactions](/api-reference/campaigns/export-campaign-transactions): Transactions across all vouchers in a campaign.
Exports:
* Use the [Exports API](/api-reference/exports/create-export) to generate CSV exports of vouchers, redemptions, and transactions.
You can also subscribe to voucher events with webhooks (for example, `voucher.redeemed`, `voucher.updated`, `voucher.disabled`) to receive activity in real time. See:
* [Introduction to webhooks](/api-reference/introduction-to-webhooks)
* [Project settings webhooks](/api-reference/project-settings-webhooks)
* [Distribution webhooks](/api-reference/distribution-webhooks)
Learn more about the following voucher events:
* [Voucher created](/api-reference/voucher/created)
* [Voucher disabled](/api-reference/voucher/disabled)
* [Voucher enabled](/api-reference/voucher/enabled)
* [Voucher updated](/api-reference/voucher/updated)
* [Voucher published](/api-reference/voucher/published)
* [Voucher loyalty card pending points activated](/api-reference/voucher/loyalty-card-pending-points-activated)
* [Voucher loyalty card pending points added](/api-reference/voucher/loyalty-card-pending-points-added)
* [Voucher loyalty card pending points canceled](/api-reference/voucher/loyalty-card-pending-points-canceled)
* [Voucher loyalty card pending points updated](/api-reference/voucher/loyalty-card-pending-points-updated)
* [Voucher loyalty card points added](/api-reference/voucher/loyalty-card-points-added)
* [Voucher loyalty card points expired](/api-reference/voucher/loyalty-card-points-expired)
* [Voucher loyalty card transaction created](/api-reference/voucher/loyalty-card-transaction-created)
* [Voucher gift transaction created](/api-reference/voucher/gift-transaction-created)
* [Voucher gift balance added](/api-reference/voucher/gift-balance-added)
* [Voucher deleted](/api-reference/voucher/deleted)
# Async Action Object
Source: https://docs.voucherify.io/api-reference/async-actions/async-action-object
Async Action
This is an object representing an asynchronous action.
All of:
-
Async Action Base
-
Async Action Base
| Attributes |
Description |
|
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 the async action. Informs you whether the async action has already been completed.
Available values:
DONE,
ENQUEUED,
FAILED,
IN\_PROGRESS
|
|
operation\_status
string
|
Status of async action processing. Informs about the async action status, whether it failed, succeeded, or the status is unknown.
Available values:
FAILED,
SUCCESS,
UNKNOWN
|
|
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. The value is shown in the 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 the object represented by JSON. This object stores information about the
async\_action.
Available values:
async\_action
|
CAMPAIGN.VOUCHERS\_IMPORT
| Attributes |
Description |
|
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:
| Attributes |
Description |
|
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
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:
| Attributes |
Description |
|
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
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
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
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
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
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:
| Attributes |
Description |
|
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
All of:
-
Async Action Voucher Customer Product Bulk Update Result
-
| Attributes |
Description |
|
errors
array
|
List of errors encountered during processing.
Array of:
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
source\_id
string
|
Source identifier of the customer for which the error occurred.
|
|
CUSTOMERS.METADATA\_UPDATE
| Attributes |
Description |
|
errors
array
|
List of errors encountered during processing.
Array of:
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
CUSTOMERS.METADATA\_KEY\_PURGE
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description about the result.
|
|
done\_count
integer
|
Number of resources processed successfully.
|
PRODUCTS.BULK\_UPDATE
All of:
-
Async Action Voucher Customer Product Bulk Update Result
-
| Attributes |
Description |
|
errors
array
|
List of errors encountered during processing.
Array of:
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
source\_id
string
|
Source identifier of the product for which the error occurred.
|
|
PRODUCTS.METADATA\_UPDATE
| Attributes |
Description |
|
errors
array
|
List of errors encountered during processing.
Array of:
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
PRODUCTS.IMPORT\_CSV
| Attributes |
Description |
|
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:
| Attributes |
Description |
|
row
integer
|
The CSV file row number where the product definition is recorded. The row counter excludes the file headers row.
|
|
source\_id
string
|
The source identifier of the product that caused the error.
|
|
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
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:
| Attributes |
Description |
|
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
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
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.
| Attributes |
Description |
|
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
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:
| Attributes |
Description |
|
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
All of:
-
Async Action Voucher Customer Product Bulk Update Result
-
| Attributes |
Description |
|
errors
array
|
List of errors encountered during processing.
Array of:
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
code
string
|
Code of the voucher for which the error occurred.
|
|
VOUCHERS.METADATA\_UPDATE
| Attributes |
Description |
|
errors
array
|
List of errors encountered during processing.
Array of:
| Attributes |
Description |
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
VOUCHERS.METADATA\_KEY\_PURGE
| Attributes |
Description |
|
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
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.
| Attributes |
Description |
|
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
string
|
A human-readable message providing a short description about the result.
|
|
done\_count
integer
|
Number of resources processed successfully.
|
Async Action Voucher Customer Product Bulk Update Result
| Attributes |
Description |
|
done\_count
integer
|
Number of items successfully processed.
|
|
failed\_count
integer
|
Number of items that failed to be processed.
|
|
reports
array
|
List of URLs to report files.
|
|
reports\_available\_till
string
|
Timestamp until the reports are available.
|
# Get Async Action
Source: https://docs.voucherify.io/api-reference/async-actions/get-async-action
/openapi/async-actions.json get /v1/async-actions/{asyncActionId}
Check the result of a scheduled asynchronous operation.
The table below lists the possible types of async actions. The types are different for each endpoint generating the async action.
| **Types by Context** | **Endpoint** |
|:---|:---|
| **CAMPAIGN** | |
| CAMPAIGN.VOUCHERS_IMPORT | **POST** [`/campaigns/{campaignId}/import`](/api-reference/campaigns/import-vouchers-to-campaign) |
| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [`/campaigns/{campaignId}/importCSV`](/api-reference/campaigns/import-vouchers-to-campaign-by-csv) |
| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [`/campaigns/{campaignId}`](/api-reference/campaigns/update-campaign) |
| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [`/campaigns/{campaignId}`](/api-reference/campaigns/delete-campaign) |
| CAMPAIGN.VOUCHERS_GENERATE | - **POST** [`/campaigns`](/api-reference/campaigns/create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
- **POST** [`/campaigns/{campaignId}/vouchers`](/api-reference/campaigns/add-vouchers-to-campaign)
|
| **CUSTOMERS** | |
| CUSTOMERS.IMPORT_CSV | **POST** [`/customers/importCSV`](/api-reference/customers/import-and-update-customers-using-csv) |
| CUSTOMERS.BULK_UPDATE | **POST** [`/customers/bulk/async`](/api-reference/customers/update-customers-in-bulk) |
| CUSTOMERS.METADATA_UPDATE | **POST** [`/customers/metadata/async`](/api-reference/customers/update-customers-metadata-in-bulk) |
| **PRODUCTS** | |
| PRODUCTS.BULK_UPDATE | **POST** [`/products/bulk/async`](/api-reference/products/update-products-in-bulk)
|
| PRODUCTS.METADATA_UPDATE | **POST** [`/products/metadata/async`](/api-reference/products/update-products-metadata-in-bulk) |
| PRODUCTS.IMPORT_CSV | **POST** [`/products/importCSV`](/api-reference/products/import-products-using-csv) |
| SKUS.IMPORT_CSV | **POST** [`/skus/importCSV`](/api-reference/products/import-skus-using-csv) |
| **VOUCHERS** | |
| VOUCHERS.IMPORT | **POST** [`/vouchers/import`](/api-reference/vouchers/import-vouchers) |
| VOUCHERS.IMPORT_CSV | **POST** [`/vouchers/importCSV`](/api-reference/vouchers/import-vouchers-using-csv) |
| VOUCHERS.BULK_UPDATE | **POST** [`/vouchers/bulk/async`](/api-reference/vouchers/update-vouchers-in-bulk)
|
| VOUCHERS.METADATA_UPDATE | **POST** [`/vouchers/metadata/async`](/api-reference/vouchers/update-vouchers-metadata-in-bulk) |
| **ORDERS** | |
| ORDERS.IMPORT | **POST** [`/orders/import`](/api-reference/orders/import-orders) |
| **METADATA KEY PURGE** | |
| CAMPAIGNS.METADATA_KEY_PURGE
CUSTOMERS.METADATA_KEY_PURGE
PRODUCTS.METADATA_KEY_PURGE
VOUCHERS.METADATA_KEY_PURGE
ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](/prepare/metadata#maintenance) |
# List Async Actions
Source: https://docs.voucherify.io/api-reference/async-actions/list-async-actions
/openapi/async-actions.json get /v1/async-actions
Track asynchronous operations scheduled in your project.
The table below lists the possible types of async actions. The types are different for each endpoint generating the async action.
| **Types by Context** | **Endpoint** |
|:---|:---|
| **CAMPAIGN** | |
| CAMPAIGN.VOUCHERS_IMPORT | **POST** [`/campaigns/{campaignId}/import`](/api-reference/campaigns/import-vouchers-to-campaign) |
| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [`/campaigns/{campaignId}/importCSV`](/api-reference/campaigns/import-vouchers-to-campaign-by-csv) |
| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [`/campaigns/{campaignId}`](/api-reference/campaigns/update-campaign) |
| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [`/campaigns/{campaignId}`](/api-reference/campaigns/delete-campaign) |
| CAMPAIGN.VOUCHERS_GENERATE | - **POST** [`/campaigns`](/api-reference/campaigns/create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
- **POST** [`/campaigns/{campaignId}/vouchers`](/api-reference/campaigns/add-vouchers-to-campaign)
|
| **CUSTOMERS** | |
| CUSTOMERS.IMPORT_CSV | **POST** [`/customers/importCSV`](/api-reference/customers/import-and-update-customers-using-csv) |
| CUSTOMERS.BULK_UPDATE | **POST** [`/customers/bulk/async`](/api-reference/customers/update-customers-in-bulk) |
| CUSTOMERS.METADATA_UPDATE | **POST** [`/customers/metadata/async`](/api-reference/customers/update-customers-metadata-in-bulk) |
| **PRODUCTS** | |
| PRODUCTS.BULK_UPDATE | **POST** [`/products/bulk/async`](/api-reference/products/update-products-in-bulk)
|
| PRODUCTS.METADATA_UPDATE | **POST** [`/products/metadata/async`](/api-reference/products/update-products-metadata-in-bulk) |
| PRODUCTS.IMPORT_CSV | **POST** [`/products/importCSV`](/api-reference/products/import-products-using-csv) |
| SKUS.IMPORT_CSV | **POST** [`/skus/importCSV`](/api-reference/products/import-skus-using-csv) |
| **VOUCHERS** | |
| VOUCHERS.IMPORT | **POST** [`/vouchers/import`](/api-reference/vouchers/import-vouchers) |
| VOUCHERS.IMPORT_CSV | **POST** [`/vouchers/importCSV`](/api-reference/vouchers/import-vouchers-using-csv) |
| VOUCHERS.BULK_UPDATE | **POST** [`/vouchers/bulk/async`](/api-reference/vouchers/update-vouchers-in-bulk)
|
| VOUCHERS.METADATA_UPDATE | **POST** [`/vouchers/metadata/async`](/api-reference/vouchers/update-vouchers-metadata-in-bulk) |
| **ORDERS** | |
| ORDERS.IMPORT | **POST** [`/orders/import`](/api-reference/orders/import-orders) |
| **METADATA KEY PURGE** | |
| CAMPAIGNS.METADATA_KEY_PURGE
CUSTOMERS.METADATA_KEY_PURGE
PRODUCTS.METADATA_KEY_PURGE
VOUCHERS.METADATA_KEY_PURGE
ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](/prepare/metadata#maintenance) |
# Activate benefit
Source: https://docs.voucherify.io/api-reference/benefits/activate-benefit
/openapi/loyalties-v2.json post /v2/loyalties/benefits/{benefitId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves a benefit from `DRAFT` to `ACTIVE` status. No request body. Only the
`DRAFT` -> `ACTIVE` transition is allowed; activating from any other state returns
400 `invalid_state_transition`. A points-based benefit cannot be activated when its
connected card definition does not exist or is not ACTIVE (423 `resource_locked`).
# Create benefit
Source: https://docs.voucherify.io/api-reference/benefits/create-benefit
/openapi/loyalties-v2.json post /v2/loyalties/benefits
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a new benefit. Exactly one type-specific configuration object (`points`,
`points_proportional`, `material`, or `digital`) is required, matching the `type`.
When `status` is omitted the benefit is created in `DRAFT` status. When `stock` is
omitted it defaults to `{ "type": "UNLIMITED" }`.
Referenced resources are validated: the card definition (for points-based types) must
exist and - when creating with `status: ACTIVE` - must be ACTIVE (423 `resource_locked`
otherwise); the product/SKU (for `MATERIAL`) and campaign (for `DIGITAL`) must exist,
and the campaign type must match the digital benefit type (`DISCOUNT_COUPONS` or
`GIFT_VOUCHERS`). The benefit name must be unique per project (409 `duplicate_found`).
# Delete benefit
Source: https://docs.voucherify.io/api-reference/benefits/delete-benefit
/openapi/loyalties-v2.json delete /v2/loyalties/benefits/{benefitId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Soft-deletes a benefit and returns the deleted benefit. A benefit that is used by any
earning rule cannot be deleted (400 `resource_in_use`, with `related_object_ids` and
`related_object_type: earning_rule` in the error body).
# Get benefit
Source: https://docs.voucherify.io/api-reference/benefits/get-benefit
/openapi/loyalties-v2.json get /v2/loyalties/benefits/{benefitId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single benefit by its ID.
# List benefit activities
Source: https://docs.voucherify.io/api-reference/benefits/list-benefit-activities
/openapi/loyalties-v2.json get /v2/loyalties/benefits/{benefitId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for the benefit (created, updated,
deleted, activated, drafted). Returns `404` when the benefit does not exist. Supports
filtering by activity `id`, `type`, and `created_at`, ordering by `created_at`
(default `-created_at`), and cursor-based pagination.
# List benefits
Source: https://docs.voucherify.io/api-reference/benefits/list-benefits
/openapi/loyalties-v2.json get /v2/loyalties/benefits
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of benefits. Supports filtering by `id`, `name`, `status`,
`type`, and `created_at`, ordering by `created_at`, `name`, and `type` (prefix with `-` for
descending), and cursor-based pagination. Deleted benefits are excluded.
Multiple filters are combined with the `junction` (`AND` by default).
The same field cannot be ordered both ascending and descending at the same time.
# Move benefit to draft
Source: https://docs.voucherify.io/api-reference/benefits/move-benefit-to-draft
/openapi/loyalties-v2.json post /v2/loyalties/benefits/{benefitId}/draft
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves a benefit from `ACTIVE` back to `DRAFT` status. No request body. Only the
`ACTIVE` -> `DRAFT` transition is allowed; drafting from any other state returns
400 `invalid_state_transition`. A benefit assigned to an active earning rule cannot
be moved to draft (423 `resource_locked`, key `connected_active_earning_rule`).
# Update benefit
Source: https://docs.voucherify.io/api-reference/benefits/update-benefit
/openapi/loyalties-v2.json put /v2/loyalties/benefits/{benefitId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates a benefit. When the benefit is in `DRAFT` status all properties can be updated.
When the benefit is `ACTIVE`, only `name` and `stock` may be updated (400 `invalid_payload`
otherwise). Referenced resources (card definition, product/SKU, campaign) are validated
the same way as on create; a points-based benefit can only reference an ACTIVE card
definition (423 `resource_locked` otherwise). The benefit name must remain unique per
project (409 `duplicate_found`).
# Delete Bin Entry
Source: https://docs.voucherify.io/api-reference/bin/delete-bin-entry
/openapi/bin.json delete /v1/trash-bin/{binEntryId}
Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted:
- campaigns
- vouchers
- products
- SKUs
To use this endpoint and delete a given resource type, you must have the following permissions:
- `vouchers.delete` to delete a voucher,
- `campaigns.delete` to delete a campaign,
- `products.delete` to delete a product or SKU.
# List Bin Entries
Source: https://docs.voucherify.io/api-reference/bin/list-bin-entries
/openapi/bin.json get /v1/trash-bin
Retrieves a list of resources moved to the bin. The following resources can be moved to the bin:
- campaigns
- vouchers
- products
- SKUs
To use this endpoint, you must have the following permissions:
- `vouchers.read`
- `campaigns.read`
- `products.read`
# Created
Source: https://docs.voucherify.io/api-reference/campaign/created
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.CREATED
The `EVENTS.CAMPAIGN.CREATED` event indicates that a new campaign was created.
The webhook provides, among others, the following details:
* Campaign ID,
* Campaign name
* Campaign type,
* Creation date,
* Other relevant details.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Deleted
Source: https://docs.voucherify.io/api-reference/campaign/deleted
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.DELETED
The `EVENTS.CAMPAIGN.DELETED` event indicates that a specific campaign was removed. This serves as a real-time notification about this event.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Disabled
Source: https://docs.voucherify.io/api-reference/campaign/disabled
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.DISABLED
The `EVENTS.CAMPAIGN.DISABLED` event indicates that the campaign is temporarily or permanently inactive. It cannot be utilized during that period.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Enabled
Source: https://docs.voucherify.io/api-reference/campaign/enabled
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.ENABLED
The `EVENTS.CAMPAIGN.ENABLED` event indicates that the campaign is now active and can be utilized for its intended purpose.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Created
Source: https://docs.voucherify.io/api-reference/campaign/loyalty-tier-created
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.LOYALTY_TIER.CREATED
The `EVENTS.CAMPAIGN.LOYALTY_TIER.CREATED` event indicates that a specific campaign loyalty tier was created. This serves as a real-time notification about this event. For example, this event is triggered when a loyalty tier is added to a loyalty campaign and the campaign is then saved.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Deleted
Source: https://docs.voucherify.io/api-reference/campaign/loyalty-tier-deleted
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.LOYALTY_TIER.DELETED
The `EVENTS.CAMPAIGN.LOYALTY_TIER.DELETED` event indicates that a specific campaign loyalty tier was deleted. This serves as a real-time notification about this event. For example, this event is triggered when a loyalty tier is deleted from a loyalty campaign and the campaign is then saved.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Updated
Source: https://docs.voucherify.io/api-reference/campaign/loyalty-tier-updated
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.LOYALTY_TIER.UPDATED
The `EVENTS.CAMPAIGN.LOYALTY_TIER.UPDATED` event indicates that a specific campaign loyalty tier was updated. This serves as a real-time notification about this event. For example, this event is triggered when a loyalty tier has been updated in a loyalty campaign and the campaign is then saved.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Promotion Tier Created
Source: https://docs.voucherify.io/api-reference/campaign/promotion-tier-created
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.PROMOTION_TIER.CREATED
The `EVENTS.CAMPAIGN.PROMOTION_TIER.CREATED` event indicates that the promotion tier was created.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Promotion Tier Deleted
Source: https://docs.voucherify.io/api-reference/campaign/promotion-tier-deleted
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.PROMOTION_TIER.DELETED
The `EVENTS.CAMPAIGN.PROMOTION_TIER.DELETED` event indicates that the promotion tier was deleted.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Promotion Tier Disabled
Source: https://docs.voucherify.io/api-reference/campaign/promotion-tier-disabled
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.PROMOTION_TIER.DISABLED
The `EVENTS.CAMPAIGN.PROMOTION_TIER.DISABLED` event indicates that the promotion tier was disabled.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Promotion Tier Enabled
Source: https://docs.voucherify.io/api-reference/campaign/promotion-tier-enabled
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.PROMOTION_TIER.ENABLED
The `EVENTS.CAMPAIGN.PROMOTION_TIER.ENABLED` event indicates that the promotion tier was enabled.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Promotion Tier Updated
Source: https://docs.voucherify.io/api-reference/campaign/promotion-tier-updated
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.PROMOTION_TIER.UPDATED
The `EVENTS.CAMPAIGN.PROMOTION_TIER.UPDATED` event indicates that the promotion tier was updated.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Updated
Source: https://docs.voucherify.io/api-reference/campaign/updated
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.UPDATED
The `EVENTS.CAMPAIGN.UPDATED` event indicates that an existing campaign was modified within Voucherify. This event provides the campaign definition after the update, ensuring that relevant systems are informed in real-time.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Vouchers Generation Completed
Source: https://docs.voucherify.io/api-reference/campaign/vouchers-generation-completed
openapi-events/events-campaign.json webhook EVENTS.CAMPAIGN.VOUCHERS.GENERATION.COMPLETED
The `EVENTS.CAMPAIGN.VOUCHERS.GENERATION.COMPLETED` event indicates that voucher generation for a given campaign was completed. It includes details about the campaign for which voucher were generated, the number of generated vouchers, and the date when the process was completed.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Add Voucher with Specific Code to Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/add-voucher-with-specific-code-to-campaign
/openapi/campaigns.json post /v1/campaigns/{campaignId}/vouchers/{code}
This method gives a possibility to add a new voucher to an existing campaign. The voucher definition will be inherited from the definition kept in the campaign profile. However, you are able to overwrite a few properties inherited from the campaign.
# Add Vouchers to Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/add-vouchers-to-campaign
/openapi/campaigns.json post /v1/campaigns/{campaignId}/vouchers
This method gives the possibility to push new vouchers to an existing campaign. New vouchers will inherit properties from the campaign profile. However, it is possible to overwrite some of them in the request body. If you provide an optional `code_config` parameter with a voucher code configuration, then it will be used to generate new voucher codes. Otherwise, the voucher code configuration from the campaign will be used.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# Campaign Object
Source: https://docs.voucherify.io/api-reference/campaigns/campaign-object
Campaign
All of:
-
Campaign Base
-
Campaign Additional Data
Campaign Base
| Attributes |
Description |
|
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
|
|
type
string
|
Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.
-
AUTO\_UPDATE
: the campaign is dynamic, i.e. vouchers will generate based on set criteria
-
STATIC
: vouchers need to be manually published
-
STANDALONE
: campaign for single vouchers
Available values:
AUTO\_UPDATE,
STATIC,
STANDALONE
|
|
voucher
|
See:
Campaign Voucher
|
|
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. It is always
false
for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always
true
for loyalty campaigns and it cannot be changed in them.
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
activity\_duration\_after\_publishing
string
|
Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value 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.
-
true
indicates an
active
campaign
-
false
indicates an
inactive
campaign
|
|
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. The value is shown in the ISO 8601 format.
Example:
2021-12-01T08:00:50.038Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the campaign was last 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 voucher generation.
Available values:
DONE,
IN\_PROGRESS,
FAILED,
DRAFT,
MODIFYING
|
|
readonly
boolean
|
Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. It is also not returned for restricted users who use the
GET Campaign summary
endpoint.
|
|
protected
boolean
|
Indicates whether the resource can be deleted.
|
|
category\_id
string,
null
|
Unique category ID that this campaign belongs to.
Example:
cat\_0b688929a2476386a7
|
|
categories
array
|
Contains details about the campaign category. For the GET
List campaigns
endpoint, this is returned only if the
expand=category
query parameter is passed in the request. Otherwise, it is returned as an empty array. For GET
Campaign summary
endpoint, it is always returned as an empty array.
Array of
Category
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the campaign.
|
|
referral\_program
|
See:
Referral Program
|
|
loyalty\_tiers\_expiration
|
See:
Loyalty Tiers Expiration
|
|
access\_settings\_assignments
|
See:
Access Settings Campaign Assignments List
|
Promotion Tiers
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
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 if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results.
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Campaign Voucher
| Attributes |
Description |
|
type
string
|
Type of voucher.
|
|
discount
|
Defines the voucher discount type and details.
Discount
|
|
gift
|
Defines the voucher gift details.
Gift
|
|
loyalty\_card
|
Defines the voucher loyalty card details.
Campaign Loyalty Card
|
|
redemption
object
|
Defines the redemption limits on vouchers.
| Attributes |
Description |
|
quantity
integer,
null
|
How many times a voucher can be redeemed. A
null
value means unlimited.
|
|
|
code\_config
|
Code Config
|
|
is\_referral\_code
boolean
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Referral Program
| Attributes |
Description |
|
conversion\_event\_type
string
|
Define how a referral is triggered.
Available values:
redemption,
custom\_event
|
|
custom\_event
object
|
Contains details about the custom event.
| Attributes |
Description |
|
id
string
|
Unique custom event ID.
Example:
ms\_Ll9enAm2BCN0M1s4VxWobLFM
|
|
name
string
|
Custom event name.
|
|
|
referee\_reward
object
|
Defines the referee reward.
| Attributes |
Description |
|
related\_object\_parent
object
|
Details of the resource from which the reward originates.
| Attributes |
Description |
|
id
string
|
Unique ID of the reward source.
Example:
camp\_kdxp3vf1clQ9CFs1jpqv3tZe
|
|
name
string
|
Name of the reward source.
|
|
object
string
|
Type of resource represented by the source of the reward.
Available values:
CAMPAIGN
|
|
|
type
string
|
Type of reward.
Available values:
LOYALTY\_CARD,
GIFT\_VOUCHER
|
|
amount
integer
|
Define the number of
points
to add to a loyalty card or
credits
to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, \$100 amount is written as 10000.
|
|
Loyalty Tiers Expiration
| Attributes |
Description |
|
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.
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:
BALANCE,
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.
|
Period
|
Definition
|
|
Calendar Month
|
Points collected in one calendar month
January, February, March, etc.
|
|
Calendar Quarter
|
Points collected in the quarter
\- January - March
\- April - June
\- July - September
\- October - December
|
|
Calendar Half-year
|
Points collected in the half-year
\- January - June
\- July - December
|
|
Calendar Year
|
Points 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.
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
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.
BALANCE\_DROP
: Tier expires when the points balance drops below the required range of the tier.
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:
END\_OF\_PERIOD,
END\_OF\_NEXT\_PERIOD,
BALANCE\_DROP,
CUSTOM
|
|
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.
|
|
rounding
|
Defines the rounding mechanism for tier expiration.
|
|
Access Settings Campaign Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. Default is
list.
This object stores information about campaign assignments to areas and stores
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of campaign assignments.
Available values:
data
|
|
data
array
|
Contains an array of campaign assignments.
Array of
Areas and Stores Campain Assignment
|
|
total
integer
|
Total number of areas and stores to which the campaign is assigned.
|
Promotion Tier
| 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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-02-09T09:20:05.603Z
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
action
object
|
Contains details about the discount applied by the promotion tier.
| Attributes |
Description |
|
discount
|
See:
Discount
|
|
|
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.
|
|
promotion\_id
string
|
Promotion unique ID.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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 the 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.
-
true
indicates an
active
promotion tier
-
false
indicates an
inactive
promotion tier
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
summary
object
|
Contains statistics about promotion tier redemptions and orders.
| Attributes |
Description |
|
redemptions
object
|
Contains statistics about promotion tier redemptions.
| Attributes |
Description |
|
total\_redeemed
integer
|
Number of times the promotion tier was redeemed.
|
|
|
orders
object
|
Contains statistics about orders related to the promotion tier.
| Attributes |
Description |
|
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 the object represented by JSON. This object stores information about the promotion tier.
|
|
validation\_rule\_assignments
|
See:
Validation Rule Assignments List
|
|
category\_id
string
|
Promotion tier category ID.
Example:
cat\_0c9da30e7116ba6bba
|
|
categories
array
|
Array of
Category
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Gift
| Attributes |
Description |
|
amount
number
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime.
|
|
balance
number
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
balance
\=
amount
\-
subtracted\_amount
\-
redemption.redeemed\_amount.
|
|
effect
string
|
Defines how the credits are applied to the customer's order.
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
|
Campaign Loyalty Card
| Attributes |
Description |
|
points
integer
|
The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card.
|
|
expiration\_rules
object
|
Defines the loyalty point expiration rule. This expiration rule applies when there are no
expiration\_rules
defined for an earning rule.
| Attributes |
Description |
|
period\_type
string
|
Type of period. Can be set for
MONTH
or
FIXED\_DAY\_OF\_YEAR.
MONTH
requires the
period\_value
field.
FIXED\_DAY\_OF\_YEAR
requires the
fixed\_month
and
fixed\_day
fields.
Available values:
FIXED\_DAY\_OF\_YEAR,
MONTH
|
|
period\_value
integer
|
Value of the period. Required for the
period\_type: MONTH.
|
|
rounding\_type
string
|
Type of rounding of the expiration period. Optional for the
period\_type: MONTH.
Available values:
END\_OF\_MONTH,
END\_OF\_QUARTER,
END\_OF\_HALF\_YEAR,
END\_OF\_YEAR,
PARTICULAR\_MONTH
|
|
rounding\_value
integer
|
Value of rounding of the expiration period. Required for the
rounding\_type.
|
|
fixed\_month
integer
|
Determines the month when the points expire;
1
is January,
2
is February, and so on. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
|
fixed\_day
integer
|
Determines the day of the month when the points expire. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
|
Code Config
| Attributes |
Description |
|
length
number
|
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.
|
|
initial\_count
integer
|
Internal value, does not change anything if provided.
|
Areas and Stores Campain Assignment
| Attributes |
Description |
|
id
string
|
Unique identifier of the campaign assignment.
Example:
arsca\_0ef5ee192117ae2416
|
|
area\_id
string
|
Unique identifier of the area to which the campaign is assigned.
Example:
ar\_0ea6cd7b781b8f857f
|
|
all\_stores
boolean
|
Determines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the
access\_settings.assign.area\_all\_stores\_ids
in the request.
|
|
area\_store\_id
string
|
Unique identifier of the store to which the campaign is assigned.
Example:
ars\_0ec347e2016bed85f4
|
|
created\_at
string
|
Date and time when the assignment was made. The value is shown in the ISO 8601 format.
Example:
2024-06-25T19:04:16.260Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores.
Available values:
area\_store\_campaign\_assignment
|
Validation Rule Assignments List
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of validation rule assignments.
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Create Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/create-campaign
/openapi/campaigns.json post /v1/campaigns
Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes.
Global uniqueness
All campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code.
Code generation status
This is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the [campaign object](/api-reference/campaigns/campaign-object) description.
# Delete Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/delete-campaign
/openapi/campaigns.json delete /v1/campaigns/{campaignId}
Deletes a campaign and all related vouchers. This action cannot be undone. Also, this method immediately removes any redemptions on the voucher.
If the `force` parameter is set to `false` or not set at all, the campaign and all related vouchers will be moved to [the bin](/api-reference/bin/list-bin-entries).
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# Disable Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/disable-campaign
/openapi/campaigns.json post /v1/campaigns/{campaignId}/disable
Sets campaign state to **inactive**. The vouchers in this campaign can no longer be redeemed.
# Enable Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/enable-campaign
/openapi/campaigns.json post /v1/campaigns/{campaignId}/enable
Sets campaign state to **active**. The vouchers in this campaign can be redeemed - only if the redemption occurs after the start date of the campaign and voucher and the voucher and campaign are not expired.
# Examine Campaign Qualification
Source: https://docs.voucherify.io/api-reference/campaigns/examine-campaign-qualification
/openapi/campaigns.json post /v1/campaigns/qualification
Deprecated
This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](/api-reference/qualifications/check-eligibility) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
The method can be used for sending a request to display all campaigns qualified to the given customer and context (e.g., order).
The maximum number of **returned campaigns is 50**.
## What campaign types are included in the response?
- `DISCOUNT_COUPONS`
- `GIFT_VOUCHERS`
- `REFERRAL_PROGRAM`
## What's excluded?
A checking logic will be run only among campaigns and will ignore _generic (standalone) vouchers_. For generic (standalone) vouchers, you should run a [dedicated endpoint](/api-reference/vouchers/examine-voucher-qualification) for searching and identifing vouchers.
## Subsequent Steps
As a recommended subsequent step after selecting a qualified campaign is to publish a voucher code from that campaign. The [API method for publishing](/api-reference/publications/create-publication) will return a unique code which will belong to a given customer.
## Sample use case
As a sample use case, you can imagine a requirement of displaying coupons (grouped in campaigns) that a customer is eligible to use. The customer should get assigned to the particular voucher from the campaign and then may redeem that particular code when he/she places an order.
[Read](/guides/checking-eligibility) about Qualification API limits before you start.
# Export Campaign Transactions
Source: https://docs.voucherify.io/api-reference/campaigns/export-campaign-transactions
/openapi/campaigns.json post /v1/campaigns/{campaignId}/transactions/export
Export transactions is an asynchronous process that generates a CSV file with the data about credit movements on all gift cards or point movements on all loyalty cards in a given campaign.
To export transactions:
1. In the export request, use parameters to select which fields will be exported, in what order, and which data will be filtered.
2. Use the returned `id` to track the export status with the [GET Export](/api-reference/exports/get-export) method.
3. In the GET Export method, when the returned `status` field has the `DONE` value, the export file has been generated.
4. Use the URL in the `result` property to download the file. You must be logged to your Voucherify account on a given cluster in the browser to be able to download the file.
An export request will almost always result in a single file being generated by the system. However, when the data volume is large, the system may split the results into multiple files.
An example export file can look as follows:
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| `id` | Unique transaction ID. | `vtx_0cb7811f1c07765800` |
| `type` | Transaction type. |**Gift cards**:
- `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION`
**Loyalty cards**:
- `POINTS_ACCRUAL`
- `POINTS_REDEMPTION`
- `POINTS_REFUND`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_EXPIRATION`
- `POINTS_TRANSFER_IN`
- `POINTS_TRANSFER_OUT` |
| `source_id` | Unique transaction source ID. Optional and only in manual operations: `CREDITS_ADDITION`, `CREDITS_REMOVAL`, `POINTS_ADDITION`, `POINTS_REMOVAL`, `POINTS_TRANSFER_OUT`. | 8638 |
| `reason` | Contains the reason for the transaction if one was included originally. Optional and only in the following manual operations: `CREDITS_ADDITION`, `CREDITS_REMOVAL`, `POINTS_ADDITION`, `POINTS_REMOVAL`, `POINTS_TRANSFER_OUT`, `POINTS_TRANSFER_IN`. | `Apology for sending a broken item` |
| `balance` | The gift card or loyalty card balance after the transaction. | |
| `amount` | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| `created_at` | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | `2024-10-09T09:16:32.521Z` |
| `voucher_id` | Unique voucher ID. | `v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp` |
| `source`| Channel through which the transaction was initiated. | `API` |
| `details` | More detailed information stored in the form of JSON. | Provides more details related to the transaction in the form of an object. |
| `related_transaction_id` | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | `vtx_0c9afe802593b34b80` |
Export Loyalty Campaign Transactions
For loyalty campaigns, this method works in the same way the [POST Export Loyalty Campaign Transactions](/api-reference/loyalties/export-loyalty-campaign-transactions) does.
# Get Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/get-campaign
/openapi/campaigns.json get /v1/campaigns/{campaignId}
Retrieves the campaign with the given campaign ID or campaign name.
# Get Campaign Summary
Source: https://docs.voucherify.io/api-reference/campaigns/get-campaign-summary
/openapi/campaigns.json get /v1/campaigns/{campaignId}/summary
Returns data for campaign analytics, covering validations, redemptions, publications, and other details specific to a given campaign type.
Use `start_date` and `end_date` to narrow down the data to specific periods.
Campaigns created before 17 June 2025
This endpoint returns analytics data for campaigns that were created after 17 June 2025. Older campaigns return empty data.
# Import Vouchers to Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/import-vouchers-to-campaign
/openapi/campaigns.json post /v1/campaigns/{campaignId}/import
Imports vouchers to an **existing** campaign.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# Import Vouchers to Campaign by CSV
Source: https://docs.voucherify.io/api-reference/campaigns/import-vouchers-to-campaign-by-csv
/openapi/campaigns.json post /v1/campaigns/{campaignId}/importCSV
Imports vouchers to an **existing** campaign.
The CSV file has to include headers in the first line.
Curl Example
```cURL
curl -X **POST** \
https://api.voucherify.io/v1/campaigns/TEST-CAMPAIGN/importCSV \
-F file=@/path/to/campaigns.csv \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c"
```
You can import values for the following fields: `Code` (**required**), `Category`, `Active`. In a gift cards import, you can also include the current card balance using the `Gift Amount` header and the amount that was redeemed using the `Redeemed Amount` header. In a loyalty cards import, you can also include the current loyalty card score in points using the `Loyalty Points` header. Remaining CSV columns will be mapped to metadata properties.
Discount type, time limits, and validation rules will be taken from the [campaign object](/api-reference/campaigns/campaign-object) settings.
| **Active** | **Code** | **Loyalty Points** | **Gift Amount** | **Redeemed Amount** | **Redeemed Quantity** | **Category** | **Custom_metadata_property** |
|---|---|---|---|---|---|---|---|
| Use `true` or `false` to enable or disable the voucher; this flag can be used to turn off the ability to redeem a voucher even though it is within the campaign's start/end validity timeframe. | The unique voucher code. | The number of points to be added to the loyalty card. If you leave this undefined, then the initial number of points will be set according to the campaign settings.
Context: `LOYALTY_PROGRAM` | The initial gift card balance.
Context: `GIFT_VOUCHERS` | The amount that was redeemed from the available balance on a gift card. | The number of times the voucher has been redeemed. | A custom tag for the voucher to help you filter codes; you can either import the category name or a unique Voucherify-assigned category ID. | Any additional data that you would like to store for the given loyalty card as a Custom attribute. Remember to define the metadata schema in the Dashboard prior to importing codes. |
|
Active
The CSV file is allowed in two versions; either with or without a column titled `Active`. It indicates whether the voucher is enabled after the import event.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# List Campaign Transactions
Source: https://docs.voucherify.io/api-reference/campaigns/list-campaign-transactions
/openapi/campaigns.json get /v1/campaigns/{campaignId}/transactions
Retrieves all transactions for the campaign with the given campaign ID or campaign name. The `id` filter denotes the unique transaction identifier.
The endpoint works only for gift card and loyalty campaigns.
# List Campaigns
Source: https://docs.voucherify.io/api-reference/campaigns/list-campaigns
/openapi/campaigns.json get /v1/campaigns
Retrieve a list of campaigns in a project.
The campaigns are returned sorted by creation date, with the most recent campaigns appearing first.
When you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using `limit`, which page of campaigns to return using `page`, sort the campaigns using the `order` query parameter and filter the results by the `campaign_type`.
This method will return an error when trying to return a limit of more than 100 campaigns.
# Update Campaign
Source: https://docs.voucherify.io/api-reference/campaigns/update-campaign
/openapi/campaigns.json put /v1/campaigns/{campaignId}
Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
Fields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.
Vouchers will be affected
This method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.
# Activate Card Definition
Source: https://docs.voucherify.io/api-reference/card-definitions/activate-card-definition
/openapi/loyalties-v2.json post /v2/loyalties/card-definitions/{cardDefinitionId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Transitions the card definition from `DRAFT` to `ACTIVE`.
No request body. Activating from any other state results in an
invalid state transition error (409).
# Create Card Definition
Source: https://docs.voucherify.io/api-reference/card-definitions/create-card-definition
/openapi/loyalties-v2.json post /v2/loyalties/card-definitions
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a new card definition. Only `name` and `type` are required; all other
sections default server-side as follows:
- `code_config`: 10-character alphanumeric code pattern (`##########`)
- `points_expiration`: `NO_EXPIRATION`
- `pending_points`: `IMMEDIATE`
- `earning_limits`: global `NO_LIMIT`, transactions `NO_LIMIT`
- `spending_limits`: global `NO_LIMIT`, transactions `NO_LIMIT`
- `refunds`: spent points `NONE`, earned points `NONE`
- `balance_settings`: `allow_negative: false`
- `pay_with_points`: `NO_PAYMENTS`
Cross-field rules:
- `balance_settings.allow_negative` can only be `true` when `points_expiration.type`
is `NO_EXPIRATION`. Additionally, the earned points refund mode `REVOKE_BELOW_ZERO`
requires `balance_settings.allow_negative` to be `true`.
- The earned points refund method `REVOKE_FROM_PENDING` requires
`pending_points.type` to be one of `PERIOD_BASED`, `FIXED_DATES`, `EVENT_BASED`.
# Delete Card Definition
Source: https://docs.voucherify.io/api-reference/card-definitions/delete-card-definition
/openapi/loyalties-v2.json delete /v2/loyalties/card-definitions/{cardDefinitionId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Deletes a card definition. Returns the deleted card definition.
# Draft Card Definition
Source: https://docs.voucherify.io/api-reference/card-definitions/draft-card-definition
/openapi/loyalties-v2.json post /v2/loyalties/card-definitions/{cardDefinitionId}/draft
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Transitions the card definition from `ACTIVE` back to `DRAFT`.
No request body. Drafting from any other state results in an
invalid state transition error (409).
# Get Card Definition
Source: https://docs.voucherify.io/api-reference/card-definitions/get-card-definition
/openapi/loyalties-v2.json get /v2/loyalties/card-definitions/{cardDefinitionId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single card definition by its ID.
# List Card Definition Activities
Source: https://docs.voucherify.io/api-reference/card-definitions/list-card-definition-activities
/openapi/loyalties-v2.json get /v2/loyalties/card-definitions/{cardDefinitionId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for the card definition
(creation, updates, deletion, state transitions and program assignments).
Returns `404` when the card definition does not exist.
# List Card Definitions
Source: https://docs.voucherify.io/api-reference/card-definitions/list-card-definitions
/openapi/loyalties-v2.json get /v2/loyalties/card-definitions
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of card definitions.
Filtering is supported through the `filters` deep-object query parameter,
e.g. `filters[name][conditions][$is]=Standard%20Card`.
The same field cannot be requested in both ascending and descending
order at the same time.
# Update Card Definition
Source: https://docs.voucherify.io/api-reference/card-definitions/update-card-definition
/openapi/loyalties-v2.json put /v2/loyalties/card-definitions/{cardDefinitionId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates a card definition. All properties are optional; only provided sections
are updated. `type` and `status` cannot be changed through this endpoint
(status transitions are performed via the activate/draft endpoints).
When the card definition is in use (e.g. assigned to a program with existing cards),
updates to restricted sections may be rejected with a resource-locked error;
only `name`, `metadata` and `pay_with_points` are always updatable.
# Category Object
Source: https://docs.voucherify.io/api-reference/categories/category-object
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
# Create Category
Source: https://docs.voucherify.io/api-reference/categories/create-category
/openapi/categories.json post /v1/categories
Create category with a specific name and hierarchy.
# Delete Category
Source: https://docs.voucherify.io/api-reference/categories/delete-category
/openapi/categories.json delete /v1/categories/{categoryId}
Delete a category by the category ID.
# Get Category
Source: https://docs.voucherify.io/api-reference/categories/get-category
/openapi/categories.json get /v1/categories/{categoryId}
Retrieve a category by the category ID.
# List Categories
Source: https://docs.voucherify.io/api-reference/categories/list-categories
/openapi/categories.json get /v1/categories
List all categories.
# Update Category
Source: https://docs.voucherify.io/api-reference/categories/update-category
/openapi/categories.json put /v1/categories/{categoryId}
Update a category using the category ID.
# Check Eligibility (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/check-eligibility-client-side
/openapi/client-side.json post /client/v1/qualifications
Generate a list of redeemables that are applicable in the context of the customer and order.
The new qualifications method is an improved version of [Campaign Qualifications](/api-reference/campaigns/examine-campaign-qualification), [Voucher Qualifications](/api-reference/vouchers/examine-voucher-qualification) API requests. The new qualification method introduces the following improvements:
- Qualification results are returned faster
- No limit on the number of returned redeemables
- Introduces new qualification scenarios, not available in the previous version
Scenario Guide
Read our dedicated guide to learn about some use cases this endpoint can cover [here](/guides/checking-eligibility).
## Paging
The Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables per page. To get the next batch of redeemables, you need to use the `starting_after` cursor.
To process of paging the redeemables works in the following manner:
- You send the first API request for Qualifications without the `starting_after` parameter.
- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.
- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.
- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.
- Voucherify will return the next page of redeemables.
- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.
## Caching
Qualification has a 5-minute cache for the returned results. If you change your campaign settings or validation rules, the changes will apply to qualification results after the cache refreshes.
# Create Publication (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/create-publication-client-side
/openapi/client-side.json post /client/v1/publish
This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.
A voucher is suitable for publication when it's active and hasn't been published yet.
Clearly define the source of the voucher
You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code.
Publish multiple vouchers
In case you want to publish multiple vouchers within a single publication, you need to specify the campaign name and number of vouchers you want to publish.
Auto-update campaign
In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.
# List Promotion Tiers (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/list-promotion-tiers-client-side
/openapi/client-side.json get /client/v1/promotions/tiers
This method enables you to list promotion tiers.
# Redeem Stackable Discounts (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/redeem-stackable-discounts-client-side
/openapi/client-side.json post /client/v1/redemptions
This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.
## How API returns calculated discounts and order amounts in the response
In the table below, you can see the logic the API follows to calculate discounts and amounts:
| **Field** | **Calculation** | **Description** |
|:---|:---|:---|
| amount | N/A | This field shows the order amount before applying any discount |
| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |
| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |
| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |
| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |
| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |
| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |
| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |
Rollbacks
You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](/api-reference/redemptions/rollback-stackable-redemptions).
# Redeem Voucher (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/redeem-voucher-client-side
/openapi/client-side.json post /client/v1/redeem
Deprecated
This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/client-side/redeem-stackable-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To redeem a voucher, you need to create a redemption object. It increments the redemption counter and updates the history of the voucher. This method is accessible through public keys, which you can use in client-side apps (mobile and web browser apps).
The client-side redemption works similar to the server-side [voucher redemption](/api-reference/redemptions/redeem-voucher) endpoint. The difference lies in the authorization. For the client-side, you can use client-side keys.
Opt-in
By default this feature is disabled. If you want to use it, you will need to enable the function explicitly in **Project Settings**.
Security Threat
Be careful if you want to include the voucher redemption functionality directly on your client side (website or mobile app). In this configuration, there is a chance that discounts can be modified before being sent to the server.
### Expand Response
You may expand the response by adding the following object to your request body. The expanded response will include the category details of the voucher.
```json
{
"options": {
"expand": [
"category"
]
}
}
```
# Track Custom Event (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/track-custom-event-client-side
/openapi/client-side.json post /client/v1/events
To track a custom event, you create an event object.
The event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.
# Validate Stackable Discounts (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/validate-stackable-discounts-client-side
/openapi/client-side.json post /client/v1/validations
Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.
# Validate Voucher (client-side)
Source: https://docs.voucherify.io/api-reference/client-side/validate-voucher-client-side
/openapi/client-side.json get /client/v1/validate
Deprecated
This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/client-side/validate-stackable-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To verify a voucher code given by customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.
Specifying gift credits and loyalty points
This endpoint does not support specifying the specific amount of gift credits to apply to an order nor the specific amount of loyalty points to an order. It calculates the amount that is available on the card and applies as much credits or points as possible to cover the total amount.
### Set customer identity (optional)
Voucherify can help you track anonymous customers. Once you integrate Voucherify into your web app and call the validate method, Voucherify will return a tracking ID and the script will store it in a cookie. Each subsequent validate call will use the same tracking ID.
Voucherify tracks a user using a tracking ID to see if the user who is validating vouchers is the same as the one who consuming them. Voucherify does this by setting up an identity for the user. A `tracking_id` will be generated on the server side, unless you specify your own `tracking_id`. In both cases, you will receive the `tracking_id` in the validation response.
The returned `tracking_id` field should be used as the customer `source_id` in subsequent redemption requests. Moreover, the `tracking_id` returned from Validation API is encoded. Voucherify will recognize both values for identifying customer - the one before encryption sent as a query parameter to the **GET** `v1/validate` request, and the version encrypted and returned as part of the validation request.
### Sample workflow
Customer tracking workflow in a nutshell:
**Client-side:**
* A customer visits your website.
* A customer validates a voucher code. That triggers a validate request to be sent to Voucherify. In the request, you pass the tracking_id or customer.source_id. As a result, the API call to this endpoint returns an **encoded** `tracking_id`.
**Backend:**
* Once the customer finishes the checkout process, your website passes the `tracking_id` to your backend during a redemption call. The `tracking_id` is sent as a value assigned to the property *source_id* in a customer object.
* A customer object is created and within the redemption response, you get a customer `id`.
* You can use the customer `id` or the customer `source_id` to fetch or modify the customer details.
A customer is created (upserted) automatically with a redemption call. Alternatively, you can create a new profile by creating a customer via a dedicated API method. Take a look at the customer object to understand the [entity's structure](/api-reference/customers/customer-object).
Customer identifier
The source id of the customer may either be an already hashed version of the `tracking_id`, which you received in a response from a validation request or a custom ID you predefined (i.e. an email address). Nevertheless, we recommend using identifiers delivered by Voucherify API.
### Examples with Query Parameters
| **Query Parameters** | **Example URL** |
|:---|:---|
| Shortcut - `customer` query param instead of `customer[source_id]` | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=customer_id` |
| Pass `customer`'s and `redemption`'s context `metadata` in query parameters | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=sure_he_is_new&metadata[shop]=1&customer[metadata][propsy]=2&metadata[test]=true` |
| Use `tracking_id` instead of `source_id` | `https://api.voucherify.io/client/v1/validate?code=IKU-mvS-JOG&amount=10100&tracking_id=sure_he_is_new_5&metadata[shop]=1&metadata[test]=true` |
### Reasons why a validation might fail
Voucher validation might fail because of one of these reasons:
* `voucher not found` - voucher doesn't exist or was [deleted](/api-reference/vouchers/delete-voucher)
* `voucher expired` - voucher is out of [start date - expiration date] timeframe
* `voucher is disabled` - learn more about [disabled vouchers](/api-reference/vouchers/disable-voucher)
* `customer does not match segment rules` - learn more about [customer tracking](/api-reference/customers/customer-object)
* `order does not match validation rules` - learn more about [validation rules](/api-reference/validations/validation-object)
# Created
Source: https://docs.voucherify.io/api-reference/customer/created
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.CREATED
The `EVENTS.CUSTOMER.CREATED` event indicates that a new customer was successfully created in Voucherify.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Custom Event
Source: https://docs.voucherify.io/api-reference/customer/custom-event
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.CUSTOM_EVENT
The `EVENTS.CUSTOMER.CUSTOM_EVENT` event indicates that a custom event has occurred and it involved a customer.
When the event is used in a "Custom event" distribution webhook, the `data` object always contains the following required objects:
* `event`,
* `event_schema`,
* `customer`,
* `referral`,
* `loyalty`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Deleted
Source: https://docs.voucherify.io/api-reference/customer/deleted
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.DELETED
The `EVENTS.CUSTOMER.DELETED` event indicates that a customer was successfully deleted in Voucherify.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Holder Assignment Created
Source: https://docs.voucherify.io/api-reference/customer/holder-assignment-created
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.HOLDER.ASSIGNMENT.CREATED
The `EVENTS.CUSTOMER.HOLDER.ASSIGNMENT.CREATED` event indicates that a customer has been assigned to a redeemable.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This event can be viewed in Voucherify logs or as part of events listed under the [List Customer Activity](/api-reference/customers/list-customer-activity) endpoint.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Holder Assignment Deleted
Source: https://docs.voucherify.io/api-reference/customer/holder-assignment-deleted
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.HOLDER.ASSIGNMENT.DELETED
The `EVENTS.CUSTOMER.HOLDER.ASSIGNMENT.DELETED` event indicates that a customer has been unassigned from a redeemable.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This event can be viewed in Voucherify logs or as part of events listed under the [List Customer Activity](/api-reference/customers/list-customer-activity) endpoint.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Downgraded
Source: https://docs.voucherify.io/api-reference/customer/loyalty-tier-downgraded
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.LOYALTY.TIER.DOWNGRADED
The `EVENTS.CUSTOMER.LOYALTY.TIER.DOWNGRADED` event indicates that a customer has moved to a lower tier or a specific tier in a loyalty campaign.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Joined
Source: https://docs.voucherify.io/api-reference/customer/loyalty-tier-joined
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.LOYALTY.TIER.JOINED
The `EVENTS.CUSTOMER.LOYALTY.TIER.JOINED` event indicates that a customer has entered a loyalty campaign tier structure or a specific tier.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Left
Source: https://docs.voucherify.io/api-reference/customer/loyalty-tier-left
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.LOYALTY.TIER.LEFT
The `EVENTS.CUSTOMER.LOYALTY.TIER.LEFT` event indicates that a customer has exited a loyalty campaign tier structure or a specific tier.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Prolonged
Source: https://docs.voucherify.io/api-reference/customer/loyalty-tier-prolonged
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.LOYALTY.TIER.PROLONGED
The `EVENTS.CUSTOMER.LOYALTY.TIER.PROLONGED` event indicates that a customer has remained on a loyalty tier or a specific tier in a loyalty campaign under campaign rules even though they no longer qualify for it.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Tier Upgraded
Source: https://docs.voucherify.io/api-reference/customer/loyalty-tier-upgraded
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.LOYALTY.TIER.UPGRADED
The `EVENTS.CUSTOMER.LOYALTY.TIER.UPGRADED` event indicates that a customer has moved to a higher tier or a specific tier in a loyalty campaign.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Order Canceled
Source: https://docs.voucherify.io/api-reference/customer/order-canceled
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.ORDER.CANCELED
The `EVENTS.CUSTOMER.ORDER.CANCELED` event indicates that a customer-related order has been canceled.
When the event is used in an "Order canceled" distribution webhook, the `data` object always contains the following required objects:
* `customer`,
* `referrer`,
* `order`,
* `redemption`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Order Created
Source: https://docs.voucherify.io/api-reference/customer/order-created
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.ORDER.CREATED
The `EVENTS.CUSTOMER.ORDER.CREATED` event indicates that a customer-related order has been created.
When the event is used in an "Order creation" distribution webhook, the `data` object always contains the following required objects:
* `customer`,
* `referrer`,
* `order`,
* `redemption`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Order Paid
Source: https://docs.voucherify.io/api-reference/customer/order-paid
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.ORDER.PAID
The `EVENTS.CUSTOMER.ORDER.PAID` event indicates that a customer-related order has been paid.
When the event is used in an "Order has been paid" distribution webhook, the `data` object always contains the following required objects:
* `customer`,
* `referrer`,
* `order`,
* `redemption`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Order Updated
Source: https://docs.voucherify.io/api-reference/customer/order-updated
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.ORDER.UPDATED
The `EVENTS.CUSTOMER.ORDER.UPDATED` event indicates that a customer-related order has been updated.
When the event is used in an "Order update" distribution webhook, the `data` object always contains the following required objects:
* `customer`,
* `referrer`,
* `order`,
* `redemption`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Publication Succeeded
Source: https://docs.voucherify.io/api-reference/customer/publication-succeeded
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.PUBLICATION.SUCCEEDED
The `EVENTS.CUSTOMER.PUBLICATION.SUCCEEDED` event indicates that a voucher code was successfully published to a customer.
This event serves as a real-time notification mechanism and it can notify other systems or applications that a voucher was assigned. As a result, the systems can react by, for example, sending a notification about an assignment to a customer.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Redemption Rollback Succeeded
Source: https://docs.voucherify.io/api-reference/customer/redemption-rollback-succeeded
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.SUCCEEDED
The `EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.SUCCEEDED` event indicates a redemption was successfully reversed for a customer. This occurs when a previously redeemed voucher code or promotional tier has been rolled back or undone.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Redemption Succeeded
Source: https://docs.voucherify.io/api-reference/customer/redemption-succeeded
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REDEMPTION.SUCCEEDED
The `EVENTS.CUSTOMER.REDEMPTION.SUCCEEDED` event indicates that the redemption process was successful with regard to a customer. It confirms that the associated voucher codes and promotional tiers have been effectively applied.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Reward Redemptions Completed
Source: https://docs.voucherify.io/api-reference/customer/reward-redemptions-completed
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REWARD_REDEMPTIONS.COMPLETED
The `EVENTS.CUSTOMER.REWARD_REDEMPTIONS.COMPLETED` event indicates that redemption of a reward has been completed.
If this event is sent as a notification in a Loyalty campaign, it is also sent with the `publication` object.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Reward Redemptions Created
Source: https://docs.voucherify.io/api-reference/customer/reward-redemptions-created
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REWARD_REDEMPTIONS.CREATED
The `EVENTS.CUSTOMER.REWARD_REDEMPTIONS.CREATED` event indicates that redemption of a reward has been created.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Reward Redemptions Pending
Source: https://docs.voucherify.io/api-reference/customer/reward-redemptions-pending
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REWARD_REDEMPTIONS.PENDING
The `EVENTS.CUSTOMER.REWARD_REDEMPTIONS.PENDING` event indicates that redemption of a reward is in progress.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Rewarded
Source: https://docs.voucherify.io/api-reference/customer/rewarded
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REWARDED
The `EVENTS.CUSTOMER.REWARDED` event indicates that a customer received a reward in exchange for points in a loyalty campaign. The action is usually a manual process started by the customer.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Rewarded Loyalty Points
Source: https://docs.voucherify.io/api-reference/customer/rewarded-loyalty-points
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.REWARDED.LOYALTY_POINTS
The `EVENTS.CUSTOMER.REWARDED.LOYALTY_POINTS` event indicates that a customer received loyalty points on one of their loyalty cards. The webhook contains the details of the number of points the customer received.
If this event is sent as a notification in a Loyalty campaign, it is also sent with the `publication` object.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Segment Entered
Source: https://docs.voucherify.io/api-reference/customer/segment-entered
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.SEGMENT.ENTERED
The `EVENTS.CUSTOMER.SEGMENT.ENTERED` event indicates that a customer has joined a customer segment. It returns details about the customer and the segment.
When the event is used in a "Customer entered segment" distribution webhook, the `data` object always contains the following required objects:
* `customer`,
* `segment`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Segment Left
Source: https://docs.voucherify.io/api-reference/customer/segment-left
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.SEGMENT.LEFT
The `EVENTS.CUSTOMER.SEGMENT.LEFT` event indicates that a customer has left a customer segment. It returns details about the customer and the segment.
When the event is used in a "Customer left segment" distribution webhook, the `data` object always contains the following required objects:
* `customer`,
* `segment`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `publication`,
* "Send plain message to customers" sends only the basic objects listed above.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Updated
Source: https://docs.voucherify.io/api-reference/customer/updated
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.UPDATED
The `EVENTS.CUSTOMER.UPDATED` event indicates that a customer was successfully updated in Voucherify.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
The following API endpoints can update customer data, but don't trigger customer update webhooks:
* POST `v1/customers/metadata/async`
* POST `v1/customers/bulk/async`
* POST `v1/customers/importCSV`
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks") page.
# Voucher Gift Balance Added
Source: https://docs.voucherify.io/api-reference/customer/voucher-gift-balance-added
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.GIFT.BALANCE_ADDED
The `EVENTS.CUSTOMER.VOUCHER.GIFT.BALANCE_ADDED` event indicates that additional balance has been successfully added to a customer's gift voucher. It provides real-time notification that the gift voucher's balance has been increased.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Voucher Loyalty Card Pending Points Activated
Source: https://docs.voucherify.io/api-reference/customer/voucher-loyalty-card-pending-points-activated
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ACTIVATED
The `EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ACTIVATED` event indicates that loyalty pending points have been successfully activated and added to a customer's loyalty card associated with a voucher. The pending points can be activated automatically after a predefined time set in days or manually with the [**POST** Activate Member Pending Points](api-reference/loyalties/activate-member-pending-points) endpoint.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Voucher Loyalty Card Pending Points Added
Source: https://docs.voucherify.io/api-reference/customer/voucher-loyalty-card-pending-points-added
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ADDED
The `EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ADDED` event indicates that loyalty pending points have been successfully added to a customer's loyalty card associated with a voucher. The pending points activate automatically after a predefined time set in days or they can be activated manually with the [**POST** Activate Member Pending Points](api-reference/loyalties/activate-member-pending-points) endpoint. The pending points can be also canceled manually with the [**POST** Cancel Member Pending Points](/api-reference/loyalties/cancel-member-pending-points) endpoint.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Voucher Loyalty Card Pending Points Canceled
Source: https://docs.voucherify.io/api-reference/customer/voucher-loyalty-card-pending-points-canceled
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.CANCELED
The `EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.CANCELED` event indicates that loyalty pending points have been successfully canceled for a customer's loyalty card associated with a voucher. The pending points can be canceled manually with the [**POST** Cancel Member Pending Points](/api-reference/loyalties/cancel-member-pending-points) endpoint.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Voucher Loyalty Card Pending Points Updated
Source: https://docs.voucherify.io/api-reference/customer/voucher-loyalty-card-pending-points-updated
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.UPDATED
The `EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.PENDING_POINTS.UPDATED` event indicates that loyalty pending points have been updated on a customer's loyalty card associated with a voucher. The pending points can be updated by adding or subtracting points.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Voucher Loyalty Card Points Added
Source: https://docs.voucherify.io/api-reference/customer/voucher-loyalty-card-points-added
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.POINTS_ADDED
The `EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.POINTS_ADDED` event indicates that loyalty points have been successfully added to a customer's loyalty card. It informs about the accumulation of loyalty points.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Voucher Loyalty Card Points Expired
Source: https://docs.voucherify.io/api-reference/customer/voucher-loyalty-card-points-expired
openapi-events/events-customer.json webhook EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.POINTS_EXPIRED
The `EVENTS.CUSTOMER.VOUCHER.LOYALTY_CARD.POINTS_EXPIRED` event indicates that loyalty points have expired on a customer's loyalty card. It informs about the loyalty points that were removed under the expiration rules set in the loyalty campaign.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Create Customer
Source: https://docs.voucherify.io/api-reference/customers/create-customer
/openapi/customers.json post /v1/customers
Creates a customer object.
Upsert Mode
If you pass an `id` or a `source_id` that already exists in the customer database, Voucherify will return a related customer object with updated fields.
# Customer Activity Object
Source: https://docs.voucherify.io/api-reference/customers/customer-activity-object
Customer Activity
| Attributes |
Description |
|
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.recovered,
customer.sms.failed,
customer.email.sent,
customer.email.recovered,
customer.email.failed,
customer.activecampaign.sent,
customer.activecampaign.recovered,
customer.activecampaign.failed,
customer.braze.sent,
customer.braze.recovered,
customer.braze.failed,
customer.mailchimp.sent,
customer.mailchimp.recovered,
customer.mailchimp.failed,
customer.intercom.sent,
customer.intercom.recovered,
customer.intercom.failed,
customer.shopify.sent,
customer.shopify.recovered,
customer.shopify.failed,
customer.klaviyo.sent,
customer.klaviyo.recovered,
customer.klaviyo.failed,
customer.batch.sent,
customer.batch.recovered,
customer.batch.failed,
customer.rewarded,
customer.rewarded.loyalty\_points,
customer.voucher.gift.balance\_added,
customer.voucher.loyalty\_card.pending\_points.activated,
customer.voucher.loyalty\_card.pending\_points.added,
customer.voucher.loyalty\_card.pending\_points.canceled,
customer.voucher.loyalty\_card.pending\_points.updated,
customer.voucher.loyalty\_card.points\_activated,
customer.voucher.loyalty\_card.points\_added,
customer.voucher.loyalty\_card.points\_transferred,
customer.voucher.loyalty\_card.points\_expired,
customer.voucher.deleted,
customer.publication.succeeded,
customer.publication.failed,
customer.validation.succeeded,
customer.validation.failed,
customer.redemption.failed,
customer.redemption.succeeded,
customer.redemption.rollback.failed,
customer.redemption.rollback.succeeded,
customer.order.canceled,
customer.order.created,
customer.order.fulfilled,
customer.order.paid,
customer.order.processing,
customer.order.updated,
customer.reward\_redemptions.created,
customer.reward\_redemptions.pending,
customer.reward\_redemptions.completed,
customer.reward\_redemptions.rolledback,
customer.loyalty.updated,
customer.loyalty.tier.upgraded,
customer.loyalty.tier.downgraded,
customer.loyalty.tier.prolonged,
customer.loyalty.tier.expiration.changed,
customer.loyalty.tier.joined,
customer.loyalty.tier.left,
customer.holder.assignment.created,
customer.holder.assignment.deleted
|
|
data
object
|
Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.
|
|
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
|
|
group\_id
string
|
Unique identifier of the request that caused the event.
Example:
v-1f36113948e50fc4ge
|
Customer Activity Data
Event data object schema.
One of:
-
Event Customer Confirmed
-
Event Customer Created
-
Event Customer Updated
-
Event Customer Deleted
-
Event Customer Referred
-
Event Customer Custom Event
-
Event Customer Segment Entered
-
Event Customer Segment Left
-
Event Customer SMS Sent
-
Event Customer SMS Recovered
-
Event Customer SMS Failed
-
Event Customer Email Sent
-
Event Customer Email Recovered
-
Event Customer Email Failed
-
Event Customer ActiveCampaign Sent
-
Event Customer ActiveCampaign Recovered
-
Event Customer ActiveCampaign Failed
-
Event Customer Braze Sent
-
Event Customer Braze Recovered
-
Event Customer Braze Failed
-
Event Customer Mailchimp Sent
-
Event Customer Mailchimp Recovered
-
Event Customer Mailchimp Failed
-
Event Customer Intercom Sent
-
Event Customer Intercom Recovered
-
Event Customer Intercom Failed
-
Event Customer Shopify Sent
-
Event Customer Shopify Recovered
-
Event Customer Shopify Failed
-
Event Customer Klaviyo Sent
-
Event Customer Klaviyo Recovered
-
Event Customer Klaviyo Failed
-
Event Customer Batch Sent
-
Event Customer Batch Recovered
-
Event Customer Batch Failed
-
Event Customer Rewarded
-
Event Customer Rewarded Loyalty Points
-
Event Customer Gift Voucher Balance Added
-
Event Customer Loyalty Card Pending Points Activated
-
Event Customer Loyalty Card Pending Points Added
-
Event Customer Loyalty Card Pending Points Canceled
-
Event Customer Loyalty Card Pending Points Updated
-
Event Customer Loyalty Card Points Added
-
Event Customer Loyalty Card Points Transferred
-
Event Customer Loyalty Card Points Expired
-
Event Customer Voucher Deleted
-
Event Customer Publication Succeeded
-
Event Customer Publication Failed
-
Event Customer Validation Succeeded
-
Event Customer Validation Failed
-
Event Customer Redemption Succeeded
-
Event Customer Redemption Failed
-
Event Customer Redemption Rollback Succeeded
-
Event Customer Redemption Rollback Failed
-
Event Customer Order Canceled
-
Event Customer Order Created
-
Event Customer Order Fulfilled
-
Event Customer Order Paid
-
Event Customer Order Processing
-
Event Customer Order Updated
-
Event Customer Reward Redemptions Created
-
Event Customer Reward Redemptions Pending
-
Event Customer Reward Redemptions Completed
-
Event Customer Reward Redemptions Rolled Back
-
Event Customer Loyalty Updated
-
Event Customer Loyalty Tier Upgraded
-
Event Customer Loyalty Tier Downgraded
-
Event Customer Loyalty Tier Prolonged
-
Event Customer Loyalty Tier Expiration Changed
-
Event Customer Loyalty Tier Joined
-
Event Customer Loyalty Tier Left
-
Event Customer Holder Assignment Created
-
Event Customer Holder Assignment Deleted
Event Source
| Attributes |
Description |
|
channel
string
|
Determines the channel that initiated the event.
Available values:
USER\_PORTAL,
API,
CLIENT\_API,
INTERNAL
Example:
API
|
|
user
object
|
Determines the Voucherify user who triggered the event.
| Attributes |
Description |
|
id
string
|
Unique identifier of the user.
Example:
user\_xyzfghSTprSTUVWXYlk6tuvXYst7FGH7
|
|
|
api\_key
object
|
Determines the API key used to initiate the event.
| Attributes |
Description |
|
name
string
|
Channel name in the application keys.
|
|
app\_id
string
|
Contains the application ID from the Voucherify API key pair.
Example:
1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX
|
|
Event Customer Confirmed
Event Customer Created
Event Customer Updated
Event Customer Deleted
Event Customer Referred
Event Customer Custom Event
Event Customer Segment Entered
Event Customer Segment Left
Event Customer SMS Sent
Event data object schema for
customer.sms.sent.
Event Customer Sent
Event Customer SMS Recovered
Event data object schema for
customer.sms.recovered.
Event Customer Recovered
Event Customer SMS Failed
Event data object schema for
customer.sms.failed.
Event Customer Failed
Event Customer Email Sent
Event data object schema for
customer.email.sent.
Event Customer Sent
Event Customer Email Recovered
Event data object schema for
customer.email.recovered.
Event Customer Recovered
Event Customer Email Failed
Event data object schema for
customer.email.failed.
Event Customer Failed
Event Customer ActiveCampaign Sent
Event data object schema for
customer.activecampaign.sent.
Event Customer Sent
Event Customer ActiveCampaign Recovered
Event data object schema for
customer.activecampaign.recovered.
Event Customer Recovered
Event Customer ActiveCampaign Failed
Event data object schema for
customer.activecampaign.failed.
Event Customer Failed
Event Customer Braze Sent
Event data object schema for
customer.braze.sent.
Event Customer Sent
Event Customer Braze Recovered
Event data object schema for
customer.braze.recovered.
Event Customer Recovered
Event Customer Braze Failed
Event data object schema for
customer.braze.failed.
Event Customer Failed
Event Customer Mailchimp Sent
Event data object schema for
customer.mailchimp.sent.
Event Customer Sent
Event Customer Mailchimp Recovered
Event data object schema for
customer.mailchimp.recovered.
Event Customer Recovered
Event Customer Mailchimp Failed
Event data object schema for
customer.mailchimp.failed.
Event Customer Failed
Event Customer Intercom Sent
Event data object schema for
customer.intercom.sent.
Event Customer Sent
Event Customer Intercom Recovered
Event data object schema for
customer.intercom.recovered.
Event Customer Recovered
Event Customer Intercom Failed
Event data object schema for
customer.intercom.failed.
Event Customer Failed
Event Customer Shopify Sent
Event data object schema for
customer.shopify.sent.
Event Customer Sent
Event Customer Shopify Recovered
Event data object schema for
customer.shopify.recovered.
Event Customer Recovered
Event Customer Shopify Failed
Event data object schema for
customer.shopify.failed.
Event Customer Failed
Event Customer Klaviyo Sent
Event data object schema for
customer.klaviyo.sent.
Event Customer Sent
Event Customer Klaviyo Recovered
Event data object schema for
customer.klaviyo.recovered.
Event Customer Recovered
Event Customer Klaviyo Failed
Event data object schema for
customer.klaviyo.failed.
Event Customer Failed
Event Customer Batch Sent
Event data object schema for
customer.batch.sent.
Event Customer Sent
Event Customer Batch Recovered
Event data object schema for
customer.batch.recovered.
Event Customer Recovered
Event Customer Batch Failed
Event data object schema for
customer.batch.failed.
Event Customer Failed
Event Customer Rewarded
Event Customer Rewarded Loyalty Points
Event Customer Gift Voucher Balance Added
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
campaign
|
See:
Simple Campaign
|
|
voucher
|
See:
Simple Voucher
|
|
balance
|
See:
Voucher Balance
|
|
transaction
|
All of:
-
Voucher Transaction Base
-
| Attributes |
Description |
|
details
object
|
Contains the detailed information about the transaction.
| Attributes |
Description |
|
balance
|
See:
Voucher Balance
|
|
order
object
|
Contains information about the original order.
| Attributes |
Description |
|
id
string
|
Unique order ID.
|
|
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.
|
|
|
event
object
|
Contains information about the event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of event.
|
|
|
earning\_rule
object
|
Contains information about the earning rule.
| Attributes |
Description |
|
id
string
|
Unique identifier of an earning rule, assigned by Voucherify.
|
|
source
object
|
Contains the custom earning rule name.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
|
|
segment
object
|
Contains information about the segment.
| Attributes |
Description |
|
id
string
|
|
|
name
string
|
|
|
|
loyalty\_tier
object
|
Contains information about the loyalty tier.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
redemption
object
|
Contains information about the original redemption.
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
|
|
|
rollback
object
|
Contains information about the redemption rollback.
| Attributes |
Description |
|
id
string
|
Unique redemption rollback ID.
|
|
|
custom\_event
object
|
Contains information about the custom event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of custom event.
|
|
|
event\_schema
object
|
Contains information about the custom event metadata schema.
| Attributes |
Description |
|
id
string
|
Unique metadata schema ID.
|
|
name
string
|
Type of custom event.
|
|
|
reward
object
|
Contains information about the pay with points reward.
| Attributes |
Description |
|
id
string
|
Unique reward ID.
|
|
name
string
|
Reward name.
|
|
|
source\_voucher
|
Contains information on how the balance on the donor loyalty card was affected by the transaction.
Simple Voucher
|
|
destination\_voucher
|
Contains information on how the balance on the receiving loyalty card was affected by the transaction.
Simple Voucher
|
|
|
type
string
|
Transaction type concerning gift card credits.
Available values:
CREDITS\_ADDITION
|
|
Event Customer Loyalty Card Pending Points Activated
Event Customer Loyalty Card Pending Points Added
Event Customer Loyalty Card Pending Points Canceled
Event Customer Loyalty Card Pending Points Updated
Event Customer Loyalty Card Points Added
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
campaign
|
See:
Simple Campaign
|
|
voucher
|
See:
Simple Voucher
|
|
balance
|
See:
Voucher Balance
|
|
transaction
|
All of:
-
Voucher Transaction Base
-
| Attributes |
Description |
|
details
object
|
Contains the detailed information about the transaction.
| Attributes |
Description |
|
balance
|
See:
Voucher Balance
|
|
order
object
|
Contains information about the original order.
| Attributes |
Description |
|
id
string
|
Unique order ID.
|
|
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.
|
|
|
event
object
|
Contains information about the event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of event.
|
|
|
earning\_rule
object
|
Contains information about the earning rule.
| Attributes |
Description |
|
id
string
|
Unique identifier of an earning rule, assigned by Voucherify.
|
|
source
object
|
Contains the custom earning rule name.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
|
|
segment
object
|
Contains information about the segment.
| Attributes |
Description |
|
id
string
|
|
|
name
string
|
|
|
|
loyalty\_tier
object
|
Contains information about the loyalty tier.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
redemption
object
|
Contains information about the original redemption.
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
|
|
|
rollback
object
|
Contains information about the redemption rollback.
| Attributes |
Description |
|
id
string
|
Unique redemption rollback ID.
|
|
|
custom\_event
object
|
Contains information about the custom event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of custom event.
|
|
|
holder\_loyalty\_tier
object
|
Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
event\_schema
object
|
Contains information about the custom event metadata schema.
| Attributes |
Description |
|
id
string
|
Unique metadata schema ID.
|
|
name
string
|
Type of custom event.
|
|
|
reward
object
|
Contains information about the pay with points reward.
| Attributes |
Description |
|
id
string
|
Unique reward ID.
|
|
name
string
|
Reward name.
|
|
|
source\_voucher
|
Contains information on how the balance on the donor loyalty card was affected by the transaction.
Simple Voucher
|
|
destination\_voucher
|
Contains information on how the balance on the receiving loyalty card was affected by the transaction.
Simple Voucher
|
|
|
type
string
|
Transaction type concerning loyalty card points.
Available values:
POINTS\_ACCRUAL
|
|
Event Customer Loyalty Card Points Transferred
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
campaign
|
See:
Simple Campaign
|
|
voucher
|
See:
Simple Voucher
|
|
source\_voucher
|
See:
Simple Voucher
|
|
destination\_voucher
|
See:
Simple Voucher
|
|
balance
|
See:
Voucher Balance
|
|
transaction
|
All of:
-
Voucher Transaction Base
-
| Attributes |
Description |
|
details
object
|
Contains the detailed information about the transaction.
| Attributes |
Description |
|
balance
|
See:
Voucher Balance
|
|
order
object
|
Contains information about the original order.
| Attributes |
Description |
|
id
string
|
Unique order ID.
|
|
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.
|
|
|
event
object
|
Contains information about the event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of event.
|
|
|
earning\_rule
object
|
Contains information about the earning rule.
| Attributes |
Description |
|
id
string
|
Unique identifier of an earning rule, assigned by Voucherify.
|
|
source
object
|
Contains the custom earning rule name.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
|
|
segment
object
|
Contains information about the segment.
| Attributes |
Description |
|
id
string
|
|
|
name
string
|
|
|
|
loyalty\_tier
object
|
Contains information about the loyalty tier.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
redemption
object
|
Contains information about the original redemption.
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
|
|
|
rollback
object
|
Contains information about the redemption rollback.
| Attributes |
Description |
|
id
string
|
Unique redemption rollback ID.
|
|
|
custom\_event
object
|
Contains information about the custom event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of custom event.
|
|
|
event\_schema
object
|
Contains information about the custom event metadata schema.
| Attributes |
Description |
|
id
string
|
Unique metadata schema ID.
|
|
name
string
|
Type of custom event.
|
|
|
holder\_loyalty\_tier
object
|
Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
reward
object
|
Contains information about the pay with points reward.
| Attributes |
Description |
|
id
string
|
Unique reward ID.
|
|
name
string
|
Reward name.
|
|
|
source\_voucher
|
Contains information on how the balance on the donor loyalty card was affected by the transaction.
Simple Voucher
|
|
destination\_voucher
|
Contains information on how the balance on the receiving loyalty card was affected by the transaction.
Simple Voucher
|
|
|
type
string
|
Transaction type concerning loyalty card points.
Available values:
POINTS\_TRANSFER\_IN,
POINTS\_TRANSFER\_OUT
|
|
Event Customer Loyalty Card Points Expired
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
campaign
|
See:
Simple Campaign
|
|
voucher
|
See:
Simple Voucher
|
|
points
integer
|
The number of expired points.
|
|
buckets
array
|
Array of
Loyalty Point Bucket
|
|
transaction
|
All of:
-
Voucher Transaction Base
-
| Attributes |
Description |
|
details
object
|
Contains the detailed information about the transaction.
| Attributes |
Description |
|
balance
|
See:
Voucher Balance
|
|
order
object
|
Contains information about the original order.
| Attributes |
Description |
|
id
string
|
Unique order ID.
|
|
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.
|
|
|
event
object
|
Contains information about the event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of event.
|
|
|
earning\_rule
object
|
Contains information about the earning rule.
| Attributes |
Description |
|
id
string
|
Unique identifier of an earning rule, assigned by Voucherify.
|
|
source
object
|
Contains the custom earning rule name.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
|
|
segment
object
|
Contains information about the segment.
| Attributes |
Description |
|
id
string
|
|
|
name
string
|
|
|
|
loyalty\_tier
object
|
Contains information about the loyalty tier.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
redemption
object
|
Contains information about the original redemption.
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
|
|
|
rollback
object
|
Contains information about the redemption rollback.
| Attributes |
Description |
|
id
string
|
Unique redemption rollback ID.
|
|
|
custom\_event
object
|
Contains information about the custom event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of custom event.
|
|
|
event\_schema
object
|
Contains information about the custom event metadata schema.
| Attributes |
Description |
|
id
string
|
Unique metadata schema ID.
|
|
name
string
|
Type of custom event.
|
|
|
holder\_loyalty\_tier
object
|
Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
reward
object
|
Contains information about the pay with points reward.
| Attributes |
Description |
|
id
string
|
Unique reward ID.
|
|
name
string
|
Reward name.
|
|
|
source\_voucher
|
Contains information on how the balance on the donor loyalty card was affected by the transaction.
Simple Voucher
|
|
destination\_voucher
|
Contains information on how the balance on the receiving loyalty card was affected by the transaction.
Simple Voucher
|
|
|
type
string
|
Transaction type concerning loyalty card points.
Available values:
POINTS\_EXPIRATION
|
|
Event Customer Voucher Deleted
Event Customer Publication Succeeded
Event Customer Publication Failed
Event Customer Validation Succeeded
Event Customer Validation Failed
Event Customer Redemption Succeeded
Event data object schema for
customer.redemption.succeeded.
Event Customer Redemption
Event Customer Redemption Failed
Event data object schema for
customer.redemption.failed.
Event Customer Redemption
Event Customer Redemption Rollback Succeeded
Event data object schema for
customer.redemption.rollback.succeeded.
All of:
-
Event Customer Redemption
-
Event Customer Redemption Rollback Failed
Event data object schema for
customer.redemption.rollback.failed.
All of:
-
Event Customer Redemption
-
Event Customer Order Canceled
Event data object schema for
customer.order.canceled.
Event Customer Order
Event Customer Order Created
Event data object schema for
customer.order.created.
Event Customer Order
Event Customer Order Fulfilled
Event data object schema for
customer.order.fulfilled.
Event Customer Order
Event Customer Order Paid
Event data object schema for
customer.order.paid.
Event Customer Order
Event Customer Order Processing
Event data object schema for
customer.order.processing.
Event Customer Order
Event Customer Order Updated
Event data object schema for
customer.order.updated.
Event Customer Order
Event Customer Reward Redemptions Created
Event data object schema for
customer.reward\_redemptions.created.
Event Customer Reward Redemptions
Event Customer Reward Redemptions Pending
Event data object schema for
customer.reward\_redemptions.pending.
Event Customer Reward Redemptions
Event Customer Reward Redemptions Completed
Event data object schema for
customer.reward\_redemptions.completed.
Event Customer Reward Redemptions
Event Customer Reward Redemptions Rolled Back
Event data object schema for
customer.reward\_redemptions.rolledback.
Event Customer Reward Redemptions
Event Customer Loyalty Updated
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
campaign
|
See:
Simple Campaign
|
|
loyalty
object
|
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Loyalty Tier Upgraded
Event data object schema for
customer.loyalty.tier.upgraded.
All of:
-
Event Customer Loyalty Tier Base
-
Loyalty Tier Upgraded
| Attributes |
Description |
|
loyalty\_tier\_from
|
See:
Loyalty Tier
|
|
loyalty\_tier\_to
|
See:
Loyalty Tier
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Loyalty Tier Downgraded
Event data object schema for
customer.loyalty.tier.downgraded.
All of:
-
Event Customer Loyalty Tier Base
-
Loyalty Tier Downgraded
| Attributes |
Description |
|
loyalty\_tier\_from
|
See:
Loyalty Tier
|
|
loyalty\_tier\_to
|
See:
Loyalty Tier
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Loyalty Tier Prolonged
Event data object schema for
customer.loyalty.tier.prolonged.
All of:
-
Event Customer Loyalty Tier Base
-
Loyalty Tier Prolonged
| Attributes |
Description |
|
loyalty\_tier
|
See:
Loyalty Tier
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Loyalty Tier Expiration Changed
Event data object schema for
customer.loyalty.tier.expiration.changed.
All of:
-
Event Customer Loyalty Tier Base
-
Loyalty Tier Expiration Changed
| Attributes |
Description |
|
loyalty\_tier
|
See:
Loyalty Tier
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
|
expiration\_date
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Loyalty Tier Joined
Event data object schema for
customer.loyalty.tier.joined.
All of:
-
Event Customer Loyalty Tier Base
-
Loyalty Tier Joined
| Attributes |
Description |
|
loyalty\_tier
|
See:
Loyalty Tier
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Loyalty Tier Left
Event data object schema for
customer.loyalty.tier.left.
All of:
-
Event Customer Loyalty Tier Base
-
Loyalty Tier Left
| Attributes |
Description |
|
loyalty\_tier
|
See:
Loyalty Tier
|
|
created\_at
string
|
Example:
2022-02-25T13:32:08.734Z
|
Event Customer Holder Assignment Created
Event Customer Holder Assignment Deleted
Customer With Summary Loyalty Referrals
All of:
-
Customer Response Data
| Attributes |
Description |
|
id
string
|
The ID of an existing customer that will be linked to redemption in this request.
|
|
source\_id
string
|
A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
|
|
summary
|
Customer Summary
|
|
loyalty
|
Customer Loyalty
|
|
referrals
|
Customer Referrals
|
|
system\_metadata
object
|
Object used to store system metadata information.
|
|
created\_at
string
|
Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.
Example:
2022-08-30T06:32:07.380Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-31T06:32:07.380Z
|
|
assets
object
|
Contains information about the customer's cockpit.
⚠️ Warning: Customer cockpits were removed. The customer cockpit URLs redirect to customer preference center.
| Attributes |
Description |
|
cockpit\_url
string
|
URL address to customer preference center. Previously, a customer's cockpit URL address.
|
|
cockpit\_preference\_center\_url
string
|
URL address to customer preference center.
|
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
-
Customer Base
Simple Customer
| Attributes |
Description |
|
id
string
|
Unique identifier of an existing customer. It is assigned by Voucherify.
|
|
name
string
|
Customer's first and last name.
|
|
email
string
|
Customer's email address.
|
|
source\_id
string
|
A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service.
|
|
metadata
object
|
A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Simple Campaign
| Attributes |
Description |
|
id
string
|
Campaign ID.
|
|
name
string
|
Campaign name.
|
|
campaign\_type
string
|
Type of campaign.
|
|
type
string
|
Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.
-
AUTO\_UPDATE
: the campaign is dynamic, i.e. vouchers will generate based on set criteria
-
STATIC
: vouchers need to be manually published
-
STANDALONE
: campaign for single vouchers
Available values:
AUTO\_UPDATE,
STATIC,
STANDALONE
|
|
is\_referral\_code
boolean
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
voucher
|
See:
Simple Campaign Voucher
|
|
referral\_program
|
See:
Referral Program
|
|
auto\_join
boolean
|
Indicates whether customers will be able to auto-join the 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. It is always
false
for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always
true
for loyalty campaigns and it cannot be changed in them.
|
|
active
boolean
|
Indicates whether the campaign is active.
|
|
category\_id
string,
null
|
The unique category ID that this campaign belongs to.
|
|
category
string
|
Unique category name.
|
|
categories
array
|
Contains details about the category.
Array of
Category
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a campaign. The metadata object stores all custom attributes assigned to the 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
|
|
description
string
|
An optional field to keep extra textual information about the campaign such as a campaign description and details.
|
|
created\_at
string
|
Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format.
Example:
2024-01-01T11:11:11.111Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the campaign was updated in the ISO 8601 format.
Example:
2024-01-01T11:11:11.111Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the campaign.
Available values:
campaign
|
Simple Voucher
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the voucher assigned by Voucherify.
|
|
code
string
|
Voucher code.
|
|
gift
|
Gift object response.
Gift
|
|
discount
|
See:
Discount
|
|
loyalty\_card
object
|
Defines the loyalty card details.
Simple Loyalty Card
|
|
type
string
|
Type of the voucher.
Available values:
DISCOUNT\_VOUCHER,
LOYALTY\_CARD,
GIFT\_VOUCHER
|
|
campaign
string
|
Campaign name.
|
|
campaign\_id
string
|
Campaign unique ID.
|
|
is\_referral\_code
boolean
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
holder\_id
string
|
Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referrer assigned by Voucherify.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
category\_id
string,
null
|
Unique identifier of the category that this voucher belongs to.
Example:
cat\_0b6152ce12414820dc
|
|
categories
array
|
Contains details about the category.
Array of
Category
|
|
active
boolean
|
Shows whether the voucher is on or off.
true
indicates an
active
voucher and
false
indicates an
inactive
voucher.
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2024-01-01T11:11:11.111Z
|
|
redemption
object
|
Defines the redemption limits on vouchers.
| Attributes |
Description |
|
quantity
integer,
null
|
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.
|
|
|
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
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a voucher. The metadata object stores all custom attributes assigned to the voucher.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
voucher
|
Custom Event
| Attributes |
Description |
|
id
string
|
Unique custom event ID.
|
|
object
string
|
The object represented is an
event.
Available values:
event
|
|
type
string
|
The event name.
|
|
customer
|
A simple customer object
Customer Object Required Object Type
|
|
referral
object
|
Referral object.
| Attributes |
Description |
|
referrer\_id
string
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
code
string
|
Voucher code.
|
|
id
string
|
Unique voucher ID.
|
|
|
loyalty
object
|
Loyalty object.
| Attributes |
Description |
|
code
string
|
Loyalty card code.
|
|
|
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 object.
|
|
created\_at
string
|
Timestamp representing the date and time when the custom event was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
Redemption Internal
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the
redemption.
|
|
created\_at
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
tracking\_id
string
|
Hashed customer source ID.
|
|
metadata
object
|
The metadata object stores all custom attributes assigned to the redemption.
|
|
channel\_type
string
|
The source of the channel for the redemption rollback. A
USER
corresponds to the Voucherify Dashboard and an
API
corresponds to the API.
Available values:
USER,
API
|
|
channel\_id
string
|
Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API.
Example:
user\_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
|
|
failure\_code
string
|
If the result is
FAILURE,
this parameter will provide a generic reason as to why the redemption failed.
Example:
customer\_rules\_violated
|
|
failure\_message
string
|
If the result is
FAILURE,
this parameter will provide a more expanded reason as to why the redemption failed.
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
Array of
Order Item Calculated
|
|
|
previous\_order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
Array of
Order Item Calculated
|
|
|
reward
|
See:
Redemption Reward Result
|
|
amount
integer
|
For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the number of redeemed credits.
For loyalty cards, this is the number of loyalty points used in the transaction.
Example:
10000
|
|
reason
string
|
System generated cause for the redemption being invalid in the context of the provided parameters.
|
|
result
string
|
Redemption result.
Available values:
SUCCESS,
FAILURE
|
|
status
string
|
Redemption status.
Available values:
SUCCEEDED,
FAILED
|
|
related\_redemptions
object
|
| Attributes |
Description |
|
rollbacks
array
|
Array of:
Redemption Internal Related Redemptions Rollbacks Item
| Attributes |
Description |
|
id
string
|
Unique rollback redemption ID.
Example:
rr\_0bc92f81a6801f9bca
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
|
redemptions
array
|
Array of:
Redemption Internal Related Redemptions Item
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
|
|
parent\_redemption\_id
string
|
Unique redemption ID of the parent redemption.
Example:
r\_0c656311b5878a2031
|
|
redemption
string
|
Unique redemption ID of the parent redemption.
Example:
r\_0c656311b5878a2031
|
|
customer
|
See:
Simple Customer
|
|
customer\_id
string,
null
|
Unique customer ID of the redeeming customer.
Example:
cust\_i8t5Tt6eiKG5K79KQlJ0Vs64
|
|
related\_object\_type
string
|
Defines the related object.
Available values:
voucher,
promotion\_tier
|
|
related\_object\_id
string
|
Unique related object ID assigned by Voucherify, i.e. v\_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
|
|
related\_object\_parent\_id
string
|
Unique related parent object ID assigned by Voucherify, i.e. v\_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
|
|
campaign\_name
string
|
Campaign name
|
|
voucher
|
Defines the details of the voucher being redeemed.
All of:
-
Voucher
-
Voucher Holder
|
|
promotion\_tier
|
Contains details of the promotion tier and the parent campaign.
Promotion Tier
|
Simple Custom Event
| Attributes |
Description |
|
id
string
|
Unique identifier of the custom event.
|
|
name
string
|
Name of the custom event.
|
Simple Segment
| Attributes |
Description |
|
id
string
|
Unique segment ID.
Example:
seg\_DNAOhUtJffvX0f57ajLMFBYR
|
|
name
string
|
Segment name.
|
|
object
string
|
The type of the object represented by the ID.
Available values:
segment
|
Event Customer Sent
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
distribution
object
|
|
|
sent\_at
string
|
Timestamp representing the date and time when the distribution was sent in ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
Event Customer Recovered
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
distribution
object
|
|
|
recovered\_at
string
|
Timestamp representing the date and time when the distribution was recovered in ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
Event Customer Failed
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
distribution
object
|
|
|
failed\_at
string
|
Timestamp representing the date and time when the distribution failed in ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
Simple Redemption Reward Result
| Attributes |
Description |
|
customer
|
See:
Simple Customer
|
|
assignment\_id
string
|
Unique reward assignment ID assigned by Voucherify.
|
|
voucher
|
Simple Voucher
|
|
product
|
Simple Product
|
|
sku
|
Simple Sku
|
|
loyalty\_tier\_id
string
|
Unique loyalty tier ID assigned by Voucherify.
|
|
id
string
|
Unique reward ID, assigned by Voucherify.
Example:
rew\_nIy4gHpQHle2c3pNMwuj7G6j
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the reward.
Available values:
reward
|
|
name
string
|
Reward name.
|
|
created\_at
string
|
Timestamp representing the date and time when the reward was created. The value is shown in the ISO 8601 format.
Example:
2024-01-01T11:11:11.111Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the reward was updated. The value is shown in the ISO 8601 format.
Example:
2024-01-01T11:11:11.111Z
|
|
parameters
object
|
Defines how the reward is generated.
Reward type
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward.
|
|
type
string
|
Reward type.
Available values:
CAMPAIGN,
COIN,
MATERIAL
|
Simple Referral Tier
| Attributes |
Description |
|
id
string
|
Unique referral tier ID.
Example:
seg\_DNAOhUtJffvX0f57ajLMFBYR
|
|
campaign\_id
string
|
Campaign Id.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
parameters
object
|
Referral tier parameters
|
Loyalty Tier
All of:
-
Loyalty Tier Base
-
| Attributes |
Description |
|
id
string
|
Unique loyalty tier ID.
|
|
campaign\_id
string
|
Unique parent campaign ID.
|
|
metadata
object,
null
|
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. The value is shown in the ISO 8601 format.
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format.
|
|
config
object
|
Defines loyalty tier range in points.
| Attributes |
Description |
|
points
object
|
Defines range of loyalty tier in points.
| Attributes |
Description |
|
from
integer
|
Bottom points threshold value.
|
|
to
integer
|
Top points threshold value.
|
|
|
|
expiration
|
See:
Loyalty Tier Expiration
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the loyalty.
Available values:
loyalty\_tier
|
Earning Rule
All of:
-
EarningRuleBase
-
| Attributes |
Description |
|
validation\_rule\_id
string,
null
|
A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.
|
|
active
boolean
|
A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start\_date and expiration\_date of the campaign or the earning rule's own start\_date and expiration\_date.
-
true
indicates an active earning rule
-
false
indicates an inactive earning rule
|
Voucher Balance
| Attributes |
Description |
|
type
string
|
The type of voucher whose balance is being adjusted due to the transaction.
Available values:
loyalty\_card,
gift\_voucher
|
|
total
integer
|
The number of all points or credits accumulated on the card as affected by add or subtract operations.
|
|
object
string
|
The type of the object represented by the JSON.
Available values:
balance
|
|
amount
integer
|
Credits added or subtracted on a gift card.
|
|
points
integer
|
Points added or subtracted in the transaction of a loyalty card.
|
|
balance
integer
|
The available points or credits on the card after the transaction as affected by redemption or rollback.
|
|
operation\_type
string
|
The type of the operation being performed. The operation type is
AUTOMATIC
if it is an automatic redemption.
Available values:
MANUAL,
AUTOMATIC
|
|
related\_object
object
|
Defines the resource that is being modified with the values that are returned in the balance object.
| Attributes |
Description |
|
id
string
|
Identifies the voucher that is being modified. The ID is assigned by the Voucherify API.
|
|
type
string
|
The object being modified, i.e. voucher.
Available values:
voucher
|
|
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Order Item Calculated
| Attributes |
Description |
|
id
string
|
Unique identifier of the order line item.
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
|
|
product\_id
string
|
Unique identifier of the product. It is assigned by Voucherify.
|
|
related\_object
string
|
Used along with the source\_id property, can be set to either sku or product.
Available values:
product,
sku
|
|
source\_id
string
|
The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
|
|
quantity
integer
|
The quantity of the particular item in the cart.
|
|
discount\_quantity
integer
|
Number of dicounted items.
|
|
initial\_quantity
integer
|
A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity.
|
|
amount
integer
|
The total amount of the order item (price \* quantity).
|
|
discount\_amount
integer
|
Sum of all order-item-level discounts applied to the order.
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied.
|
|
applied\_discount\_quantity
integer
|
Number of the discounted items applied in the transaction.
|
|
applied\_quantity
integer
|
Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
applied\_quantity\_amount
integer
|
Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
initial\_amount
integer
|
A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the total amount of the order. This is the sum of the order items' amounts.
|
|
price
integer
|
Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
\-
applied\_discount\_amount
|
|
product
object
|
An object containing details of the related product.
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the product and is assigned by Voucherify.
|
|
source\_id
string
|
The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
|
|
override
boolean
|
The override set to
true
is used to store the product information in the system. If the product does not exist, it will be created with a source\_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
|
|
name
string
|
Product name.
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections.
|
|
price
number
|
Product price. A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
|
sku
object
|
An object containing details of the related SKU.
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
|
|
source\_id
string
|
The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
|
|
override
boolean
|
The override set to
true
is used to store the product information in the system. If the product does not exist, it will be created with a source\_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
|
|
sku
string
|
The SKU name.
|
|
price
number
|
SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections.
|
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order\_item
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas.
|
Simple Event
| Attributes |
Description |
|
id
string
|
Unique identifier assigned by Voucherify that will be linked to the this event.
Example:
evcus\_0e3070fef399b70b00
|
|
type
string
|
Type of the triggering event.
Example:
customer.order.paid
|
|
category
string
|
Type of the event.
Available values:
EFFECT,
ACTION
|
|
entity\_id
string
|
ID of the entity that initiated the event.
Example:
cust\_ADqZIwGvWFvugWXVbrHwXRHO
|
|
created\_at
string
|
Timestamp representing the date and time when the event was created in the ISO 8601 format.
Example:
2024-01-01T11:11:11.111Z
|
|
group\_id
string
|
Unique identifier of the request that triggered the event.
Example:
v-1f36113948e50fc4ge
|
Voucher Transaction Base
| Attributes |
Description |
|
id
string
|
Unique transaction ID.
|
|
source\_id
string,
null
|
The merchant's transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption, this value is null.
|
|
voucher\_id
string
|
Unique voucher ID.
|
|
campaign\_id
string
|
Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.
|
|
source
string,
null
|
The channel through which the transaction took place, whether through the API or the Dashboard. In case of a redemption, this value is null.
|
|
reason
string,
null
|
Reason why the transaction occurred. In case of a redemption, this value is null.
|
|
related\_transaction\_id
string,
null
|
The related transaction ID on the receiving card.
|
|
created\_at
string
|
Timestamp representing the date and time when the transaction was created. The value is shown in the ISO 8601 format.
|
Simple Order
| Attributes |
Description |
|
id
string
|
Unique identifier of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string
|
Unique source identifier of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique identifier of the referrer assigned by Voucherify.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
amount
integer
|
A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the total amount of the order. This is the sum of the order items' amounts.
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
Array of
Simple Order Item
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
Voucher Transaction
All of:
-
Voucher Transaction Base
-
| Attributes |
Description |
|
details
object
|
Contains the detailed information about the transaction.
| Attributes |
Description |
|
balance
|
See:
Voucher Balance
|
|
order
object
|
Contains information about the original order.
| Attributes |
Description |
|
id
string
|
Unique order ID.
|
|
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.
|
|
|
event
object
|
Contains information about the event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique event ID.
|
|
type
string
|
Type of event.
|
|
|
earning\_rule
object
|
Contains information about the earning rule.
| Attributes |
Description |
|
id
string
|
Unique identifier of an earning rule, assigned by Voucherify.
|
|
source
object
|
Contains the custom earning rule name.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
|
|
segment
object
|
Contains information about the segment.
| Attributes |
Description |
|
id
string
|
Unique identifier of the segment.
|
|
name
string
|
Name of the segment.
|
|
|
loyalty\_tier
object
|
Contains information about the loyalty tier that is mapped for the earning rule and used in the transaction.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
redemption
object
|
Contains information about the original redemption.
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
|
|
|
rollback
object
|
Contains information about the redemption rollback.
| Attributes |
Description |
|
id
string
|
Unique identifier of the redemption rollback.
|
|
|
custom\_event
object
|
Contains information about the custom event that triggers the point accrual.
| Attributes |
Description |
|
id
string
|
Unique identifier of the event.
|
|
type
string
|
Type of the custom event.
|
|
|
event\_schema
object
|
Contains information about the custom event metadata schema.
| Attributes |
Description |
|
id
string
|
Unique identifier of the metadata schema.
|
|
name
string
|
Type of the custom event.
|
|
|
holder\_loyalty\_tier
object
|
Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
pending\_points
|
See:
Loyalty Pending Point Entry
|
|
reward
object
|
Contains information about the pay with points reward.
| Attributes |
Description |
|
id
string
|
Unique reward ID.
|
|
name
string
|
Reward name.
|
|
|
source\_voucher
|
Contains information on how the balance on the donor loyalty card was affected by the transaction.
Simple Voucher
|
|
destination\_voucher
|
Contains information on how the balance on the receiving loyalty card was affected by the transaction.
Simple Voucher
|
|
|
type
|
One of:
-
Gift Card Transactions Type
-
Loyalty Card Transactions Type
|
Loyalty Pending Point Entry
| Attributes |
Description |
|
id
string
|
Unique identifier of the pending point entry, assigned by Voucherify.
Example:
lopp\_0ffd593d5ad207ba6b
|
|
voucher\_id
string
|
Unique identifier of the loyalty card, assigned by Voucherify.
Example:
v\_abCdEfghI1JKLMNPqRS2Tu3vWXyza4bc
|
|
campaign\_id
string
|
Unique campaign identifier, assigned by Voucherify.
Example:
camp\_weer1c3p5ZgktqfW56RfoNaG
|
|
customer\_id
string
|
Unique customer identifier, assigned by Voucherify.
Example:
cust\_IdgAFZxYwwHctOk9ppZMu319
|
|
order\_id
string
|
Unique order identifier, assigned by Voucherify.
Example:
ord\_0ffc0fa65f15d2df17
|
|
points
integer
|
Number of points in the pending state.
|
|
activates\_at
string
|
Date when the pending points are activated and added to the customer's loyalty card.
|
|
details
|
See:
Pending Point Details
|
|
created\_at
string
|
Timestamp representing the date and time when the pending point entry was created. The value is shown in the ISO 8601 format.
|
|
updated\_at
string
|
Timestamp representing the date and time when the pending point entry was modified. The value is shown in the ISO 8601 format.
|
Loyalty Point Bucket
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty points bucket.
|
|
voucher\_id
string
|
Unique identifier of the parent loyalty card.
|
|
campaign\_id
string
|
Unique identifier of the parent campaign.
|
|
bucket
object
|
Defines the number of points stored in this loyalty point bucket.
| Attributes |
Description |
|
total\_points
integer
|
Total number of points in the loyalty point bucket.
|
|
|
status
string
|
Loyalty point bucket status.
|
|
expires\_at
string
|
Date when the number of points defined in the bucket object are due to expire.
|
|
created\_at
string
|
Timestamp representing the date and time when the loyalty point bucket object was created in ISO 8601 format.
|
|
updated\_at
string
|
Timestamp representing the date and time when the loyalty point bucket object was updated in ISO 8601 format.
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the loyalty point bucket.
Available values:
loyalty\_points\_bucket
|
Valid Single Voucher
All of:
-
List Publications Item Base
-
Validation Entity
| Attributes |
Description |
|
id
string
|
Unique validation id.
|
|
session\_id
string
|
Unique session id.
|
|
status
string
|
The validation status
Available values:
VALID,
INVALID
|
|
created\_at
string
|
Timestamp representing the date and time when the validation was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
customer\_id
string
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
redeemables
array
|
Lists validation results of each redeemable.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the redeemable, assigned by Voucherify.
|
|
type
string
|
Type of the redeemable.
Available values:
voucher,
promotion\_tier
|
|
|
skipped\_redeemables
array
|
Lists validation results of each redeemable.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the redeemable, assigned by Voucherify.
|
|
type
string
|
Type of the redeemable.
Available values:
voucher,
promotion\_tier
|
|
|
inapplicable\_redeemables
array
|
Lists validation results of each redeemable.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the redeemable, assigned by Voucherify.
|
|
type
string
|
Type of the redeemable.
Available values:
voucher,
promotion\_tier
|
|
Event Customer Redemption
Simple Redemption
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
customer\_id
string,
null
|
Unique customer ID of the redeeming customer.
Example:
cust\_i8t5Tt6eiKG5K79KQlJ0Vs64
|
|
tracking\_id
string
|
Hashed customer source ID.
|
|
date
string
|
Timestamp representing the date and time when the redemption was created in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
amount
integer
|
For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the number of redeemed credits.
For loyalty cards, this is the number of loyalty points used in the transaction.
In the case of redemption rollback, the numbers are expressed as negative integers.
Example:
10000
|
|
order
|
See:
Simple Order
|
|
reward
|
See:
Simple Redemption Reward Result
|
|
customer
|
See:
Simple Customer
|
|
result
string
|
Redemption result.
Available values:
SUCCESS,
FAILURE
|
|
status
string,
null
|
Available values:
SUCCEEDED,
FAILED,
ROLLED BACK
|
|
voucher
|
Defines the details of the voucher being redeemed.
Simple Voucher
|
|
promotion\_tier
|
See:
Simple Promotion Tier
|
|
redemption
string
|
Unique redemption ID of the parent redemption.
Example:
r\_0c656311b5878a2031
|
|
metadata
object
|
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.
|
|
failure\_code
string
|
If the result is
FAILURE,
this parameter will provide a generic reason as to why the redemption failed.
Example:
customer\_rules\_violated
|
|
failure\_message
string
|
If the result is
FAILURE,
this parameter will provide an expanded reason as to why the redemption failed.
|
|
reason
string
|
The reason for the redemption rollback.
|
|
channel
object
|
Defines the details of the channel through which the redemption was issued.
| Attributes |
Description |
|
channel\_id
string
|
Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard, an X-APP-Id of a user using the API, or the reward assignment ID for automatic reward redemption.
|
|
channel\_type
string
|
The source of the channel for the redemption:
USER
\- the redemption was made in the Voucherify Dashboard by a user,
API
\- redemption was made through the API,
AUTO\_REDEEM
\- the redemption was made automatically for a reward.
Available values:
API,
AUTO\_REDEEM,
USER
|
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the
redemption.
|
Event Customer Order
Event Customer Reward Redemptions
Event Customer Loyalty Tier Base
Redeemable Holder
| Attributes |
Description |
|
id
string
|
Unique identifier of the redeemable holder.
Example:
rh\_0e7b8db4700106a852
|
|
created\_at
string
|
Timestamp representing the date and time when the redeemable was assigned. The value is shown in the ISO 8601 format.
Example:
2024-03-22T17:48:25.910Z
|
|
redeemable\_id
string
|
Identifier of the redeemable item.
Example:
v\_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1
|
|
redeemable\_object
string
|
Type of the redeemable.
Available values:
voucher
Example:
voucher
|
|
campaign\_id
string
|
Unique identifier of the campaign as assigned by Voucherify.
Example:
camp\_weer1c3p5ZgktqfW56RfoNaG
|
|
campaign\_type
string
|
Defines the type of the campaign.
Available values:
REFERRAL\_PROGRAM
Example:
REFERRAL\_PROGRAM
|
|
voucher\_type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
Example:
DISCOUNT\_VOUCHER
|
|
publication\_id
string,
null
|
Unique identifier of the publication.
|
|
customer\_id
string
|
Unique identifier of the customer.
Example:
cust\_p1ufreYbVbwZ1x70nFkH9rF9
|
|
holder\_role
string
|
Role of the holder.
Available values:
OWNER,
REFERRER,
REFEREE
Example:
REFERRER
|
|
object
string
|
The type of the object represented by JSON.
Available values:
redeemable\_holder
|
Customer Summary
Customer Loyalty
| Attributes |
Description |
|
points
integer
|
Customer's loyalty points minus expired for all loyalty cards which the customer has.
|
|
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.
| Attributes |
Description |
|
\[propertyName]
object
|
Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.
| Attributes |
Description |
|
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.
|
|
|
Customer Referrals
| Attributes |
Description |
|
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:
Customer Referrals Campaigns Item
| Attributes |
Description |
|
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
Example:
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
|
|
Customer Base
| Attributes |
Description |
|
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. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
|
|
birthday
string
|
Deprecated.
Customer's birthdate; format YYYY-MM-DD.
|
|
birthdate
string
|
Customer's birthdate; format YYYY-MM-DD.
|
|
address
object,
null
|
Customer's address.
| Attributes |
Description |
|
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.
|
|
|
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.
|
Simple Campaign Voucher
| Attributes |
Description |
|
type
string
|
Type of the voucher.
Available values:
DISCOUNT\_VOUCHER,
LOYALTY\_CARD,
GIFT\_VOUCHER
|
|
discount
|
Defines the voucher discount type and details.
Discount
|
|
gift
|
Defines the voucher gift details.
Gift
|
|
loyalty\_card
|
Defines the voucher loyalty card details.
Campaign Loyalty Card
|
|
redemption
object
|
Defines the redemption limits on vouchers.
| Attributes |
Description |
|
quantity
integer,
null
|
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
|
|
|
code\_config
|
Code Config
|
Referral Program
| Attributes |
Description |
|
conversion\_event\_type
string
|
Define how a referral is triggered.
Available values:
redemption,
custom\_event
|
|
custom\_event
object
|
Contains details about the custom event.
| Attributes |
Description |
|
id
string
|
Unique custom event ID.
Example:
ms\_Ll9enAm2BCN0M1s4VxWobLFM
|
|
name
string
|
Custom event name.
|
|
|
referee\_reward
object
|
Defines the referee reward.
| Attributes |
Description |
|
related\_object\_parent
object
|
Details of the resource from which the reward originates.
| Attributes |
Description |
|
id
string
|
Unique ID of the reward source.
Example:
camp\_kdxp3vf1clQ9CFs1jpqv3tZe
|
|
name
string
|
Name of the reward source.
|
|
object
string
|
Type of resource represented by the source of the reward.
Available values:
CAMPAIGN
|
|
|
type
string
|
Type of reward.
Available values:
LOYALTY\_CARD,
GIFT\_VOUCHER
|
|
amount
integer
|
Define the number of
points
to add to a loyalty card or
credits
to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, \$100 amount is written as 10000.
|
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Gift
| Attributes |
Description |
|
amount
number
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime.
|
|
balance
number
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
balance
\=
amount
\-
subtracted\_amount
\-
redemption.redeemed\_amount.
|
|
effect
string
|
Defines how the credits are applied to the customer's order.
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Simple Loyalty Card
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
|
|
next\_expiration\_date
string
|
The next closest date when the next set of points are due to expire.
|
|
next\_expiration\_points
integer
|
The amount of points that are set to expire next.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
Customer Object Required Object Type
| Attributes |
Description |
|
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 can be a customer ID from a CRM system, database or 3rd-party service.
|
|
name
string
|
Customer's first and last name.
|
|
email
string
|
Customer's email address.
|
|
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.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the customer.
|
Redemption Reward Result
| Attributes |
Description |
|
customer
|
Simple Customer
|
|
assignment\_id
string,
null
|
Unique reward assignment ID assigned by Voucherify.
|
|
voucher
|
Voucher
|
|
product
|
Product
|
|
sku
|
SKU Object
|
|
loyalty\_tier\_id
string,
null
|
Unique loyalty tier ID assigned by Voucherify.
|
|
id
string
|
Unique reward ID.
Example:
rew\_0bc92f81a6801f9bca
|
|
name
string
|
Name of the reward.
Example:
Reward Name
|
|
object
string
|
The type of the object represented by the JSON
Available values:
reward
|
|
created\_at
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp in ISO 8601 format indicating when the reward was updated.
Example:
2022-10-03T12:24:58.008Z
|
|
parameters
object
|
These are parameters representing a material reward.
| Attributes |
Description |
|
campaign
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Campaign unique ID.
Example:
camp\_13BbZ0kQsNinhqsX3wUts2UP
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
|
|
type
string
|
Defines the type of the campaign.
|
|
|
product
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
Example:
prod\_0b7d7dfb05cbe5c616
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
Example:
sku\_0a41e31c7b41c28358
|
|
|
coin
object
|
Defines the ratio by mapping the number of loyalty points in
points\_ratio
to a predefined cash amount in
exchange\_ratio.
| Attributes |
Description |
|
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.
|
|
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward.
|
|
type
string
|
Reward type.
Available values:
CAMPAIGN,
COIN,
MATERIAL
|
Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
-
Voucher Base
-
Voucher Holder
Promotion Tier
| 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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-02-09T09:20:05.603Z
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
action
object
|
Contains details about the discount applied by the promotion tier.
| Attributes |
Description |
|
discount
|
See:
Discount
|
|
|
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.
|
|
promotion\_id
string
|
Promotion unique ID.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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 the 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.
-
true
indicates an
active
promotion tier
-
false
indicates an
inactive
promotion tier
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
summary
object
|
Contains statistics about promotion tier redemptions and orders.
| Attributes |
Description |
|
redemptions
object
|
Contains statistics about promotion tier redemptions.
| Attributes |
Description |
|
total\_redeemed
integer
|
Number of times the promotion tier was redeemed.
|
|
|
orders
object
|
Contains statistics about orders related to the promotion tier.
| Attributes |
Description |
|
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 the object represented by JSON. This object stores information about the promotion tier.
|
|
validation\_rule\_assignments
|
See:
Validation Rule Assignments List
|
|
category\_id
string
|
Promotion tier category ID.
Example:
cat\_0c9da30e7116ba6bba
|
|
categories
array
|
Array of
Category
|
Simple Product
| Attributes |
Description |
|
id
string
|
Unique product ID.
|
|
source\_id
string
|
Product source id.
|
|
name
string
|
Product name.
|
Simple Sku
| Attributes |
Description |
|
id
string
|
Unique sku ID.
|
|
source\_id
string
|
Sku source id.
|
|
sku
string
|
Sku name.
|
Reward type
One of:
-
Digital
-
Pay with Points
-
Material
Loyalty Tier Base
| Attributes |
Description |
|
name
string
|
Loyalty Tier name.
|
|
earning\_rules
object
|
Contains a list of earning rule IDs and their points mapping for the given earning rule.
|
|
rewards
object
|
Contains a list of reward IDs and their points mapping for the given reward.
|
|
points
object
|
Defines range of loyalty tier in points.
| Attributes |
Description |
|
from
integer
|
Bottom points threshold value.
|
|
to
integer
|
Top points threshold value.
|
|
Loyalty Tier Expiration
| Attributes |
Description |
|
customer\_id
string
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
campaign\_id
string
|
Unique campaign ID, assigned by Voucherify.
Example:
camp\_rRsfatlwN7unSeUIJDCYedal
|
|
tier\_id
string
|
Unique tier ID, assigned by Voucherify.
|
|
start\_date
string
|
Activation timestamp defines when the loyalty tier starts to be active in ISO 8601 format. Loyalty tier is inactive before this date.
|
|
expiration\_date
string
|
Expiration timestamp defines when the loyalty tier expires in ISO 8601 format. Loyalty tier is inactive after this date.
|
|
created\_at
string
|
Timestamp representing the date and time when the loyalty tier was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
EarningRuleBase
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the earning rule object.
|
|
created\_at
string
|
Timestamp representing the date and time when the earning rule was created. The value is shown in the ISO 8601 format.
|
|
loyalty
|
One of:
-
Define fixed amount of points
-
Calculate points proportionally
|
|
event
|
Defines the event which triggers the earning rule to add points to a loyalty card.
Earning Rule Event
|
|
custom\_event
object
|
Contains details about the custom event.
| Attributes |
Description |
|
schema\_id
string
|
Unique identifier of the custom event schema
|
|
|
segment
object
|
Contains the ID of a customer segment. Required for the
customer.segment.entered
option in the event.
| Attributes |
Description |
|
id
string
|
Contains a unique identifier of a customer segment. Assigned by the Voucherify API.
|
|
|
loyalty\_tier
object
|
Defines the tier associated with the earning rule definition.
| Attributes |
Description |
|
id
string
|
Unique loyalty tier ID associated with the earning rule.
-
**ANY**
: any loyalty tier within the campaign
Example:
ltr\_pudTGWasuIqxdiDM0go31OV1
|
|
|
pending\_points
object
|
Defines the configuration for pending points. Pending points can be used only with the
order.paid
event.
| Attributes |
Description |
|
period\_type
string
|
Defines the type of the period during which the points are in the pending state. Currently, only
DAY
value is accepted.
Available values:
DAY
|
|
period\_value
integer
|
Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90.
|
|
|
source
object
|
Contains the custom earning rule name and parent campaign.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
object\_id
string
|
A unique campaign identifier assigned by the Voucherify API.
|
|
object\_type
string
|
Defines the object associated with the earning rule. Defaults to
campaign.
Available values:
campaign
|
|
|
object
string
|
The type of the object represented by JSON. Default is earning\_rule.
Available values:
earning\_rule
|
|
automation\_id
string
|
For internal use by Voucherify.
|
|
start\_date
string
|
Start date defines when the earning rule starts to be active. Activation timestamp is presented in the ISO 8601 format. The earning rule is inactive before this date. If you do not define the start date for an earning rule, it will inherit the campaign start date by default.
|
|
expiration\_date
string
|
Expiration date defines when the earning rule expires. Expiration timestamp is presented in the ISO 8601 format. The earning rule is inactive after this date. If you do not define the expiration date for an earning rule, it will inherit the campaign expiration date by default.
|
|
validity\_timeframe
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
metadata
object
|
The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format.
|
|
expiration\_rules
|
See:
Earning Rule Expiration Rules
|
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
Simple Order Item
| Attributes |
Description |
|
id
string
|
Unique identifier of the order line item.
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
order\_item.
Available values:
order\_item
|
|
source\_id
string
|
The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
|
|
related\_object
string
|
Used along with the
source\_id
property, can be set to either SKU or product.
Available values:
product,
sku
|
|
product\_id
string
|
Unique identifier of the product. It is assigned by Voucherify.
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
|
|
quantity
integer
|
Quantity of the particular item in the cart.
|
|
applied\_quantity
integer
|
Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
applied\_quantity\_amount
integer
|
Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
discount\_quantity
integer
|
Number of discounted items.
|
|
applied\_discount\_quantity
integer
|
Number of the discounted items applied in the transaction.
|
|
amount
integer
|
Total amount of the order item (price \* quantity).
|
|
discount\_amount
integer
|
Sum of all order-item-level discounts applied to the order.
|
|
applied\_discount\_amount
integer
|
Order-level discount amount applied in the transaction.
|
|
price
integer
|
Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
|
Gift Card Transactions Type
Transaction types concerning gift card credits.
Available values:
CREDITS\_REDEMPTION,
CREDITS\_REFUND,
CREDITS\_ADDITION,
CREDITS\_REMOVAL
Loyalty Card Transactions Type
Transaction types concerning loyalty points.
Available values:
PENDING\_POINTS\_ACTIVATION,
POINTS\_ACCRUAL,
POINTS\_REDEMPTION,
POINTS\_REFUND,
POINTS\_ADDITION,
POINTS\_REMOVAL,
POINTS\_EXPIRATION,
POINTS\_TRANSFER\_IN,
POINTS\_TRANSFER\_OUT
Pending Point Details
| Attributes |
Description |
|
loyalty\_tier
object
|
The loyalty tier that is mapped for the earning rule and used in the pending point transaction.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
holder\_loyalty\_tier
object
|
Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was at the moment pending points were created.
| Attributes |
Description |
|
id
string
|
Unique identifier of the loyalty tier, assigned by Voucherify.
|
|
name
string
|
User-defined name of the loyalty tier.
|
|
|
event
object
|
Details about the event that created pending points.
| Attributes |
Description |
|
id
string
|
Unique event identifier, assigned by Voucherify.
|
|
type
string
|
Type of the event that triggered the creation of pending points.
Available values:
customer.order.paid
|
|
group\_id
string
|
Unique identifier of the request that triggered the event, assigned by Voucherify.
|
|
entity\_id
string
|
Unique identifier of the entity that triggered the event, assigned by Voucherify. For pending points, it is the
customer\_id
of the customer who paid for the order.
|
|
created\_at
string
|
Timestamp representing the date and time when the event occurred. The value is shown in the ISO 8601 format.
|
|
category
string
|
Type of the event.
Available values:
ACTION,
EFFECT
|
|
event\_source
|
See:
Event Source
|
|
|
earning\_rule
object
|
Contains information about the earning rule.
| Attributes |
Description |
|
id
string
|
Unique identifier of an earning rule, assigned by Voucherify.
|
|
source
object
|
Contains the custom earning rule name.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
|
|
order
object
|
Details about the order that caused adding pending points.
| Attributes |
Description |
|
id
string
|
Unique order identifier, assigned by Voucherify.
|
|
source\_id
string,
null
|
User-defined order identifier.
|
|
List Publications Item Base
| Attributes |
Description |
|
id
string
|
Unique publication ID, assigned by Voucherify.
Example:
pub\_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the
publication.
Available values:
publication
|
|
created\_at
string
|
Timestamp representing the date and time when the publication was created. The value is shown in the 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.
| Attributes |
Description |
|
source\_type
string
|
Defines the type of the distribution source.
|
|
source\_id
string
|
Unique identifier of the distribution source.
|
|
distribution\_id
string
|
Unique identifier of the distribution.
|
|
|
channel
string
|
How the publication was originated. It can be your own custom channel or an example value provided here.
|
|
source\_id
string,
null
|
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.
|
|
customer
|
See:
Customer With Summary Loyalty Referrals
|
|
vouchers
array
|
Contains the voucher IDs that was assigned by Voucherify.
|
|
vouchers\_id
array
|
Contains the unique internal voucher IDs that was assigned by Voucherify.
|
List Publications Item Voucher
| Attributes |
Description |
|
code
string
|
Voucher code.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
voucher
|
|
campaign
string
|
Campaign name
|
|
gift
|
Gift object response
Gift
|
|
loyalty\_card
object
|
Defines the loyalty card details.
|
|
discount
|
See:
Discount
|
|
is\_referral\_code
boolean
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
Simple Promotion Tier
| Attributes |
Description |
|
id
string
|
Unique promotion tier ID.
Example:
promo\_63fYCt81Aw0h7lzyRkrGZh9p
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
id
string
|
Unique campaign ID.
|
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a promotion tier. The metadata object stores all custom attributes assigned to the promotion tier.
|
Simple Promotion Stack
| Attributes |
Description |
|
id
string
|
Unique identifier of the promotion stack.
|
|
name
string
|
Name of the promotion stack.
|
|
category\_id
string
|
Unique identifier of the category of the promotion stack.
|
|
campaign
object
|
Represents simplified promotion stack campaign data.
| Attributes |
Description |
|
id
string
|
Unique identifier of the campaign.
|
|
|
tiers
object
|
Contains the tier configuration. A promotion stack can include up to 30 tiers.
| Attributes |
Description |
|
ids
array
|
Contains the list of tiers in a pre-defined sequence.
|
|
hierarchy\_mode
string
|
Available values:
MANUAL
|
|
Reward Assignment
All of:
-
Reward Assignment Base
-
Digital or Material Reward - Parameters
Customer Summary Redemptions
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
redeemed\_amount
integer
|
Total amount of gift card credits redeemed by customer. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
amount\_to\_go
integer
|
Remaining gift card balance across all gift cards. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
|
loyalty\_card
object
|
Summary of loyalty points.
| Attributes |
Description |
|
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.
|
|
Customer Summary Orders
| Attributes |
Description |
|
total\_amount
integer
|
The total amount spent by the customer. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
total\_count
integer
|
Total number of orders made by the customer.
|
|
average\_amount
integer
|
Average amount spent on orders.
total\_amount
÷
total\_count.
The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
last\_order\_amount
integer
|
Amount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
|
Campaign Loyalty Card
| Attributes |
Description |
|
points
integer
|
The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card.
|
|
expiration\_rules
object
|
Defines the loyalty point expiration rule. This expiration rule applies when there are no
expiration\_rules
defined for an earning rule.
| Attributes |
Description |
|
period\_type
string
|
Type of period. Can be set for
MONTH
or
FIXED\_DAY\_OF\_YEAR.
MONTH
requires the
period\_value
field.
FIXED\_DAY\_OF\_YEAR
requires the
fixed\_month
and
fixed\_day
fields.
Available values:
FIXED\_DAY\_OF\_YEAR,
MONTH
|
|
period\_value
integer
|
Value of the period. Required for the
period\_type: MONTH.
|
|
rounding\_type
string
|
Type of rounding of the expiration period. Optional for the
period\_type: MONTH.
Available values:
END\_OF\_MONTH,
END\_OF\_QUARTER,
END\_OF\_HALF\_YEAR,
END\_OF\_YEAR,
PARTICULAR\_MONTH
|
|
rounding\_value
integer
|
Value of rounding of the expiration period. Required for the
rounding\_type.
|
|
fixed\_month
integer
|
Determines the month when the points expire;
1
is January,
2
is February, and so on. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
|
fixed\_day
integer
|
Determines the day of the month when the points expire. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
|
Code Config
| Attributes |
Description |
|
length
number
|
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.
|
|
initial\_count
integer
|
Internal value, does not change anything if provided.
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Product
This is an object representing a product.
This entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.
All of:
-
Product without Skus Object
-
SKU Object
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
Example:
sku\_0b1621b319d248b79f
|
|
source\_id
string,
null
|
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,
null
|
Unique user-defined SKU name.
Example:
Large Pink Shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed as
10000.
|
|
currency
string,
null
|
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,
null
|
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. It can be used to create product collections.
|
|
created\_at
string
|
Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:36:30.187Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:55:09.137Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
SKU.
Available values:
sku
|
Voucher Base
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
Gift Card Campaign
|
|
campaign\_id
string
|
Assigned by the Voucherify API, identifies the voucher's parent campaign.
Example:
camp\_FNYR4jhqZBM9xTptxDGgeNBV
|
|
category
string
|
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
|
|
discount
|
See:
Discount
|
|
gift
object
|
Object representing gift parameters. Child attributes are present only if
type
is
GIFT\_VOUCHER.
Defaults to
null.
| Attributes |
Description |
|
amount
integer
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
Example:
10000
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
balance
integer
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
active
boolean,
null
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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
|
See:
Voucher Assets
|
|
is\_referral\_code
boolean,
null
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referring person.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
|
publish
object
|
Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//redemptions
Example:
/v1/vouchers/WVPblOYX/redemptions?page=1\&limit=10
|
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Validation Rule Assignments List
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of validation rule assignments.
|
Digital
| Attributes |
Description |
|
campaign
object
|
Objects stores information about the campaign related to the reward.
| Attributes |
Description |
|
id
string
|
Unique campaign ID, assigned by Voucherify.
|
|
balance
integer
|
The number of points to be added to a loyalty card or the amount to be added to the current balance on the gift card.
For gift cards, the value is multiplied by 100 to precisely represent 2 decimal places. For example, \$100 amount is written as 10000.
|
|
type
string
|
Campaign type.
Available values:
DISCOUNT\_COUPONS,
GIFT\_VOUCHERS,
LOYALTY\_PROGRAM
|
|
Pay with Points
| Attributes |
Description |
|
coin
object
|
Defines the ratio by mapping the number of loyalty points in points\_ratio to a predefined cash amount in exchange\_ratio.
| Attributes |
Description |
|
exchange\_ratio
number
|
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
object
|
Contains information about the product given as a reward.
| Attributes |
Description |
|
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
|
|
MappingPoints
One of:
-
MappingMultiply
-
MappingFixed
Define fixed amount of points
| Attributes |
Description |
|
type
string
|
The number of points to be added to the loyalty card.
Available values:
FIXED
|
|
points
integer
|
Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
Calculate points proportionally
One of:
-
Define amount of points proportional to the order
-
Define amount of points proportional to order items
-
Define amount of points proportional to customer metadata
-
Earning Rule Proportional Custom Event
Earning Rule Event
Earning Rule Expiration Rules
| Attributes |
Description |
|
period\_type
string
|
Type of period. Can be set for
MONTH
or
FIXED\_DAY\_OF\_YEAR.
MONTH
requires the
period\_value
field.
FIXED\_DAY\_OF\_YEAR
requires the
fixed\_month
and
fixed\_day
fields.
Available values:
FIXED\_DAY\_OF\_YEAR,
MONTH
|
|
period\_value
integer
|
Value of the period. Required for the
period\_type: MONTH.
|
|
rounding\_type
string
|
Type of rounding of the expiration period. Optional for the
period\_type: MONTH.
Available values:
END\_OF\_MONTH,
END\_OF\_QUARTER,
END\_OF\_HALF\_YEAR,
END\_OF\_YEAR,
PARTICULAR\_MONTH
|
|
rounding\_value
integer
|
Value of rounding of the expiration period. Required for the
rounding\_type.
|
|
fixed\_month
integer
|
Determines the month when the points expire;
1
is January,
2
is February, and so on. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
|
fixed\_day
integer
|
Determines the day of the month when the points expire. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
Reward Assignment Base
| Attributes |
Description |
|
id
string
|
Unique reward assignment ID, assigned by Voucherify.
Example:
rewa\_PbIRoMXpwe5QhobW4JKu0VjH
|
|
reward\_id
string
|
Associated reward ID.
Example:
rew\_C7wS9eHFDN4CIbXI5PpLSkGY
|
|
created\_at
string
|
Timestamp representing the date and time when the reward assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-08-11T14:49:22.586Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the reward assignment was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-11T16:01:34.885Z
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the reward assignment.
Available values:
reward\_assignment
|
|
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.
Available values:
campaign
|
Digital or Material Reward - Parameters
| Attributes |
Description |
|
parameters
object
|
Defines the cost of the reward.
| Attributes |
Description |
|
loyalty
object
|
Defines the equivalent points value of the reward.
| Attributes |
Description |
|
points
integer
|
The number of points required to redeem the reward.
|
|
auto\_redeem
boolean,
null
|
Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value
true
means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value
true.
|
|
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Product without Skus Object
| Attributes |
Description |
|
id
string
|
Unique product ID assigned by Voucherify.
Example:
prod\_0b1da8105693710357
|
|
source\_id
string,
null
|
Unique product source ID.
Example:
productSourceID16
|
|
name
string,
null
|
Unique user-defined product name.
Example:
T-shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed 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. It can be used to create product collections.
|
|
image\_url
string,
null
|
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](https://images.com/original.jpg)
|
|
created\_at
string
|
Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.
Example:
2022-05-23T06:52:55.008Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-23T09:24:07.405Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the product.
Available values:
product
|
Skus List For Product
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of SKUs in the product.
|
Voucher Assets
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D)
|
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
MappingMultiply
| Attributes |
Description |
|
type
string
|
Type of calculation.
Available values:
MULTIPLY
|
|
multiplier
number
|
Multiplication factor used to multiply the points to obtain the mapped points.
|
MappingFixed
| Attributes |
Description |
|
type
string
|
Type of calculation.
Available values:
CUSTOM
|
|
points
integer
|
Fixed number of points to be applied.
|
Define amount of points proportional to the order
One of:
-
Order Amount
-
Order Total Amount
-
Order Metadata
Define amount of points proportional to order items
One of:
-
Order Items Quantity
-
Order Items Amount
-
Order Items Subtotal Amount
Define amount of points proportional to customer metadata
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
CUSTOMER\_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)
Available values:
CUSTOMER\_METADATA
|
|
customer
object
|
| Attributes |
Description |
|
metadata
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.
| Attributes |
Description |
|
every
integer
|
For how many increments of the customer metadata property to grant points for.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
property
string
|
Customer metadata property.
|
|
|
Earning Rule Proportional Custom Event
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
CUSTOM\_EVENT\_METADATA: Custom event metadata (X points for every Y in metadata attribute).
Available values:
CUSTOM\_EVENT\_METADATA
|
|
custom\_event
object
|
| Attributes |
Description |
|
metadata
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.
| Attributes |
Description |
|
every
integer
|
For how many increments of the customer metadata property to grant points for.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
property
string
|
Custom event metadata property.
|
|
|
Order Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_AMOUNT
: Pre-discount order amount (X points for every Y spent excluding discounts)
Available values:
ORDER\_AMOUNT
|
|
order
object
|
| Attributes |
Description |
|
amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
|
Order Total Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_TOTAL\_AMOUNT
: Total order amount (X points for every Y spent including discount)
Available values:
ORDER\_TOTAL\_AMOUNT
|
|
order
object
|
| Attributes |
Description |
|
total\_amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
|
Order Metadata
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_METADATA
: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)
Available values:
ORDER\_METADATA
|
|
order
object
|
Defines the formula for calculating points proportionally.
| Attributes |
Description |
|
metadata
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.
| Attributes |
Description |
|
every
integer
|
For how many increments of the order metadata property to grant points for.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
property
string
|
Order metadata property.
|
|
|
Order Items Quantity
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_ITEMS\_QUANTITY
: Quantity of items defined in the
order\_items.quantity.applicable\_to
array or
order\_items.quantity.object
&
.id
(X points for every Y items excluding free items).
Available values:
ORDER\_ITEMS\_QUANTITY
|
|
order\_items
object
|
| Attributes |
Description |
|
quantity
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
object
string
|
Type of object which will be covered by the earning rule. This is required together with
id.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. This is required together with
object.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
applicable\_to
array
|
Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by
object
and
id
to define only one object.
Array of:
| Attributes |
Description |
|
object
string
|
Type of object which will be covered by the earning rule.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
|
|
Order Items Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_ITEMS\_AMOUNT; Pre-discount amount spent on items defined in the
order\_items.quantity.applicable\_to
array or
order\_items.quantity.object
&
.id
(X points for every Y spent on items excluding discounts)
Available values:
ORDER\_ITEMS\_AMOUNT
|
|
order\_items
object
|
| Attributes |
Description |
|
amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
object
string
|
Type of object which will be covered by the earning rule. This is required together with
id.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. This is required together with
object.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
applicable\_to
array
|
Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by
object
and
id
to define only one object.
Array of:
| Attributes |
Description |
|
object
string
|
Type of object which will be covered by the earning rule.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
|
|
Order Items Subtotal Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_ITEMS\_SUBTOTAL\_AMOUNT; Amount spent on items defined in the order\_items.subtotal\_amount.object & .id (X points for every Y spent on items including discounts)
Available values:
ORDER\_ITEMS\_SUBTOTAL\_AMOUNT
|
|
order\_items
object
|
| Attributes |
Description |
|
subtotal\_amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
object
string
|
Type of object which will be covered by the earning rule. This is required together with
id.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. This is required together with
object.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
applicable\_to
array
|
Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by
object
and
id
to define only one object.
Array of:
| Attributes |
Description |
|
object
string
|
Type of object which will be covered by the earning rule.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
|
|
# Customer Object
Source: https://docs.voucherify.io/api-reference/customers/customer-object
Customer With Summary Loyalty Referrals
All of:
-
Customer Response Data
| Attributes |
Description |
|
id
string
|
The ID of an existing customer that will be linked to redemption in this request.
|
|
source\_id
string
|
A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
|
|
summary
|
Customer Summary
|
|
loyalty
|
Customer Loyalty
|
|
referrals
|
Customer Referrals
|
|
system\_metadata
object
|
Object used to store system metadata information.
|
|
created\_at
string
|
Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.
Example:
2022-08-30T06:32:07.380Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-31T06:32:07.380Z
|
|
assets
object
|
Contains information about the customer's cockpit.
⚠️ Warning: Customer cockpits were removed. The customer cockpit URLs redirect to customer preference center.
| Attributes |
Description |
|
cockpit\_url
string
|
URL address to customer preference center. Previously, a customer's cockpit URL address.
|
|
cockpit\_preference\_center\_url
string
|
URL address to customer preference center.
|
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
-
Customer Base
Customer Summary
Customer Loyalty
| Attributes |
Description |
|
points
integer
|
Customer's loyalty points minus expired for all loyalty cards which the customer has.
|
|
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.
| Attributes |
Description |
|
\[propertyName]
object
|
Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.
| Attributes |
Description |
|
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.
|
|
|
Customer Referrals
| Attributes |
Description |
|
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:
Customer Referrals Campaigns Item
| Attributes |
Description |
|
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
Example:
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
|
|
Customer Base
| Attributes |
Description |
|
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. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
|
|
birthday
string
|
Deprecated.
Customer's birthdate; format YYYY-MM-DD.
|
|
birthdate
string
|
Customer's birthdate; format YYYY-MM-DD.
|
|
address
object,
null
|
Customer's address.
| Attributes |
Description |
|
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.
|
|
|
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.
|
Customer Summary Redemptions
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
redeemed\_amount
integer
|
Total amount of gift card credits redeemed by customer. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
amount\_to\_go
integer
|
Remaining gift card balance across all gift cards. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
|
loyalty\_card
object
|
Summary of loyalty points.
| Attributes |
Description |
|
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.
|
|
Customer Summary Orders
| Attributes |
Description |
|
total\_amount
integer
|
The total amount spent by the customer. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
total\_count
integer
|
Total number of orders made by the customer.
|
|
average\_amount
integer
|
Average amount spent on orders.
total\_amount
÷
total\_count.
The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
last\_order\_amount
integer
|
Amount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
|
# Delete Customer
Source: https://docs.voucherify.io/api-reference/customers/delete-customer
/openapi/customers.json delete /v1/customers/{customerId}
This method deletes a customer.
# Delete Customer Permanently
Source: https://docs.voucherify.io/api-reference/customers/delete-customer-permanently
/openapi/customers.json post /v1/customers/{customerId}/permanent-deletion
The organization user can remove consumer data permanently from the Voucherify system by using this API method. It deletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.
# Get Customer
Source: https://docs.voucherify.io/api-reference/customers/get-customer
/openapi/customers.json get /v1/customers/{customerId}
Retrieves details of a given customer by customer's `id` or `source_id`.
# Import and Update Customers using CSV
Source: https://docs.voucherify.io/api-reference/customers/import-and-update-customers-using-csv
/openapi/customers.json post /v1/customers/importCSV
This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas.
## Request Example
```cURL
curl -X **POST** \
https://api.voucherify.io/v1/customers/importCSV \
-F file=@/path/to/customers.csv \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c"
```
## CSV File Format
The CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.
Standard customer fields mapping
**No spaces allowed in field names** `Id`, `Name`, `Email`, `Phone`, `Birthdate`, `Source_id`, `Address_line_1`, `Address_line_2`, `Address_Postal_Code`, `Address_City`, `Address_State`, `Address_Country`, `Description`, `Metadata_name_1`, `Metadata_name_2`
## Update Customers using CSV
If you would like to update customer's data, you can do it using the CSV file with new data. However, remember to include a `source_id` in your CSV file to manage the update successfully.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# List Customer Activities
Source: https://docs.voucherify.io/api-reference/customers/list-customer-activities
/openapi/customers.json get /v1/customers/{customerId}/activities
Deprecated
This endpoint represents the deprecated version of the API responsible for listing customer activities and we do not recommend using it. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
Retrieve customer activities.
# List Customer Activity
Source: https://docs.voucherify.io/api-reference/customers/list-customer-activity
/openapi/customers.json get /v1/customers/{customerId}/activity
Retrieves activity details of a given customer by customer's `id` or `source_id`.
# List Customers
Source: https://docs.voucherify.io/api-reference/customers/list-customers
/openapi/customers.json get /v1/customers
Returns a list of customers.
# List Customer's Redeemables
Source: https://docs.voucherify.io/api-reference/customers/list-customers-redeemables
/openapi/customers.json get /v1/customers/{customerId}/redeemables
Retrieves all the redeemables that have been assigned to the customer.
To use this endpoint, you must have the following permissions:
- Read Customers (`customers.details.read`)
# List Customer's Segments
Source: https://docs.voucherify.io/api-reference/customers/list-customers-segments
/openapi/customers.json get /v1/customers/{customerId}/segments
Returns the list of segments IDs to which the customer belongs to.
If you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.
# Update Customer
Source: https://docs.voucherify.io/api-reference/customers/update-customer
/openapi/customers.json put /v1/customers/{customerId}
Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
# Update Customers in Bulk
Source: https://docs.voucherify.io/api-reference/customers/update-customers-in-bulk
/openapi/customers.json post /v1/customers/bulk/async
Updates customers in one asynchronous operation.
The request can include up to **10 MB** of data.
The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:
- The status of your request (in queue, in progress, done, or failed)
- Resources that failed to be updated
- The report file with details about the update
If a customer object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.
This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
# Update Customers' Metadata in Bulk
Source: https://docs.voucherify.io/api-reference/customers/update-customers-metadata-in-bulk
/openapi/customers.json post /v1/customers/metadata/async
Updates metadata parameters for a list of customers. Every resource in the list will receive the metadata defined in the request.
The request can include up to **10 MB** of data.
The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:
- The status of your request (in queue, in progress, done, or failed)
- Resources that failed to be updated
- The report file with details about the update
If a customer object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.
This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
# Distribution webhooks
Source: https://docs.voucherify.io/api-reference/distribution-webhooks
Use webhooks to get notified about distribution events in Voucherify
Distribution-based webhooks in Voucherify let your application automatically receive notifications related to distribution events. They help you track the results of distributions and quickly respond when certain actions occur. For example, your application can be notified when a voucher is successfully published, a scheduled campaign message is delivered, or when a customer enters or leaves a specific customer segment.
## Configuring distribution webhooks
1. In Voucherify dashboard, go to Distributions in the Engagement section.
2. Click Create distribution.
3. Select the appropriate [trigger](#webhooks-available-in-distributions "Distribution webhooks") that creates a send out.
4. In Action, define what kind of distribution action you want to create.
5. In Channels, add Webhook. You can add many channels within one distribution.
6. In the webhook channel, provide the event name, URL, and any optional HTTP headers.
7. Select the attributes to add them to the webhook payload. Optionally, map the attributes to your own keys.
To edit, pause, activate, or delete a distribution, click the three dots icon located on the far right of each row in the Distributions list view.
**You can also add distribution webhooks while creating a loyalty or referral programs. The process follows similar pattern.**
## Payload designer
Use the **Raw payload** checkbox to choose if the webhook payload is sent at the root level or inside the `data` object. The Show output panel displays an example payload and updates dynamically based on the selected trigger context, so you see only the variables that apply to that specific trigger type.
You can paste any existing payload or write it from scratch. Each key in the payload can have a value that is static, dynamic, or nested:
* Static values are fixed values you define, such as text, numbers, or boolean.
* Dynamic values come from Voucherify keys in the webhook payload. Use double curly braces `{{}}` to search for Voucherify keys. You can also mix static and dynamic values, for example `"Hello {{customer.name}}"`.
* Nested objects can be created with dots in the key name, such as `{{order.status}}`.
If you want a value to be a string, wrap it in quotes `("")`. When the type of a value is unknown, also wrap it in quotes `("")` to ensure it is treated as a string.
Here are two examples showing how the sent payload changes between the output and raw payload:
```json Sample output theme={null}
{
"id": "whs_000000000000000000",
"project_id": "proj_YaEcEOLM",
"created_at": "2000-01-01T00:00:00.000Z",
"type": "",
"source": {
"id": "distr_000000000000000000",
"object": "distribution",
"target_url": "https://00000000-0000-0000-0000-000000000000"
},
"event": {
"id": "evcus_000000000000000000",
"type": "customer.publication.succeeded",
"created_at": "2000-01-01T00:00:00.000Z",
"entity_id": "entity_id_000000000000000000",
"group_id": "v-000000000000000000",
"event_source": {
"channel": "INTERNAL"
}
},
"data": {
"To": "john.smith@example.com",
"From": "examplepayload@yourcompany.com",
"Subject": "Thank you for your order, John Smith",
"Body": "Hello John Smith. Here's your discount code: SUMMER-2024-A7B9."
}
}
```
```json Raw payload theme={null}
{
"To": "john.smith@example.com",
"From": "examplepayload@yourcompany.com",
"Subject": "Thank you for your order, John Smith",
"Body": "Hello John Smith. Here's your discount code: SUMMER-2024-A7B9."
}
```
Available Voucherify webhook keys
The available keys supported by Voucherify are limited to a given distribution event that is used in the webhook. For example, if you create a webhook payload for the [Customer entered segment](/api-reference/customer/segment-entered), you can use all the keys available in that event, like `customer.name` or `segment.name`. However, you can't use objects that aren't available in that webhook, like `redemption.date`.
Read [Webhooks available in Distributions](#webhooks-available-in-distributions) to learn which webhooks are available. Go to specific webhook pages to learn more about their payloads.
### Example: Customer summary with dynamic values
This payload builds a customer summary. All values are taken dynamically from the webhook.
```json theme={null}
{
"customer_profile": {
"ID": "{{customer.id}}",
"name": "{{customer.name}}",
"email": "{{customer.email}}"
}
}
```
### Example: Order confirmation with mixed values
This payload mixes static and dynamic values. The currency is fixed, while the order details and greeting come from Voucherify.
```json theme={null}
{
"order": {
"orderId": "{{order.id}}",
"total": {{order.total_amount}},
"currency": "USD",
"message": "Thank you for your order, {{customer.name}}!"
}
}
```
## Re-enabling a webhook
To re-enable a paused webhook:
1. Go to the Distribution Manager.
2. Click the distribution that has been paused.
3. Click the set live icon in the upper right corner.
## Webhooks available in Distributions
These webhooks are triggered by the events which cause distribution.
Some distribution events, for example Customer entered segment, have different purposes:
* Notify customers about promotion
* Send and publish unique codes from campaign
* Send plain message to customers
The table below shows which distributions support webhooks:
| Related Activity | Event | Notify customers about promotion | Send and publish unique codes from campaign | Send plain message to customers |
| ----------------------------- | --------------------------------------- | -------------------------------- | ------------------------------------------- | ------------------------------- |
| Segment | Customer entered segment | ✅ | ✅ | ✅ |
| Segment | Customer left segment | ✅ | ✅ | ✅ |
| Cart | Order update | ✅ | ✅ | ✅ |
| Cart | Order has been paid | ✅ | ✅ | ✅ |
| Cart | Order creation | ✅ | ✅ | ✅ |
| Cart | Order cancelled | ✅ | ✅ | ✅ |
| Voucher | Gift credits adjusted | ❌ | ❌ | ✅ |
| Voucher | Loyalty points adjusted | ❌ | ❌ | ✅ |
| Voucher | Loyalty points expired | ❌ | ❌ | ✅ |
| Voucher | Loyalty pending points adjusted | ❌ | ❌ | ✅ |
| Voucher | Loyalty pending points updated | ❌ | ❌ | ✅ |
| Voucher | Loyalty pending points activated | ❌ | ❌ | ✅ |
| Voucher | Loyalty pending points canceled | ❌ | ❌ | ✅ |
| Voucher | Voucher redeemed | ❌ | ❌ | ✅ |
| Voucher | Voucher redemption rolled back | ❌ | ❌ | ✅ |
| Customer rewards | Reward redemption | ❌ | ❌ | ✅ |
| Manual messages | One or bulk messages | ✅ | ✅ | ❌ |
| Publishing codes | Successfully published | ❌ | ❌ | ✅ |
| Custom events | Custom event | ✅ | ✅ | ✅ |
| Loyalty tier related activity | Customer entered loyalty tier structure | ❌ | ❌ | ✅ |
| Loyalty tier related activity | Customer left loyalty tier structure | ❌ | ❌ | ✅ |
| Loyalty tier related activity | Customer loyalty tier upgraded | ❌ | ❌ | ✅ |
| Loyalty tier related activity | Customer loyalty tier downgraded | ❌ | ❌ | ✅ |
| Loyalty tier related activity | Customer loyalty tier prolonged | ❌ | ❌ | ✅ |
| Loyalty tier related activity | Customer rewarded loyalty points | ❌ | ❌ | ✅ |
| Referral related activity | Customer was referred | ❌ | ❌ | ✅ |
* Custom events:
* [Custom event](/api-reference/customer/custom-event "Customer custom event documentation")
* Segment related activities:
* [Customer entered segment](/api-reference/customer/segment-entered "Customer entered segment event documentation")
* [Customer left segment](/api-reference/customer/segment-left "Customer left segment event documentation")
* Manual messages:
* Notify customers about promotion – covered by [the MANUAL\_DISTRIBUTION\_SCHEDULE event](/api-reference/distribution/manual-distribution-schedule "Manual distribution schedule event documentation")
* Send and publish unique codes from a campaign – covered by [the MANUAL\_DISTRIBUTION\_SCHEDULE event](/api-reference/distribution/manual-distribution-schedule "Manual distribution schedule event documentation")
* Send a plain message to customers – does not support webhooks as a distribution channel
* Cart related activities:
* [Order updated](/api-reference/customer/order-updated "Order updated event documentation")
* [Order paid](/api-reference/customer/order-paid "Order paid event documentation")
* [Order created](/api-reference/customer/order-created "Order created event documentation")
* [Order canceled](/api-reference/customer/order-canceled "Order canceled event documentation")
* Publishing codes:
* [Successfully published](/api-reference/customer/publication-succeeded "Code published event documentation")
* Voucher related activities:
* [Gift credits added](/api-reference/customer/voucher-gift-balance-added "Gift credits added event documentation")
* [Loyalty points added](/api-reference/customer/voucher-loyalty-card-points-added "Loyalty points added event documentation")
* [Loyalty card points expired](/api-reference/customer/voucher-loyalty-card-points-expired "Customer loyalty card points expired event documentation")
* [Loyalty pending points added](/api-reference/customer/voucher-loyalty-card-pending-points-added "Customer loyalty card pending points added")
* [Loyalty pending points updated](/api-reference/customer/voucher-loyalty-card-pending-points-updated "Voucher loyalty card pending points update event documentation")
* [Loyalty pending points activated](/api-reference/customer/voucher-loyalty-card-pending-points-activated "Customer loyalty card pending points activated")
* [Loyalty pending points canceled](/api-reference/customer/voucher-loyalty-card-pending-points-canceled "Customer loyalty card pending points canceled")
* [Voucher redeemed](/api-reference/customer/redemption-succeeded "Voucher redeemed event documentation")
* [Voucher redemption rolled back](/api-reference/customer/redemption-rollback-succeeded "Voucher redemption rolled back event documentation")
* Customer rewards:
* [Reward redeemed](/api-reference/customer/rewarded "Customer rewarded documentation")
* Loyalty tier related activities:
* [Customer entered loyalty tier structure](/api-reference/customer/loyalty-tier-joined "Customer entered loyalty tier structure event documentation")
* [Customer left loyalty tier structure](/api-reference/customer/loyalty-tier-left "Customer left loyalty tier structure event documentation")
* [Customer loyalty tier upgraded](/api-reference/customer/loyalty-tier-upgraded "Customer loyalty tier upgraded event documentation")
* [Customer loyalty tier downgraded](/api-reference/customer/loyalty-tier-downgraded "Customer loyalty tier downgraded event documentation")
* [Customer loyalty tier prolonged](/api-reference/customer/loyalty-tier-prolonged "Customer loyalty tier prolonged event documentation")
* [Customer rewarded loyalty points](/api-reference/customer/rewarded-loyalty-points "Customer rewarded loyalty points documentation")
* Referral related activities:
* Customer was referred
### Loyalty and referral campaign Distributions
The following campaigns can also trigger webhook send outs as a distribution:
* Loyalty campaigns:
* [Send loyalty program code](/api-reference/customer/publication-succeeded)
* [Loyalty points gained](/api-reference/customer/rewarded-loyalty-points)
* [Reward redeemed](/api-reference/customer/reward-redemptions-completed)
* Referral campaigns:
* [Send referral code to the referrer](/api-reference/customer/publication-succeeded)
* Customer referred (documentation in progress)
### Distribution webhook payload
The list shows a general structure of a webhook payload set in Distributions. Indented bullet points mean that an object contains further properties or objects.
The list shows the complete, unedited payload. If you customize it with the Payload editor, your data may include fewer fields.
* `id` (`string`): Unique identifier of the send out for this webhook. **Example:** `whs_0e16e42bc6e0c65b57`
* `project_id` (`string`): Unique identifier of the Voucherify project. **Example:** `proj_5T4Rpl4T1nuM`
* `created_at` (`string`): The exact moment when the webhook was created. **Example:** `2024-01-01T11:11:11.111Z`
* `type` (`string`): Displays the name entered in the `Event name` field in the distribution creator.
* `data` (`object`): Payload depends on the event that triggered the webhook send out. Distributions cover the following events:
* [customer.custom\_event](/api-reference/customer/custom-event)
* [customer.loyalty.tier.downgraded](/api-reference/customer/loyalty-tier-downgraded)
* [customer.loyalty.tier.joined](/api-reference/customer/loyalty-tier-joined)
* [customer.loyalty.tier.left](/api-reference/customer/loyalty-tier-left)
* [customer.loyalty.tier.prolonged](/api-reference/customer/loyalty-tier-prolonged)
* [customer.loyalty.tier.upgraded](/api-reference/customer/loyalty-tier-upgraded)
* [customer.order.canceled](/api-reference/customer/order-canceled)
* [customer.order.created](/api-reference/customer/order-created)
* [customer.order.paid](/api-reference/customer/order-paid)
* [customer.order.updated](/api-reference/customer/order-updated)
* [customer.publication.succeeded](/api-reference/customer/publication-succeeded)
* [customer.redemption.rollback.succeeded](/api-reference/customer/redemption-rollback-succeeded)
* [customer.redemption.succeeded](/api-reference/customer/redemption-succeeded)
* customer.referred
* [customer.reward\_redemptions.completed](/api-reference/customer/reward-redemptions-completed)
* [customer.rewarded](/api-reference/customer/rewarded)
* [customer.rewarded.loyalty\_points](/api-reference/customer/rewarded-loyalty-points)
* [customer.segment.entered](/api-reference/customer/segment-entered)
* [customer.segment.left](/api-reference/customer/segment-left)
* [customer.voucher.gift.balance\_added](/api-reference/customer/voucher-gift-balance-added)
* [customer.voucher.loyalty\_card.pending\_points.activated](/api-reference/customer/voucher-loyalty-card-pending-points-activated)
* [customer.voucher.loyalty\_card.pending\_points.added](/api-reference/customer/voucher-loyalty-card-pending-points-added)
* [customer.voucher.loyalty\_card.pending\_points.canceled](/api-reference/customer/voucher-loyalty-card-pending-points-canceled)
* [customer.voucher.loyalty\_card.pending\_points.updated](/api-reference/customer/voucher-loyalty-card-pending-points-updated)
* [customer.voucher.loyalty\_card.points\_added](/api-reference/customer/voucher-loyalty-card-points-added)
* [customer.voucher.loyalty\_card.points\_expired](/api-reference/customer/voucher-loyalty-card-points-expired)
* [manual\_distribution\_schedule](/api-reference/distribution/manual-distribution-schedule)
* `source` (`object`): Contains details about the source of the webhook send out. Properties:
* `id` (`string`): Unique identifier of the distribution that sent the webhook. **Example:** `distr_TrJj0lHV44EMt6HvLa2pyNlHTF`
* `object` (`string`): Determines the type of the object. Available values: `distribution` **Example:** `distribution`
* `target_url` (`string`): The address where the webhook will be sent.
* `event` (`object`): Contains other data of the event that triggered the send out. Properties:
* `id` (`string`): Unique identifier of the event that triggered the send out. **Example:** `evred_1f3611301g3127begb`
* `type` (`string`): Determines the type of the event. **Example:**
* `customer.custom_event`
* `customer.loyalty.tier.downgraded`
* `customer.loyalty.tier.joined`
* `customer.loyalty.tier.left`
* `customer.loyalty.tier.prolonged`
* `customer.loyalty.tier.upgraded`
* `customer.order.canceled`
* `customer.order.created`
* `customer.order.paid`
* `customer.order.updated`
* `customer.publication.succeeded`
* `customer.redemption.rollback.succeeded`
* `customer.redemption.succeeded`
* `customer.referred`
* `customer.reward_redemptions.completed`
* `customer.rewarded`
* `customer.rewarded.loyalty_points`
* `customer.segment.entered`
* `customer.segment.left`
* `customer.voucher.gift.balance_added`
* `customer.voucher.loyalty_card.pending_points.activated`
* `customer.voucher.loyalty_card.pending_points.added`
* `customer.voucher.loyalty_card.pending_points.canceled`
* `customer.voucher.loyalty_card.points_added`
* `customer.voucher.loyalty_card.points_expired`
* `loyalty_card.pending_points.updated`
* `manual_distribution_schedule`
* `created_at` (`string`): The exact moment when the event was created. **Example:** `2024-01-01T11:11:11.111Z`
* `entity_id` (`string`): Unique identifier of the entity that triggered the send out. **Example:** `r_1f3611302bf107befb`
* `group_id` (`string`): Unique identifier of the request that triggered the event. **Example:** `v-1f36113948e50fc4ge`
* `event_source` (`object`): Contains the source of the object that triggered the send out. Properties:
* `channel` (`string`): Determines the channel that triggered the send out. Available values: `USER_PORTAL`, `API`, `CLIENT_API`, `INTERNAL` **Example:** `API`
* `user` (`object`): Defines the user who triggered the event.
* `id` (`string`): ID of the user who triggered the event.
* `api_key` (`object`): Determines the API key used to initiate the send out.
* `name` (`string`): Channel name in the application keys.
* `app_id` (`string`): Contains the application ID from the Voucherify API key pair. **Example:** `1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX`
```JSON Customer voucher redeemed example theme={null}
{
"id": "whs_ID",
"project_id": "proj_ID",
"created_at": "2025-10-16T16:54:11.816Z",
"type": "Voucher-redeemed",
"data": {
"customer": {
"id": "cust_ID",
"name": "Alex Doe",
"email": "alex.doe@doe.alex.io",
"source_id": "4lx-d03",
"metadata": {
"acquisition_channel": "Website"
},
"object": "customer"
},
"order": {
"id": "ord_ID",
"source_id": null,
"status": "PAID",
"customer_id": "cust_ID",
"referrer_id": null,
"amount": 4198,
"applied_discount_amount": 0,
"total_applied_discount_amount": 0,
"total_amount": 4198,
"items": [
{
"id": "ordli_IDD",
"object": "order_item",
"product_id": "prod_IDD",
"quantity": 1,
"amount": 199,
"price": 199,
"subtotal_amount": 199
},
{
"id": "ordli_ID",
"object": "order_item",
"product_id": "prod_ID",
"quantity": 1,
"amount": 3999,
"price": 3999,
"subtotal_amount": 3999
}
],
"metadata": {},
"created_at": "2025-10-16T16:54:11.785Z",
"object": "order"
},
"campaign": {
"id": "camp_ID",
"name": "Autumn-2025",
"campaign_type": "DISCOUNT_COUPONS",
"type": "STANDALONE",
"is_referral_code": false,
"voucher": {
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 100,
"units": null,
"effect": "APPLY_TO_ITEMS"
},
"redemption": {
"quantity": null,
"redeemed_quantity": 0
},
"code_config": {
"pattern": "########",
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"prefix": "",
"postfix": "",
"min_desired": 1
}
},
"auto_join": false,
"join_once": false,
"active": true,
"category_id": null,
"category": null,
"metadata": {},
"start_date": null,
"expiration_date": null,
"description": null,
"created_at": "2025-10-14T08:45:08.857Z",
"updated_at": "2025-10-16T16:51:09.275Z",
"object": "campaign"
},
"voucher": {
"id": "v_ID",
"code": "kUs7oM-cOD3",
"discount": {
"type": "AMOUNT",
"amount_off": 100,
"effect": "APPLY_TO_ITEMS"
},
"type": "DISCOUNT_VOUCHER",
"campaign": "Autumn-2025",
"campaign_id": "camp_ID",
"is_referral_code": false,
"holder_id": "cust_ID",
"category_id": null,
"active": true,
"created_at": "2025-10-16T16:02:41.255Z",
"updated_at": "2025-10-16T16:54:11.804Z",
"redemption": {
"quantity": null,
"redeemed_quantity": 1
},
"start_date": null,
"expiration_date": null,
"metadata": {},
"object": "voucher"
},
"holder": {
"id": "cust_ID",
"name": "Alex Doe",
"email": "alex.doe@doe.alex.io",
"source_id": "4lx-d03",
"metadata": {
"acquisition_channel": "Website"
},
"object": "customer"
},
"promotion_tier": null,
"promotion_stack": null,
"redemption": {
"id": "r_ID",
"customer_id": "cust_ID",
"tracking_id": "track_ID",
"date": "2025-10-16T16:54:11.816Z",
"order": {
"id": "ord_ID",
"source_id": null,
"status": "PAID",
"customer_id": "cust_ID",
"referrer_id": null,
"amount": 4198,
"applied_discount_amount": 0,
"total_applied_discount_amount": 0,
"total_amount": 4198,
"items": [
{
"id": "ordli_IDD",
"object": "order_item",
"product_id": "prod_IDD",
"quantity": 1,
"amount": 199,
"price": 199,
"subtotal_amount": 199
},
{
"id": "ordli_ID",
"object": "order_item",
"product_id": "prod_ID",
"quantity": 1,
"amount": 3999,
"price": 3999,
"subtotal_amount": 3999
}
],
"metadata": {},
"created_at": "2025-10-16T16:54:11.785Z",
"object": "order"
},
"customer": {
"id": "cust_ID",
"name": "Alex Doe",
"email": "alex.doe@doe.alex.io",
"source_id": "4lx-d03",
"metadata": {
"acquisition_channel": "Website"
},
"object": "customer"
},
"result": "SUCCESS",
"status": "SUCCEEDED",
"voucher": {
"id": "v_ID",
"code": "kUs7oM-cOD3",
"discount": {
"type": "AMOUNT",
"amount_off": 100,
"effect": "APPLY_TO_ITEMS"
},
"type": "DISCOUNT_VOUCHER",
"campaign": "Autumn-2025",
"campaign_id": "camp_ID",
"is_referral_code": false,
"holder_id": "cust_ID",
"category_id": null,
"active": true,
"created_at": "2025-10-16T16:02:41.255Z",
"updated_at": "2025-10-16T16:54:11.804Z",
"redemption": {
"quantity": null,
"redeemed_quantity": 1
},
"start_date": null,
"expiration_date": null,
"metadata": {},
"object": "voucher"
},
"metadata": {},
"channel": {
"channel_id": "user_ID",
"channel_type": "USER"
},
"object": "redemption"
}
},
"source": {
"id": "distr_ID",
"object": "distribution",
"target_url": "https://your.website.io"
},
"event": {
"id": "evcus_115d38459e5318ae94",
"type": "customer.redemption.succeeded",
"created_at": "2025-10-16T16:54:11.816Z",
"entity_id": "cust_ID",
"group_id": "v-115d384583cfba443b",
"event_source": {
"channel": "USER_PORTAL",
"user": {
"id": "user_ID"
}
}
}
}
```
# Manual Distribution Schedule
Source: https://docs.voucherify.io/api-reference/distribution/manual-distribution-schedule
openapi-events/events-distribution.json webhook EVENTS.DISTRIBUTION.MANUAL_DISTRIBUTION_SCHEDULE
The `MANUAL_DISTRIBUTION_SCHEDULE` event indicates that the distribution is a result of a scheduled distribution.
When the event is used in a "Manual message" distribution webhook, the `data` object always contains the following required objects:
* `distribution`.
Additional objects are also sent depending on the purpose:
* "Notify customers about promotion" sends also the following objects:
* `campaign`,
* `customer`,
* `promotion_tier`,
* "Send and publish unique codes from campaign" sends also the following objects:
* `campaign`,
* `voucher`,
* `customer`,
* `publication`,
* "Send plain message to customers" is unavailable for this distribution webhook.
This event is used in a webhook configured in Distributions in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Activate earning rule
Source: https://docs.voucherify.io/api-reference/earning-rules/activate-earning-rule
/openapi/loyalties-v2.json post /v2/loyalties/earning-rules/{earningRuleId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the earning rule to `ACTIVE` status. No request body.
Allowed transitions: `DRAFT -> ACTIVE`, `INACTIVE -> ACTIVE`.
Invalid transitions are rejected with a conflict error.
# Create earning rule
Source: https://docs.voucherify.io/api-reference/earning-rules/create-earning-rule
/openapi/loyalties-v2.json post /v2/loyalties/earning-rules
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a new earning rule. When `status` is omitted the rule is created as `DRAFT`.
When `validity_hours` is omitted it defaults to `{ "type": "ANY_TIME" }`.
When `trigger_limits` is omitted it defaults to
`{ "cooldown": { "type": "NO_COOLDOWN" }, "frequency": { "type": "NO_LIMIT" } }`.
# Deactivate earning rule
Source: https://docs.voucherify.io/api-reference/earning-rules/deactivate-earning-rule
/openapi/loyalties-v2.json post /v2/loyalties/earning-rules/{earningRuleId}/deactivate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the earning rule to `INACTIVE` status. No request body.
Allowed transition: `ACTIVE -> INACTIVE`.
Invalid transitions are rejected with a conflict error.
# Delete earning rule
Source: https://docs.voucherify.io/api-reference/earning-rules/delete-earning-rule
/openapi/loyalties-v2.json delete /v2/loyalties/earning-rules/{earningRuleId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Soft-deletes an earning rule and returns its last state.
# Get earning rule
Source: https://docs.voucherify.io/api-reference/earning-rules/get-earning-rule
/openapi/loyalties-v2.json get /v2/loyalties/earning-rules/{earningRuleId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single earning rule by its ID.
# List earning rule activities
Source: https://docs.voucherify.io/api-reference/earning-rules/list-earning-rule-activities
/openapi/loyalties-v2.json get /v2/loyalties/earning-rules/{earningRuleId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities (audit trail) for a single earning rule.
The same field cannot be used in both ascending and descending order at once.
Default order is `-created_at`.
# List earning rules
Source: https://docs.voucherify.io/api-reference/earning-rules/list-earning-rules
/openapi/loyalties-v2.json get /v2/loyalties/earning-rules
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of earning rules. The same field cannot be used
in both ascending and descending order at once
(e.g. `order=name&order=-name` is rejected). Default order is `-created_at`;
`id` is always appended as a tie-breaker.
# Move earning rule to draft
Source: https://docs.voucherify.io/api-reference/earning-rules/move-earning-rule-to-draft
/openapi/loyalties-v2.json post /v2/loyalties/earning-rules/{earningRuleId}/draft
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the earning rule back to `DRAFT` status. No request body.
Allowed transition: `ACTIVE -> DRAFT`.
Invalid transitions are rejected with a conflict error.
# Update earning rule
Source: https://docs.voucherify.io/api-reference/earning-rules/update-earning-rule
/openapi/loyalties-v2.json put /v2/loyalties/earning-rules/{earningRuleId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates an earning rule. All properties are optional; `status` cannot be changed
through this endpoint (use the activate/deactivate/draft endpoints). For rules that
are not in `DRAFT` status, only the following properties may effectively change:
name, earnings, error, validity_hours, start_date, end_date, trigger_limits, metadata.
Earnings items may carry an `id` (`lernei_...`) to update an existing earning item;
items without an `id` are created.
# Errors
Source: https://docs.voucherify.io/api-reference/errors
Learn about the errors returned to responses and how you can customize them to improve your customer experience
The Voucherify API uses conventional HTTP status codes to indicate success or failure. Responses with a status code starting with 4xx or 5xx can be considered as failed. The API returns errors in a JSON format in the following structure:
```json Error structure theme={null}
{
"code": 405,
"message": "HTTP Method Not Allowed",
"details": "PUT is not supported by this endpoint. Did you mean GET or POST?"
}
```
**Developer-friendly API**
Voucherify attempts to provide a developer-friendly API, hence sometimes you can find a hint on how to fix an error right in its details (like in the example above).
| Attributes | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------ |
| `code` | The HTTP status code of error returned. Possible values are variants of: `2xx`, `4xx`, or `5xx`. |
| `key` | For API object errors, a short string from the list on the right hand side, describing the kind of error which occurred. |
| `message` | A human-readable message providing a short description about the error. |
| `details` | A human-readable message providing more details about the error. |
## HTTP status code summary
| HTTP Status Code | Text | Description |
| ---------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400 | Bad Request | The request was invalid. It may occur for various reasons - a malformed JSON or a violated rule (e.g. an attempt to redeem an expired voucher). |
| 401 | Unauthorized | Authentication has failed or has not been provided yet. |
| 402 | Payment Required | The request exceeded your current pricing plan (we send friendly reminders first). |
| 404 | Not Found | The requested resource could not be found. |
| 405 | Method Not Allowed | The request used a method (GET, POST, etc.) that is not available for a given resource. Error details include a hint on which methods are allowed. |
| 406 | Not Acceptable | The API is unable to produce a response in a format specified by the `Accept` header. In most cases the only available response format is `application/json`. |
| 409 | Duplicated resource found | A resource with similar parameters has been found, so the request couldn't be processed. For example, a request was sent to create a voucher with a name that was already in use. |
| 415 | Unsupported Media Type | The API is unable to consume a request in a format specified by the `Content-Type` header. |
| 423 | Locked | The resource exists, but its current state blocks the operation. Loyalty v2 examples include an inactive program (`non_active_program`) or a loyalty card with zero balance (`zero_card_balance`). |
| 429 | API limit reached | Error occurs when you exceed your limit of API calls or when your subscription plan has ended. |
| 500 | Internal Server Error | An internal API error occurred. Don't worry, we track and verify all such errors and try to react as asap as possible. |
## Error messages
The table below shows a list of errors that may be returned along with a brief description of the reason why it occurs.
**Customize Error Messages**
A subset of the messages returned for the errors listed below can be customized in the UI.
Go to **Project Settings** > Error Messages to customize an error message. Then click on *Create new translations group* to create specific error messages. [Read more here](/manage/project-settings#error-messages).
| **Error** | **Reason** |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `already_rolled_back` | redemption was rolled back before the current operation start time |
| `customer_rules_violated` | customer did not match to the segment |
| `duplicate_found` | resource with the same identifier was found |
| `duplicate_resource_key` | resource identifier is in use |
| `gift_amount_exceeded` | gift amount has been exceeded |
| `invalid_add_balance_params` | balance object was specified incorrectly |
| `invalid_amount` | order amount was specified incorrectly |
| `invalid_campaign_params` | campaign object was specified incorrectly |
| `invalid_code_config` | voucher code configuration object was specified incorrectly |
| `invalid_customer` | customer object was specified incorrectly |
| `invalid_export_params` | export object was specified incorrectly |
| `invalid_gift` | gift object was specified incorrectly |
| `invalid_order` | order object was specified incorrectly |
| `invalid_payload` | a request body is invalid and cannot be processed |
| `invalid_product` | product object was specified incorrectly |
| `invalid_publish_params` | publication object was specified incorrectly |
| `invalid_query_params` | input request query parameters are invalid |
| `invalid_rollback_params` | redemption rollback object was specified incorrectly |
| `invalid_sku` | SKU object was specified incorrectly |
| `invalid_validation_rules` | validation rules object was specified incorrectly |
| `invalid_voucher` | voucher object was specified incorrectly (e.g., `gift` or `discount` is missing) |
| `loyalty_card_points_exceeded` | loyalty card points were exceeded |
| `missing_amount` | order amount was not specified |
| `missing_customer` | customer was not specified |
| `missing_order` | order is missing |
| `missing_order_items` | order items were not specified |
| `missing_order_items_amount` | missing order item's amount(s) |
| `missing_reward` | reward is missing |
| `member_already_exists` | the customer is already a member of the loyalty v2 program |
| `multiple_requests` | multiple requests detected; i.e. when a redemption is in progress and a session lock is in place, then an attempt to validate the voucher will result in this error because it is unknown whether the voucher can or cannot be used |
| `non_active_program` | the loyalty v2 program is not in `ACTIVE` status for an operation that requires an active program |
| `zero_card_balance` | the loyalty card has no points available for a spend operation such as pay with points |
| `no_voucher_suitable_for_publication` | lack of vouchers suitable for publication |
| `not_found` | resource with given ID/code does not exist |
| `order_rules_violated` | order did not match validation rules |
| `promotion_inactive` | promotion is inactive |
| `promotion_not_active_now` | promotion is not active in the given time frame |
| `quantity_exceeded` | voucher's redemptions limit has been exceeded |
| `query_too_large` | request body payload too large or query string too large |
| `redemption_rules_violated` | the redemption did not match validation rules |
| `referrer_not_permitted_to_redeem` | the referral code is being redeemed by the referrer |
| `resource_not_found` | voucher with given code does not exist |
| `voucher_disabled` | voucher has been disabled (active: false) |
| `voucher_expired` | voucher has already expired (after expiration date) |
| `voucher_not_active` | voucher is not active yet (before start date) |
| `voucher_not_active_now` | voucher is not active in the given time frame |
## Custom error messages with Validation Rules
Voucherify allows you to define your custom error message per Validation Rule; such message is going to be returned in API Response when validation or redemption of your promotion campaign or code fails due to not meeting requirements of that rule. Additionally, you can specify a fallback error message that should be used when there is no error message defined for the rule. You can define your custom error message both from the API or your Dashboard.
The content of custom error message is going to be returned in `error` object under `message` property. If you do not specify any error message for your Validation Rule then `error` property will not be included in the API response.
### Example
Let's assume that you create a new Validation Rule via API and would like to have a custom error message "You can't get a discount because you are not new customer" returned from API. The second condition says that your customer who is validating a voucher is not a new one (for that, we are going to use a segment represented by ID: `seg_n3vVcU5t0m3rs4rEPr3C1oU5`). Additionally, you wish that the customer cart must contain an iPhone (`prod_f1r5Tpr0DuC7` is our iPhone), and if not, then a fallback error message should be used: "You must buy iPhone and be our new customer to get a discount." Let's examine how a request for creating such Validation Rule would look like, later we are also going to explore in details how API response is going to look:
```json Example theme={null}
{
"name": "My validation rule",
"error": {
"message": "You must buy IPhone and be our new customer in order to get a discount"
},
"rules": {
"1": {
"name": "customer.segment",
"conditions": {
"$is": ["seg_n3vVcU5t0m3rs4rEPr3C1oU5"]
},
"error": {
"message": "You can't get discount because you are not a new customer"
},
"rules": {}
},
"2": {
"name": "product.id",
"conditions": {
"$is": [{
"id": "prod_f1r5Tpr0DuC7"
}]
},
"rules": {}
},
"logic": "1 AND 2"
}
}
```
As you can see in request body above, there is an `error` property defined at the top level which is going to serve as a fallback. There is also an `error` message set per rule which is going to be returned in the API response when validation / redemption fail due to that specific rule.
Let's see below how the API Response is going to look in different scenarios with validation voucher:
**Provided required iPhone in order but the customer does not belong to required segment:**
```json Error example 1 theme={null}
{
"code": "MY-TEST-CODE",
"valid": false,
"reason": "customer does not match segment rules",
"tracking_id": "track_BRR0eIl/xcEftRmZCj65AQ==",
"metadata": {},
"error": {
"message": "You can't get discount because you are not a new customer"
}
}
```
**Provided customer belongs to required segment, but the iPhone was not specified in the order:**
```json Error example 2 theme={null}
{
"code": "MY-TEST-CODE",
"valid": false,
"reason": "order does not match validation rules",
"tracking_id": "track_BRR0eIl/xcFGi+qDwBt2E8W3LQP5W8Np",
"metadata": {},
"error": {
"message": "You must buy IPhone and be our new customer in order to get a discount"
}
}
```
**Passing both checks - providing customer who belongs to the required segment and items list with iPhone:**
```json Valid theme={null}
{
"code": "MY-TEST-CODE",
"valid": true,
"discount": {
"type": "AMOUNT",
"amount_off": 10000
},
"order": {
"object": "order",
"items": [
{
"object": "order_item",
"product_id": "prod_f1r5Tpr0DuC7",
"quantity": 1
}
]
},
"tracking_id": "track_BRR0eIl/xcFGi+qDwBt2E8W3LQP5W8Np",
"metadata": {}
}
```
# Event Object
Source: https://docs.voucherify.io/api-reference/events/event-object
Events Create Request Body
| Attributes |
Description |
|
event
string
|
Event name. This is the same name that you used to define a custom event in the
Dashboard
>
Project Settings
>
Event Schema.
|
|
customer
|
Customer's information.
Customer
|
|
referral
object
|
If a
conversion event
for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event.
| Attributes |
Description |
|
code
string
|
A code through which a new visitor has been referred to a service.
|
|
referrer\_id
string
|
Unique ID of the referring person - it is optional and not required if the referral
code
is provided.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
|
loyalty
object
|
If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.
| Attributes |
Description |
|
code
string
|
Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the
event
parameter of the request payload gets sent along with this loyalty card code.
Example:
L-CARD-BUHuH6g
|
|
|
metadata
object
|
The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the
Dashboard
>
Project Settings
>
Event Schema
>
Edit particular event
>
Metadata property definition.
|
Customer
All of:
-
Customer Id And Source Id
| Attributes |
Description |
|
id
string
|
The ID of an existing customer.
|
|
source\_id
string
|
A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
|
-
Customer Base
Customer Base
| Attributes |
Description |
|
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. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
|
|
birthday
string
|
Deprecated.
Customer's birthdate; format YYYY-MM-DD.
|
|
birthdate
string
|
Customer's birthdate; format YYYY-MM-DD.
|
|
address
object,
null
|
Customer's address.
| Attributes |
Description |
|
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.
|
|
|
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.
|
# Track Custom Event
Source: https://docs.voucherify.io/api-reference/events/track-custom-event
/openapi/events.json post /v1/events
To track a custom event, you create an event object.
The event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.
# Examine earning rules
Source: https://docs.voucherify.io/api-reference/examine/examine-earning-rules
/openapi/loyalties-v2.json post /v2/loyalties/examine/earning-rules
Estimates earning opportunities for a customer without triggering any actual earning for loyalty v2 earning rules. The `trigger` selects whether all trigger events or one specific event is examined. When a specific event is selected, exactly one matching context object is required: `customer_order_paid` for `customer.order.paid`, `customer_segment_entered` for `customer.segment.entered`, and `customer_custom_event` for `customer.custom_event`. The other context objects must not be present.
This endpoint can examine earning rules for all loyalty programs the customer belongs to by using `customer_identification` with `customer_id` or `customer_source_id`. To examine earning rules only for one program, use `member_id` in `customer_identification`, as `member_id` is loyalty program-specific.
# Examine rewards
Source: https://docs.voucherify.io/api-reference/examine/examine-rewards
/openapi/loyalties-v2.json post /v2/loyalties/examine/rewards
Evaluates rewards assigned to a customer's active Loyalty v2 program memberships. Applies temporary customer and member metadata overrides without updating stored data. Returns reward availability by card, including points costs and applicable unavailability reasons.
This endpoint can examine rewards for all loyalty programs the customer belongs to by using `customer_identification` with `customer_id` or `source_id`. To examine rewards only for one program, use `member_id` in `customer_identification`, as `member_id` is loyalty program-specific.
# Create Export
Source: https://docs.voucherify.io/api-reference/exports/create-export
/openapi/exports.json post /v1/exports
Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, `voucher_transactions`, `product`, or `sku`.
## Defaults
If you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:
| **Export Object** | **Default fields returned** |
|:---|:---|
| order | `id`, `source_id`, `status` |
| voucher | `code`, `voucher_type`, `value`, `discount_type` |
| publication | `code`, `customer_id`, `date`, `channel` |
| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |
| customer | `name`, `source_id` |
| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |
| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |
| products | `id`, `name`, `price`, `image_url`, `source_id`, `attributes`, `created_at`|
| SKU | `id`, `sku`, `product_id`, `currency`, `price`, `image_url`, `source_id`, `attributes`, `created_at`|
Date and time in the export API
The exported date and times are always provided in the UTC time zone.
## Fetching particular data sets
Using the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:
## Orders
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |
| source_id | Unique order source ID. | 8638 |
| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |
| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |
| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |
| amount | Total amount of order items. | 7700 |
| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |
| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |
| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |
| total_amount | Total order amount after applying all discounts. | 7100 |
| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |
| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |
| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |
## Vouchers
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |
| code | Unique voucher code. | WELCOME100 |
| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |
| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
`GIFT_VOUCHER`: amount left to spend
`LOYALTY_CARD`: available usable points |
| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |
| campaign | Unique campaign name. | Summer Discounts 20% off |
| category | Tag defining the category that this voucher belongs to. | |
| start_date | Start date defines when the code starts to be active. Activation timestamp is presented in the ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |
| expiration_date | Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |
| gift_balance | Amount left to spend. | 1000 |
| loyalty_balance | Available usable points. | 2000 |
| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |
| redemption_count | Total redemptions. | 59 |
| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |
| qr_code | URL to QR representation of encrypted code. | |
| bar_code | URL to barcode representation of encrypted code. | |
| metadata | Custom voucher metadata. | |
| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |
| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |
| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |
| validity_timeframe_interval | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of `P2D` will be active every other day. | P2D |
| validity_timeframe_duration | Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of `PT1H` will be valid for a duration of one hour. | PT1H |
| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | "1,2,3,4,5" |
| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |
| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |
| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |
| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |
| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |
| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |
| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |
## Publications
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| voucher_code | Unique voucher code. | WELCOME100 |
| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |
| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |
| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |
| channel | Publication channel. | voucherify-website |
| campaign | Unique campaign name. | Summer Discounts 20% off |
| is_winner | | |
| metadata | Custom publication metadata. | |
## Redemptions
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |
| object | Object being exported; by default `redemption`. | redemption |
| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |
| voucher_code | Unique voucher code redeemed. | WELCOME100 |
| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |
| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |
| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |
| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |
| customer_name | Customer name. | John Smith |
| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |
| order_amount | Total order amount before applying all discounts. | 1000 |
| gift_amount | Gift credits used for redemption. | 10 |
| loyalty_points | | 12 |
| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |
| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |
| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |
| metadata | Custom redemption metadata. | |
## Customers
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| name | Customer name. | John Smith |
| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |
| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |
| email | Customer's email. | name.lastname@email.com |
| source_id | Unique custom customer identifier. | name.lastname@email.com |
| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |
| address_city | City | Houston |
| address_state | State | TX |
| address_line_1 | First line of customer's address. | 72738 Main St |
| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |
| address_country | Country | United States of America |
| address_postal_code | Postal code (ZIP code) | 77042-4143 |
| redemptions_total_redeemed | Total customer redemptions. | 5 |
| redemptions_total_failed | Total customer failed redemptions. | 2 |
| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |
| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |
| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |
| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |
| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |
| orders_total_count | Total number of customer orders. | 2 |
| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |
| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |
| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |
| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |
| loyalty_referred_customers | How many customers were referred by this customer. | 3 |
| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |
| phone | Customer's phone number. | +1 (294) 752-1846 |
| birthday | `Deprecated`. ~~Customer's birthday~~. | 2022-01-01 |
| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |
| birthdate | Customer's birthdate. | 2022-01-01 |
## Points Expirations
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |
| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |
| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |
| status | Status of the loyalty point bucket. | `ACTIVE` or `EXPIRED` |
| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |
| points | Number of points. | 1000 |
## Gift Card Transactions
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |
| source_id | Unique transaction source ID. | 8638 |
| reason | Contains the reason for the transaction if one was included originally. | |
| balance | The gift card or loyalty card balance after the transaction. | |
| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
| source| Channel through which the transaction was initiated. | API |
| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
## Loyalty Card Transactions
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |
| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |
| reason | Contains the reason for the transaction if one was included originally. | |
| balance | The loyalty card balance after the transaction. | |
| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |
| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |
# Delete Export
Source: https://docs.voucherify.io/api-reference/exports/delete-export
/openapi/exports.json delete /v1/exports/{exportId}
This method deletes a previously created export object.
# Download Export
Source: https://docs.voucherify.io/api-reference/exports/download-export
/openapi/exports.json get /v1/exports/{export_Id}
Download the contents of the exported CSV file.
Important notes
**Base URL:**
- `https://download.voucherify.io` (Europe)
- `https://us1.download.voucherify.io` (US)
- `https://as1.download.voucherify.io` (Asia)
**Token:** Can be found within the `result` parameter of the [Get Export](/api-reference/exports/get-export) method response.
# Export Object
Source: https://docs.voucherify.io/api-reference/exports/export-object
Export
One of:
-
Export Voucher
-
Export Redemption
-
Export Customers
-
Export Publication
-
Export Orders
-
Export Points Expiration
-
Export Vouchers Transactions
Export Voucher
All of:
-
Export Base
-
Export Vouchers
Export Redemption
All of:
-
Export Base
-
Export Redemptions
Export Customers
All of:
-
Export Base
-
Export Customers
Export Publication
All of:
-
Export Base
-
Export Publications
Export Orders
All of:
-
Export Base
-
Export Orders
Export Points Expiration
All of:
-
Export Base
-
Export Points Expirations
Export Vouchers Transactions
All of:
-
Export Base
-
Export Vouchers Transactions
Export Base
| Attributes |
Description |
|
id
string
|
Unique export ID.
|
|
object
string
|
The type of object being represented. This object stores information about the export.
Available values:
export
|
|
created\_at
string
|
Timestamp representing the date and time when the export was scheduled in ISO 8601 format.
|
|
status
string
|
Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.
Available values:
SCHEDULED,
IN\_PROGRESS,
DONE,
ERROR
|
|
channel
string
|
The channel through which the export was triggered.
|
|
result
object,
null
|
Contains the URL of the CSV file.
| Attributes |
Description |
|
url
string
|
URL of the CSV file location. It contains the token used for authorization in the Download export method.
|
|
|
user\_id
string,
null
|
Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE.
|
Export Vouchers
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
voucher
|
|
parameters
object
|
| Attributes |
Description |
|
order
|
How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.
Export Voucher Order
|
|
fields
array
|
Array of strings containing the data in the export. These fields define the headers in the CSV file.
Array of
Export Voucher Fields
|
|
filters
|
Filter conditions.
Export Voucher Filters
|
|
campaign\_id
string
|
Unique identifier of the campaign. It is assigned by Voucherify. The campaign ID defines the campaign for which the voucher export will be triggered.
Example:
camp\_0dJG7cCAjquzcxWmZ634bA0C
|
|
Export Redemptions
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
redemption
|
|
parameters
object
|
List of available fields and filters that can be exported with an order along with the sorting order of the returned data.
| Attributes |
Description |
|
order
|
How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.
Export Redemption Order
|
|
fields
array
|
Array of strings containing the data in the export. These fields define the headers in the CSV file.
Array of
Export Redemption Fields
|
|
filters
|
Filter conditions.
Export Redemption Filters
|
|
Export Customers
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
customer
|
|
parameters
object
|
List of available fields and filters that can be exported with an order along with the sorting order of the returned data.
| Attributes |
Description |
|
order
|
How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.
Export Customer Order
|
|
fields
array
|
Array of strings containing the data in the export. These fields define the headers in the CSV file.
Array of
Export Customer Fields
|
|
filters
|
Filter conditions.
Export Customer Filters
|
|
Export Publications
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
publication
|
|
parameters
object
|
List of available fields and filters that can be exported with an order along with the sorting order of the returned data.
|
Export Orders
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
order
|
|
parameters
object
|
List of available fields and filters that can be exported with an order along with the sorting order of the returned data.
| Attributes |
Description |
|
order
|
How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order.
Export Order Order
|
|
fields
array
|
Array of strings containing the data in the export. These fields define the headers in the CSV file.
Array of
Export Order Fields
|
|
filters
|
Filter conditions.
Export Order Filters
|
|
Export Points Expirations
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
points\_expiration
|
|
parameters
object
|
List of available fields and filters that can be exported with an order along with the sorting order of the returned data.
|
Export Vouchers Transactions
| Attributes |
Description |
|
exported\_object
string
|
The type of object to be exported.
Available values:
voucher\_transactions
|
|
parameters
object
|
List of available fields and filters that can be exported with an order along with the sorting order of the returned data.
|
Export Voucher Order
Available values:
-created\_at,
created\_at,
-updated\_at,
updated\_at,
-code,
code
Export Voucher Fields
Available values:
code,
voucher\_type,
value,
formula,
discount\_type,
campaign,
category,
start\_date,
expiration\_date,
gift\_balance,
loyalty\_balance,
redemption\_quantity,
redemption\_count,
active,
qr\_code,
bar\_code,
metadata,
id,
is\_referral\_code,
created\_at,
updated\_at,
validity\_timeframe\_interval,
validity\_timeframe\_duration,
validity\_day\_of\_week,
discount\_amount\_limit,
campaign\_id,
additional\_info,
customer\_id,
discount\_effect,
discount\_unit\_type,
discount\_unit\_effect,
validation\_rules\_id,
customer\_source\_id
Export Voucher Filters
Export Redemption Order
Available values:
-id,
id,
-voucher\_code,
voucher\_code,
-tracking\_id,
tracking\_id,
-customer\_id,
customer\_id,
-created\_at,
created\_at
Export Redemption Fields
Available values:
id,
object,
date,
voucher\_code,
campaign,
promotion\_tier\_id,
customer\_id,
customer\_source\_id,
customer\_name,
tracking\_id,
order\_id,
order\_amount,
gift\_amount,
loyalty\_points,
result,
failure\_code,
failure\_message,
metadata
Export Redemption Filters
Export Customer Order
Available values:
-name,
name,
-id,
id,
-email,
email,
-source\_id,
source\_id,
-created\_at,
created\_at,
-updated\_at,
updated\_at
Export Customer Fields
Available values:
name,
id,
description,
email,
source\_id,
created\_at,
address\_city,
address\_state,
address\_line\_1,
address\_line\_2,
address\_country,
address\_postal\_code,
redemptions\_total\_redeemed,
redemptions\_total\_failed,
redemptions\_total\_succeeded,
redemptions\_total\_rolled\_back,
redemptions\_total\_rollback\_failed,
redemptions\_total\_rollback\_succeeded,
orders\_total\_amount,
orders\_total\_count,
orders\_average\_amount,
orders\_last\_order\_amount,
orders\_last\_order\_date,
loyalty\_points,
loyalty\_referred\_customers,
updated\_at,
phone,
birthday,
metadata,
birthdate
Export Customer Filters
Export Publication Order
Available values:
-id,
id,
-voucher\_code,
voucher\_code,
-tracking\_id,
tracking\_id,
-customer\_id,
customer\_id,
-created\_at,
created\_at,
-channel,
channel
Export Publication Fields
Available values:
voucher\_code,
customer\_id,
customer\_source\_id,
date,
channel,
campaign,
is\_winner,
metadata
Export Publication Filters
Export Order Order
Available values:
-created\_at,
created\_at,
-updated\_at,
updated\_at,
-status,
status
Export Order Fields
Available values:
id,
source\_id,
created\_at,
updated\_at,
status,
amount,
discount\_amount,
items\_discount\_amount,
total\_discount\_amount,
total\_amount,
customer\_id,
referrer\_id,
metadata
Export Order Filters
Export Points Expiration Order
Available values:
-expires\_at,
expires\_at
Export Points Expiration Fields
Available values:
id,
campaign\_id,
voucher\_id,
points,
status,
expires\_at
Export Points Expiration Filters
Export Voucher Transactions Order
Available values:
-created\_at,
created\_at
Export Voucher Transactions Fields
Available values:
id,
campaign\_id,
voucher\_id,
type,
source\_id,
reason,
source,
balance,
amount,
related\_transaction\_id,
created\_at,
details
Export Voucher Transactions Filters
Junction
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
Field Conditions
| Attributes |
Description |
|
conditions
|
Data filters used to narrow down the data records to be returned in the result.
Filters Condition
|
Any
Array any of:
- string
- string
- string
- number
- object
Filters Condition
| Attributes |
Description |
|
\$in
|
See:
Any
|
|
\$not\_in
|
See:
Any
|
|
\$is
|
See:
Any
|
|
\$is\_days\_ago
|
See:
Any
|
|
\$is\_days\_in\_future
|
See:
Any
|
|
\$is\_not
|
See:
Any
|
|
\$has\_value
|
See:
Any
|
|
\$is\_unknown
|
See:
Any
|
|
\$contains
|
See:
Any
|
|
\$not\_contain
|
See:
Any
|
|
\$starts\_with
|
See:
Any
|
|
\$ends\_with
|
See:
Any
|
|
\$more\_than
|
See:
Any
|
|
\$less\_than
|
See:
Any
|
|
\$more\_than\_ago
|
See:
Any
|
|
\$less\_than\_ago
|
See:
Any
|
|
\$more\_than\_future
|
See:
Any
|
|
\$less\_than\_future
|
See:
Any
|
|
\$more\_than\_equal
|
See:
Any
|
|
\$less\_than\_equal
|
See:
Any
|
|
\$after
|
See:
Any
|
|
\$before
|
See:
Any
|
|
\$count
|
See:
Any
|
|
\$count\_less
|
See:
Any
|
|
\$count\_more
|
See:
Any
|
# Get Export
Source: https://docs.voucherify.io/api-reference/exports/get-export
/openapi/exports.json get /v1/exports/{exportId}
Retrieves the URL of the downloadable file, which was generated via the [Create Export](/api-reference/exports/create-export) method.
# List Exports
Source: https://docs.voucherify.io/api-reference/exports/list-exports
/openapi/exports.json get /v1/exports
List all exports.
# Introduction
Source: https://docs.voucherify.io/api-reference/introduction-api
What is Voucherify API?
The Voucherify API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, such as HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients.
We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application
Never expose your secret API key in any public website's client-side code.
JSON is returned by all API responses, including errors. However, Voucherify API libraries convert responses to appropriate language-specific objects.
To make the API as explorable as possible, this documentation has a test mode. You can test all methods at no cost. Click **Try it** in an endpoint page to open a playground and configure your request.
Fields that are necessary in the request are marked as `required`. Fields that will always be returned in the response are also marked as `required`.
In general the API consists of 3 sets:
* **Application API** - full capability, designed to be accessed from your server application
* **Client API** - limited capability, designed to be accessed from your website or mobile application
* **Management API** - endpoints designed to manage Voucherify projects within organization. Enterprise feature only - contact [Voucherify sales team](https://www.voucherify.io/contact-sales "Contact Voucherify Sales") for more details.
Find out more about how to [authenticate your application](/guides/authentication) to access the API.
# Introduction to Voucherify webhooks
Source: https://docs.voucherify.io/api-reference/introduction-to-webhooks
Use webhooks to get notified about project and distribution events in Voucherify
Webhooks in Voucherify are automated messages sent from Voucherify to your application when specific events happen. For example, when a voucher is redeemed, Voucherify can instantly notify your app about it. You set up webhooks by providing a URL (endpoint) in Voucherify, and Voucherify sends event notifications directly to this URL.
Voucherify offers two types of webhooks:
* [Project-level webhooks](/api-reference/project-settings-webhooks) – triggered by general events across your entire project (like voucher redemption, customer updates, or order events).
* [Distribution-based webhooks](/api-reference/distribution-webhooks) – triggered specifically by voucher distribution events (for example, when a voucher is successfully sent or fails to send).
You can set up each webhook separately based on your application's needs.
## Voucherify webhook structure
The Voucherify webhooks share the same data structure, consisting of the following keys:
* `id`
* `project_id`
* `created_at`
* `type`
* `data`
* `source`
* `event`
The values for the `type` and `data` depend on the event that triggers the webhook. Go to [Project Setting Webhook Payload](/api-reference/project-settings-webhooks#webhooks-available-in-project-settings) and [Distribution Webhook Payload](/api-reference/distribution-webhooks#webhooks-available-in-distributions) to learn more about their payloads.
## Authentication
Once your server is configured to receive payloads, it will listen for any payload sent to the endpoint you configured. For security reasons, you may want to limit requests to those coming from Voucherify. To do so, you should copy a secret token and validate the information.
You can generate a secret key in the Project Settings in the Webhooks section.
Each webhook sent from Voucherify contains the `x-voucherify-signature` of the webhook in the header field.
Then, you can validate the signature by reconstructing it and comparing it to the one sent in the webhook header field.
Reconstruct it using the keyed-hash message authentication code HMAC. It is built with the cryptographic hash function **sha256** and the secret cryptographic key taken from the Project settings.
You can add optional additional HTTP headers when setting up a webhook distribution. In Additional HTTP headers, you can multiple add key-value pairs for your custom headers. Each header must have a name and a value. The names must be unique.
See the following examples for Java and the `verifySignature` method in the [NodeJS SDK](https://github.com/voucherifyio/voucherify-nodejs-sdk/blob/c63f738c5a53ecb9a5006a04d80d612ee70bdeae/src/utils.js#L102).
```java Java theme={null}
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
class HelloWorld {
public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException {
byte[] secretKey = "secretKey".getBytes(StandardCharsets.UTF_8);
// when payload is JSON object - whitespaces must be removed
String signature1 = "a17d2ac229d1ebbb5f10e839c7985c4818e5986eab297f7e5979196d4d7d3ed2";
System.out.println(verifySignature(removeWhitespaces("{\n \"a\": 1\n}"), signature1, secretKey));
System.out.println(verifySignature(removeWhitespaces("{\"a\":1}"), signature1, secretKey));
String signature2 = "f7cf97814a03146abedb9793f56e1dec34f618f82d10395310d053f749483ffb";
System.out.println(verifySignature(removeWhitespaces("{\n \"a\\\"b\": 1\n}"), signature2, secretKey));
// when payload is directly a String
String signature3 = "53ff92957e1427ce23ad5bda9d0c5f2f4ff384d0806b83eeacb510c842d3a358";
System.out.println(verifySignature(" message ", signature3, secretKey));
}
public static String removeWhitespaces(String json) {
boolean quoted = false;
boolean escaped = false;
String out = "";
for (Character c : json.toCharArray()) {
if (escaped) {
out += c;
escaped = false;
continue;
}
if (c == '"') {
quoted = !quoted;
} else if (c == '\\') {
escaped = true;
}
if (Character.isWhitespace(c) && !quoted) {
continue;
}
out += c;
}
return out;
}
public static boolean verifySignature(String payload, String signature, byte[] secretKey) throws InvalidKeyException, NoSuchAlgorithmException {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secretKey, "HmacSHA256"));
byte[] hash = mac.doFinal(payload.getBytes(StandardCharsets.UTF_8));
String generatedSignature = bytesToHex(hash);
return generatedSignature.equals(signature);
}
private static String bytesToHex(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (byte b : bytes) {
sb.append(String.format("%02x", b));
}
return sb.toString();
}
}
```
```javascript NodeJS theme={null}
const crypto = require('crypto')
verifySignature: function (signature, message, secretKey) {
return crypto.createHmac('sha256', secretKey)
.update(isString(message) && message || JSON.stringify(message))
.digest('hex') === signature
}
```
## IP whitelisting
When Voucherify sends a webhook, the Voucherify servers make network requests to tenants’ or third parties’ servers.
To add an additional layer of security, you can do IP whitelisting. This mechanism verifies if webhook requests come from Voucherify.
Voucherify sends webhooks from the IP ranges below. Add all three addresses for your region.
| **Region** | **IP** |
| ---------- | -------------------------------------------- |
| eu1 | 34.247.197.22, 63.32.191.141, 52.215.148.84 |
| us1 | 100.25.106.67, 18.209.236.215, 34.192.255.99 |
| as1 | 52.76.98.82, 54.169.8.101, 13.214.87.160 |
For dedicated regions, contact [Voucherify Support](https://www.voucherify.io/contact-support) or your Technical Account Manager to get the IP ranges for your whitelist.
## Webhook tracking and monitoring
You can track and monitor webhook send outs and other details in a couple of ways.
### Audit log
You can check details about a webhook sendout. In Voucherify dashboard, go to Audit log and Webhook send outs tab.
The Audit Log includes the following details:
* Webhook status
* Webhook type
* Webhook send out ID
* Source
* Target URL
* Request ID
* Event created at
* Executed at
* Complete webhook data (three dot menu on the right > Show data)
You can also send a failed webhook again. Go to the three dot menu on the right > Retry.
### Get notified about failed sendouts
You can set up notifications to inform you via email or in the app that a webhook did not reach the destination.
Go to the Notification Center > Account Settings and scroll down to Webhook callout notifications to configure notifications.
### Responding to webhooks
Voucherify expects your webhook to return a response with a `2XX` HTTP status code, indicating that the webhook has been received successfully. If a webhook is not successfully received for any reason, Voucherify will continue trying to send the webhook in the following intervals:
| **Re-try No.** | **Time since the initial attempt** | **Interval to next re-try** |
| -------------- | ---------------------------------- | --------------------------- |
| 1 | 1 min | 1 min |
| 2 | 2 min | 2 min |
| 3 | 4 min | 4 min |
| 4 | 8 min | 8 min |
| 5 | 16 min | 16 min |
| 6 | 32 min | 32 min |
| 7 | 1 h 4 min | 1 h 4 min |
| 8 | 2 h 8 min | 2 h 8 min |
| 9 | 4 h 16 min | 4 h 16 min |
| 10 | 8 h 32 min | 8 h 32 min |
| 11 | 17 h 4 min | 17 h 4 min |
| 12 | 24 h | Final re-try |
Your endpoint must return a response in under 10 seconds; otherwise, it will be considered an error.
* Project-level webhooks that are set in Project Settings are disabled after 12 unsuccessful tries.
* Distribution-based webhooks that are set up as channels in the Distributions manager are paused after 12 unsuccessful tries.
# Fetching Data
Source: https://docs.voucherify.io/api-reference/listing
Learn how to specify the data you would like to fetch
All top-level API resources have support for fetches via **list** API methods. For instance, you can list redemptions, list publications, list customers, list products, and more.
These list API methods share a common structure, using at least these *query parameters*: `limit` and `created_at`.
| **Parameter name** | **Description** |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `limit` | A limit on the number of objects to be returned; between 1 and 100. |
| `created_at` | A filter on the list based on the object `created_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). *Examples:* - `[created_at][before]=2017-09-08T13:52:18.227Z`- `[created_at][after]=2017-09-08` |
## Paging the results
Some of the list API methods use the `page` query parameter to display another page of results.
However, the following list API methods use the `starting_after_id` query parameter:
* [List customer activity](/api-reference/customers/list-customer-activity)
* [List member activity](/api-reference/loyalties/list-member-activity)
* [List member activity (with campaign ID)](/api-reference/loyalties/list-member-activity-with-campaign-id)
* [List campaign transactions](/api-reference/campaigns/list-campaign-transactions)
* [List voucher transactions](/api-reference/vouchers/list-voucher-transactions)
* [List loyalty campaign transactions](/api-reference/loyalties/list-loyalty-campaign-transactions)
* [List loyalty card transactions](/api-reference/loyalties/list-loyalty-card-transactions)
* [List loyalty card transactions (with campaign ID)](/api-reference/loyalties/list-loyalty-card-transactions-with-campaign-id)
* [List customer redeemables](/api-reference/customers/list-customers-redeemables)
* [List referral code holders](/api-reference/referrals/list-referral-code-holders)
* [List referral code holders (with campaign ID)](/api-reference/referrals/list-referral-code-holders-with-campaign-id)
* [List bin entries](/api-reference/bin/list-bin-entries)
* [List campaign templates](/api-reference/templates/list-campaign-templates)
* [Management – List campaign templates](/api-reference/management/list-campaign-templates)
The response to these methods may include a `more_starting_after` key that takes a string value with an ID. Use this ID with the `starting_after_id` query parameter to display another page of results.
## Cursor pagination (Loyalty v2)
Loyalty v2 list endpoints use cursor pagination instead of `page` or `starting_after_id`.
Typical response shape:
```json theme={null}
{
"data": [],
"cursor": {
"next": "lcrsctx_12989e71c62b6d5baf",
"expires_at": "2026-06-18T16:32:07.896Z"
},
"object": "list"
}
```
How to page results:
1. Call the list endpoint without `cursor` to get the first page.
2. If `cursor.next` is present, call the same endpoint again with `?cursor={cursor.next}`.
3. Stop when `cursor` is `null` or `cursor.next` is missing.
4. Treat `cursor.expires_at` as the validity window for that cursor value. Request a new first page if the cursor expires.
Cursor prefixes differ by resource (for example `lcrsctx_` for card transactions and `lcrsmbr_` for members). Always pass the exact `cursor.next` value returned by the previous response. See the Loyalty v2 endpoint pages under API reference for resource-specific cursor patterns.
## Response format
The listing method returns a dictionary with a data property that contains an array of resources. The maximum number of resources returned is determined by the `limit` query parameter. If no more resources are available, the resulting array on a given page will be empty. The result can be narrowed down according to the specified (or default) filters.
| **Property name** | **Description** |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `object` | A string describing the object type returned. |
| `data_ref` | The value for this property indicates the property name containing the results array. |
| `data` | An array that contains objects for a given list endpoint. In older methods, this is replaced by the name of the respective resource, e.g. `publications`. |
| `total` | Total number of records for given filtering query. In some methods, this field is absent. |
| `has_more` | It indicates that there are more results to be returned for given filter parameters. |
| `more_starting_after` | Present in some of the newer endpoints; it provides an ID that can be used with a `starting_after_id` query parameter to return another page of results. |
```json Old method example response theme={null}
{
"object": "list",
"total": 1,
"data_ref": "vouchers",
"vouchers": [
{
"id": "v_yY3smFaWii1iy3EvtaiJJpZqQxoS9rJn",
"code": "2018-Heq-mK-2w1",
"campaign": "Benefit",
"campaign_id": "camp_FzQCVyac6jAAEephT0i2L14F",
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 1000
},
"start_date": "2018-09-03T22:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
},
"validity_day_of_week": [
2,
3
],
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/2018-Heq-mK-2w1/publications?page=1&limit=10"
},
"redemption": {
"object": "list",
"quantity": 5,
"redeemed_quantity": 0,
"url": "/v1/vouchers/2018-Heq-mK-2w1/redemptions?page=1&limit=10"
},
"active": false,
"assets": {
"qr": {
"id": "U2FsdGVkX1+oNqKQ08m2y1IWJemXXWI7RpgBrrNvmBiQbxe/4XBlAudagPJWbdtDI3S5biYSdslhXIwPyRCx0eUhUqnQmngmBadWq8xX3HeGSjUxMu2/yF9PAc3izKU0MUJ2oXJpjZ/oieEHtIElEA==",
"url": "{{voucherify_internal_URL}}"
},
"barcode": {
"id": "U2FsdGVkX1+anixbnFov/mzPXUmqQp6YDR++HLW2m0WxQBc4t1wbBSKHqP8cAa63CUQE8IdyZEIZIku0RwAQiYflEAq6upaJ5CHiB3LUOh0EsdtnzUCB21EBkaNCs3PKNvFdDwG5UQzqIjN0u5MOGA==",
"url": "{{voucherify_internal_URL}}"
}
},
"is_referral_code": false,
"created_at": "2018-09-04T14:58:25.000Z",
"updated_at": "2018-09-20T08:03:55Z",
"object": "voucher"
}
]
}
```
```json New method example response theme={null}
{
"object": "list",
"data_ref": "data",
"data": [
{
"id": "rh_0f35d7ba9300a8e8e4",
"created_at": "2024-08-14T10:29:19.542Z",
"redeemable_id": "v_YdDGS5yBnLCp79vfPbHhkoRrqPwkgyiy",
"redeemable_object": "voucher",
"campaign_id": "camp_vVk4unz3k4gA023fk9XoSiTh",
"campaign_type": "REFERRAL_PROGRAM",
"voucher_type": "DISCOUNT_VOUCHER",
"customer_id": "cust_K11DXLfeJIZz7LZpxgiLhZpX",
"holder_role": "REFEREE",
"object": "redeemable_holder",
"metadata": {
"influencer_code": true
}
},
{
"id": "rh_0f35d7ba9300a8e8e3",
"created_at": "2024-08-14T10:29:19.542Z",
"redeemable_id": "v_YdDGS5yBnLCp79vfPbHhkoRrqPwkgyiy",
"redeemable_object": "voucher",
"campaign_id": "camp_vVk4unz3k4gA023fk9XoSiTh",
"campaign_type": "REFERRAL_PROGRAM",
"voucher_type": "DISCOUNT_VOUCHER",
"customer_id": "cust_6P4K6p7PxEuK37sDtiLOii0A",
"holder_role": "REFEREE",
"object": "redeemable_holder",
"metadata": {
"influencer_code": false
}
}
],
"total": 2,
"has_more": true,
"more_starting_after": "rh_0f35d7ba9300a8e8e3"
}
```
## Shortcuts
List API methods offer a list of query parameters. These parameters allow you to filter the results. Each API resource enables a specific set of options which can be used for simplifying a query. If you need advanced options, read the [next section](#advanced-filters-for-fetching-resources).
| Resource | **Shortcuts** | **Example** |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| **Vouchers** | `customer` `campaign` `category` | `{api-url}/vouchers?customer=source_id` |
| **Redemptions** | `campaign_name` `customer` `voucher_code` `related_object_id` `related_object_parent_id` | `{api-url}/redemptions?customer=customer_id` `{api-url}/redemptions?customer=source_id` |
| **Customers** | `email` `name` | `{api-url}/[email protected]` |
| **Publications** | `campaign_name` `customer_id` `voucher_code` `result` `voucher_type` `is_referral_code` `parent_object_id` `related_object_id` | `{api-url}/publications?campaign_name=TEST` |
| **Validation Rule Assignments** | `related_object_id` `rule` | `{api-url}/validation-rules-assignments?related_object_id=promo_id` |
## Advanced filters for fetching resources
Moreover, API methods for fetching resources offer extended capabilities for filtering data. A user can build advanced queries by passing parameters that define search criteria.
| **Resource** | **Examples** |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Vouchers** | `[filters][active][conditions][$active]=true` `[filters][active][conditions][$expired]=true` `[filters][active][conditions][$enabled]=true` `[filters][active][conditions][$disabled]=true` `[filters][redemption.redeemed_quantity][conditions][$is]=0` `[filters][is_referral_code][conditions][$is]=true` `[filters][expiration_date][conditions][$before]=2024-04-29T00:00:00.000Z` `[filters][metadata.seq_number][conditions][$is]=1` |
| **Campaigns** | `[filters][metadata.seq_number][conditions][$is]=1` `[filters][metadata.test][conditions][$is]=true` |
| **Products and Skus** | `[filters][updated_at][conditions][$after][0]=2020-08-20T14:17:09Z` `[filters][updated_at][conditions][$before][0]=2020-08-20T14:17:09Z` `[filters][created_at][conditions][$after][0]=2020-08-20T14:17:09Z` `[filters][created_at][conditions][$before][0]=2020-08-20T14:17:09Z` |
| **List all promotion stacks** | `[created_at][before]=2021-12-30T13:52:18.227Z` `[created_at][after]=2021-12-30T13:52:18.227Z` `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` `[updated_at][before]=2021-12-30T13:52:18.227Z` `[updated_at][after]=2021-12-30T13:52:18.227Z` `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |
# Get Location
Source: https://docs.voucherify.io/api-reference/locations/get-location
/openapi/locations.json get /v1/locations/{locationId}
Returns a location object.
# List Locations
Source: https://docs.voucherify.io/api-reference/locations/list-locations
/openapi/locations.json get /v1/locations
Returns a list of your locations.
# Location Object
Source: https://docs.voucherify.io/api-reference/locations/location-object
Location object
| Attributes |
Description |
|
id
string
|
Unique location ID, assigned by the Voucherify API.
Example:
loc\_NoMGXmHO9OUs7iz9mGWpamma
|
|
object
string
|
The type of the object represented by JSON. This object stores information about a
location.
Available values:
location
|
|
name
string
|
Location name.
|
|
shape
object
|
Defines the shape and boundaries of the location.
One of:
-
Circle
-
Polygon
|
|
created\_at
string
|
Timestamp representing the date and time when the location was created. The value is shown in the ISO 8601 format.
Example:
2022-02-14T15:12:06.817Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the location was updated. The value is shown in the ISO 8601 format.
Example:
2022-03-14T15:12:06.817Z
|
Circle
| Attributes |
Description |
|
type
string
|
The type of shape being defined is a
circle.
Available values:
circle
|
|
format
string
|
The location is defined in terms of a
distance
object.
Available values:
distance
|
|
distance
object
|
Defines the parameters for the circle.
Distance
| Attributes |
Description |
|
center
string
|
Center of the circle identified by GPS coordinates in decimal degrees.
Example:
geo:40.79372699823857,-74.15092132694554
|
|
radius
string
|
Defines the radius of the circle.
|
|
Polygon
| Attributes |
Description |
|
type
string
|
The type of shape being defined is a
polygon.
Available values:
polygon
|
|
format
string
|
The location is defined in terms of a
geojson
object.
Available values:
geojson
|
|
geojson
|
One of:
-
Geojson Polygon
-
Geojson Multi Polygon
|
Geojson Polygon
| Attributes |
Description |
|
type
string
|
Type of geojson coordinates, i.e.
Polygon.
Available values:
Polygon
|
|
coordinates
|
See:
PolygonCoordinates
|
Geojson Multi Polygon
| Attributes |
Description |
|
type
string
|
Type of geojson coordinates, i.e.
MultiPolygon.
Available values:
MultiPolygon
|
|
coordinates
array
|
Array of
PolygonCoordinates
|
PolygonCoordinates
# Activate Member Pending Points
Source: https://docs.voucherify.io/api-reference/loyalties/activate-member-pending-points
/openapi/loyalties.json post /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/activate
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Activate manually the pending points and add them to the loyalty card. The pending points are determined by the pending point ID.
Once activated, the pending point entry with that ID is not listed by the endpoints: List member ([with campaign ID](/api-reference/loyalties/list-member-pending-points-with-campaign-id), [without campaign ID](/api-reference/loyalties/list-member-pending-points)), [List campaign pending points](/api-reference/loyalties/list-campaign-pending-points).
This **POST** method does not require a request body.
Configuring pending points
Pending points are configured as part of an earning rule with [POST Create earning rule](/api-reference/loyalties/create-earning-rule) or [PUT Update earning rule](/api-reference/loyalties/update-earning-rule).
# Add Member
Source: https://docs.voucherify.io/api-reference/loyalties/add-member
/openapi/loyalties.json post /v1/loyalties/{campaignId}/members
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
This method assigns a loyalty card to a customer. It selects a [loyalty card](/api-reference/vouchers/get-voucher) suitable for publication, adds a publish entry, and returns the published voucher.
A voucher is suitable for publication when it's active and hasn't been published yet.
Auto-update campaign
In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use **auto-update** campaign.
# Adjust Loyalty Card Balance
Source: https://docs.voucherify.io/api-reference/loyalties/adjust-loyalty-card-balance
/openapi/loyalties.json post /v1/loyalties/members/{memberId}/balance
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
This method gives adds or removes balance to an existing loyalty card that is assigned to a holder. The removal of points will consume the points that expire the soonest.
Async Action
This is an async action. If you want to perform several add or remove loyalty card balance actions in a short time and their order matters, set up sufficient time-out between the calls.
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/adjust-loyalty-card-balance-with-campaign-id). The URL was re-designed to allow you to add or remove loyalty card balance without having to provide the `campaignId` as a path parameter.
# Adjust Loyalty Card Balance with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/adjust-loyalty-card-balance-with-campaign-id
/openapi/loyalties.json post /v1/loyalties/{campaignId}/members/{memberId}/balance
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
This method adds or removes balance to an existing loyalty card that is assigned to a holder. The removal of points will consume the points that expire the soonest.
Async Action
This is an async action. If you want to perform several add or remove loyalty card balance actions in a short time and their order matters, set up sufficient time-out between the calls.
# Adjust Member Pending Points
Source: https://docs.voucherify.io/api-reference/loyalties/adjust-member-pending-points
/openapi/loyalties.json post /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/balance
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Adjusts the pending points with a given ID. You can add or subtract the number of points.
Configuring pending points
Pending points are configured as part of an earning rule with [POST Create earning rule](/api-reference/loyalties/create-earning-rule) or [PUT Update earning rule](/api-reference/loyalties/update-earning-rule).
# Cancel Member Pending Points
Source: https://docs.voucherify.io/api-reference/loyalties/cancel-member-pending-points
/openapi/loyalties.json post /v1/loyalties/members/{memberId}/pending-points/{pendingPointsId}/cancel
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Cancel manually the pending points for the loyalty card. The pending points are determined by the pending point ID.
Once canceled, the pending point entry with that ID is not listed by the endpoints: List member ([with campaign ID](/api-reference/loyalties/list-member-pending-points-with-campaign-id), [without campaign ID](/api-reference/loyalties/list-member-pending-points)), [List campaign pending points](/api-reference/loyalties/list-campaign-pending-points).
This **POST** method does not require a request body and it returns an empty, 204, response.
Configuring pending points
Pending points are configured as part of an earning rule with [POST Create earning rule](/api-reference/loyalties/create-earning-rule) or [PUT Update earning rule](/api-reference/loyalties/update-earning-rule).
# Create Earning Rule
Source: https://docs.voucherify.io/api-reference/loyalties/create-earning-rule
/openapi/loyalties.json post /v1/loyalties/{campaignId}/earning-rules
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Create earning rules for a loyalty campaign.
Maximum number of earning rules
You can create up to 100 earning rules per project. The limit can be customized for clients with a single-tenant setup.
# Create Loyalty Campaign
Source: https://docs.voucherify.io/api-reference/loyalties/create-loyalty-campaign
/openapi/loyalties.json post /v1/loyalties
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Creates a batch of [loyalty cards](/api-reference/loyalties/get-member) aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern.
Global uniqueness
All codes are unique across the whole project. Voucherify won't allow to generate the same codes in any of your campaigns.
Asynchronous action!
This is an asynchronous action, you can't read or modify a newly created campaign until the code generation is completed. See `creation_status` field in the [loyalty campaign object](/api-reference/loyalties/loyalty-campaign-object) description.
# Create Loyalty Campaign Reward Assignment
Source: https://docs.voucherify.io/api-reference/loyalties/create-loyalty-campaign-reward-assignment
/openapi/loyalties.json post /v1/loyalties/{campaignId}/rewards
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Add rewards to a loyalty campaign.
# Create loyalty tiers
Source: https://docs.voucherify.io/api-reference/loyalties/create-loyalty-tiers
/openapi/loyalties.json post /v1/loyalties/{campaignId}/tiers
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Creates loyalty tiers for desired campaign.
# Delete Campaign Reward Assignment
Source: https://docs.voucherify.io/api-reference/loyalties/delete-campaign-reward-assignment
/openapi/loyalties.json delete /v1/loyalties/{campaignId}/rewards/{assignmentId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
This method deletes a reward assignment for a particular loyalty campaign.
# Delete Earning Rule
Source: https://docs.voucherify.io/api-reference/loyalties/delete-earning-rule
/openapi/loyalties.json delete /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
This method deletes an earning rule for a specific loyalty campaign.
# Delete Loyalty Campaign
Source: https://docs.voucherify.io/api-reference/loyalties/delete-loyalty-campaign
/openapi/loyalties.json delete /v1/loyalties/{campaignId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Deletes a loyalty campaign and all related loyalty cards. This action cannot be undone. Also, it immediately removes any redemptions on loyalty cards.
If the `force` parameter is set to `false` or not set at all, the loyalty campaign and all related loyalty cards will be moved to [the bin](/api-reference/bin/list-bin-entries).
# Disable Earning Rule
Source: https://docs.voucherify.io/api-reference/loyalties/disable-earning-rule
/openapi/loyalties.json post /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Disable an earning rule.
# Earning Rule Object
Source: https://docs.voucherify.io/api-reference/loyalties/earning-rule-object
Earning Rule
All of:
-
EarningRuleBase
-
| Attributes |
Description |
|
validation\_rule\_id
string,
null
|
A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.
|
|
active
boolean
|
A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start\_date and expiration\_date of the campaign or the earning rule's own start\_date and expiration\_date.
-
true
indicates an active earning rule
-
false
indicates an inactive earning rule
|
EarningRuleBase
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the earning rule object.
|
|
created\_at
string
|
Timestamp representing the date and time when the earning rule was created. The value is shown in the ISO 8601 format.
|
|
loyalty
|
One of:
-
Define fixed amount of points
-
Calculate points proportionally
|
|
event
|
Defines the event which triggers the earning rule to add points to a loyalty card.
Earning Rule Event
|
|
custom\_event
object
|
Contains details about the custom event.
| Attributes |
Description |
|
schema\_id
string
|
Unique identifier of the custom event schema
|
|
|
segment
object
|
Contains the ID of a customer segment. Required for the
customer.segment.entered
option in the event.
| Attributes |
Description |
|
id
string
|
Contains a unique identifier of a customer segment. Assigned by the Voucherify API.
|
|
|
loyalty\_tier
object
|
Defines the tier associated with the earning rule definition.
| Attributes |
Description |
|
id
string
|
Unique loyalty tier ID associated with the earning rule.
-
**ANY**
: any loyalty tier within the campaign
Example:
ltr\_pudTGWasuIqxdiDM0go31OV1
|
|
|
pending\_points
object
|
Defines the configuration for pending points. Pending points can be used only with the
order.paid
event.
| Attributes |
Description |
|
period\_type
string
|
Defines the type of the period during which the points are in the pending state. Currently, only
DAY
value is accepted.
Available values:
DAY
|
|
period\_value
integer
|
Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90.
|
|
|
source
object
|
Contains the custom earning rule name and parent campaign.
| Attributes |
Description |
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
|
|
object\_id
string
|
A unique campaign identifier assigned by the Voucherify API.
|
|
object\_type
string
|
Defines the object associated with the earning rule. Defaults to
campaign.
Available values:
campaign
|
|
|
object
string
|
The type of the object represented by JSON. Default is earning\_rule.
Available values:
earning\_rule
|
|
automation\_id
string
|
For internal use by Voucherify.
|
|
start\_date
string
|
Start date defines when the earning rule starts to be active. Activation timestamp is presented in the ISO 8601 format. The earning rule is inactive before this date. If you do not define the start date for an earning rule, it will inherit the campaign start date by default.
|
|
expiration\_date
string
|
Expiration date defines when the earning rule expires. Expiration timestamp is presented in the ISO 8601 format. The earning rule is inactive after this date. If you do not define the expiration date for an earning rule, it will inherit the campaign expiration date by default.
|
|
validity\_timeframe
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
metadata
object
|
The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format.
|
|
expiration\_rules
|
See:
Earning Rule Expiration Rules
|
Define fixed amount of points
| Attributes |
Description |
|
type
string
|
The number of points to be added to the loyalty card.
Available values:
FIXED
|
|
points
integer
|
Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
Calculate points proportionally
One of:
-
Define amount of points proportional to the order
-
Define amount of points proportional to order items
-
Define amount of points proportional to customer metadata
-
Earning Rule Proportional Custom Event
Earning Rule Event
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Earning Rule Expiration Rules
| Attributes |
Description |
|
period\_type
string
|
Type of period. Can be set for
MONTH
or
FIXED\_DAY\_OF\_YEAR.
MONTH
requires the
period\_value
field.
FIXED\_DAY\_OF\_YEAR
requires the
fixed\_month
and
fixed\_day
fields.
Available values:
FIXED\_DAY\_OF\_YEAR,
MONTH
|
|
period\_value
integer
|
Value of the period. Required for the
period\_type: MONTH.
|
|
rounding\_type
string
|
Type of rounding of the expiration period. Optional for the
period\_type: MONTH.
Available values:
END\_OF\_MONTH,
END\_OF\_QUARTER,
END\_OF\_HALF\_YEAR,
END\_OF\_YEAR,
PARTICULAR\_MONTH
|
|
rounding\_value
integer
|
Value of rounding of the expiration period. Required for the
rounding\_type.
|
|
fixed\_month
integer
|
Determines the month when the points expire;
1
is January,
2
is February, and so on. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
|
fixed\_day
integer
|
Determines the day of the month when the points expire. Required for the
period\_type: FIXED\_DAY\_OF\_YEAR.
|
Define amount of points proportional to the order
One of:
-
Order Amount
-
Order Total Amount
-
Order Metadata
Define amount of points proportional to order items
One of:
-
Order Items Quantity
-
Order Items Amount
-
Order Items Subtotal Amount
Define amount of points proportional to customer metadata
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
CUSTOMER\_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)
Available values:
CUSTOMER\_METADATA
|
|
customer
object
|
| Attributes |
Description |
|
metadata
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.
| Attributes |
Description |
|
every
integer
|
For how many increments of the customer metadata property to grant points for.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
property
string
|
Customer metadata property.
|
|
|
Earning Rule Proportional Custom Event
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
CUSTOM\_EVENT\_METADATA: Custom event metadata (X points for every Y in metadata attribute).
Available values:
CUSTOM\_EVENT\_METADATA
|
|
custom\_event
object
|
| Attributes |
Description |
|
metadata
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.
| Attributes |
Description |
|
every
integer
|
For how many increments of the customer metadata property to grant points for.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
property
string
|
Custom event metadata property.
|
|
|
Order Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_AMOUNT
: Pre-discount order amount (X points for every Y spent excluding discounts)
Available values:
ORDER\_AMOUNT
|
|
order
object
|
| Attributes |
Description |
|
amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
|
Order Total Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_TOTAL\_AMOUNT
: Total order amount (X points for every Y spent including discount)
Available values:
ORDER\_TOTAL\_AMOUNT
|
|
order
object
|
| Attributes |
Description |
|
total\_amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
|
Order Metadata
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_METADATA
: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)
Available values:
ORDER\_METADATA
|
|
order
object
|
Defines the formula for calculating points proportionally.
| Attributes |
Description |
|
metadata
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.
| Attributes |
Description |
|
every
integer
|
For how many increments of the order metadata property to grant points for.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
property
string
|
Order metadata property.
|
|
|
Order Items Quantity
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_ITEMS\_QUANTITY
: Quantity of items defined in the
order\_items.quantity.applicable\_to
array or
order\_items.quantity.object
&
.id
(X points for every Y items excluding free items).
Available values:
ORDER\_ITEMS\_QUANTITY
|
|
order\_items
object
|
| Attributes |
Description |
|
quantity
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
object
string
|
Type of object which will be covered by the earning rule. This is required together with
id.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. This is required together with
object.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
applicable\_to
array
|
Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by
object
and
id
to define only one object.
Array of:
| Attributes |
Description |
|
object
string
|
Type of object which will be covered by the earning rule.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
|
|
Order Items Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_ITEMS\_AMOUNT; Pre-discount amount spent on items defined in the
order\_items.quantity.applicable\_to
array or
order\_items.quantity.object
&
.id
(X points for every Y spent on items excluding discounts)
Available values:
ORDER\_ITEMS\_AMOUNT
|
|
order\_items
object
|
| Attributes |
Description |
|
amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
object
string
|
Type of object which will be covered by the earning rule. This is required together with
id.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. This is required together with
object.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
applicable\_to
array
|
Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by
object
and
id
to define only one object.
Array of:
| Attributes |
Description |
|
object
string
|
Type of object which will be covered by the earning rule.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
|
|
Order Items Subtotal Amount
| Attributes |
Description |
|
type
string
|
Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio.
Available values:
PROPORTIONAL
|
|
calculation\_type
string
|
ORDER\_ITEMS\_SUBTOTAL\_AMOUNT; Amount spent on items defined in the order\_items.subtotal\_amount.object & .id (X points for every Y spent on items including discounts)
Available values:
ORDER\_ITEMS\_SUBTOTAL\_AMOUNT
|
|
order\_items
object
|
| Attributes |
Description |
|
subtotal\_amount
object
|
Defines the ratio based on the property defined in the calculation\_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation\_type, give the customer the number of points defined in the points parameter. In other words, for every calculation\_type, give points.
| Attributes |
Description |
|
every
integer
|
Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 order amount is written as 1000.
|
|
points
integer
|
Number of points to be awarded, i.e. how many points to be added to the loyalty card.
|
|
points\_formula
string
|
Formula used to dynamically calculate the rewarded points.
|
|
object
string
|
Type of object which will be covered by the earning rule. This is required together with
id.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. This is required together with
object.
Can be replaced by the
applicable\_to
array. In response, the value of the first object is returned even if
applicable\_to
array was used. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
applicable\_to
array
|
Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by
object
and
id
to define only one object.
Array of:
| Attributes |
Description |
|
object
string
|
Type of object which will be covered by the earning rule.
Available values:
products\_collection,
product,
sku
|
|
id
string
|
Unique ID of the resource assigned by Voucherify. Values are, for example,
pc\_75U0dHlr7u75BJodrW1AE3t6
for product collection,
prod\_0bae32322150fd0546
for a product, or
sku\_0b7d7dfb090be5c619
for a SKU.
|
|
|
|
# Enable Earning Rule
Source: https://docs.voucherify.io/api-reference/loyalties/enable-earning-rule
/openapi/loyalties.json post /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Enable an earning rule.
# Estimate loyalty points
Source: https://docs.voucherify.io/api-reference/loyalties/estimate-loyalty-points
/openapi/loyalties.json post /v1/loyalties/{campaignId}/qualifications
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Estimates the number of points a customer will receive for a given order in the loyalty campaign under its earning rules. This endpoint also returns point estimation for created transactions (orders with status `PAID`)
This endpoint returns only an estimation, not a precise point value.
Also, this estimation works only for the Order paid earning rules. If a campaign includes tiers, mappings, and multiple earning rules, the calculation becomes more complex. During final calculation, a customer may change tiers and earn more or fewer points depending on other factors.
# Export Loyalty Campaign Point Expiration
Source: https://docs.voucherify.io/api-reference/loyalties/export-loyalty-campaign-point-expiration
/openapi/loyalties.json post /v1/loyalties/{campaignId}/points-expiration/export
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Schedule the generation of a point expiration CSV file for a particular campaign. It can list point buckets, which can have an `ACTIVE` or `EXPIRED` status.
# Export Loyalty Campaign Transactions
Source: https://docs.voucherify.io/api-reference/loyalties/export-loyalty-campaign-transactions
/openapi/loyalties.json post /v1/loyalties/{campaignId}/transactions/export
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Export transactions is an asynchronous process that generates a CSV file with the data about or point movements on all loyalty cards in a given campaign.
To export transactions:
1. In the export request, use parameters to select which fields will be exported, in what order, and which data will be filtered.
2. Use the returned `id` to track the export status with the [GET Export](/api-reference/exports/get-export) method.
3. In the GET Export method, when the returned `status` field has the `DONE` value, the export file has been generated.
4. Use the URL in the `result` property to download the file. You must be logged to your Voucherify account on a given cluster in the browser to be able to download the file.
An export request will almost always result in a single file being generated by the system. However, when the data volume is large, the system may split the results into multiple files.
An example export file can look as follows:
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| `id` | Unique transaction ID. | `vtx_0cb7811f1c07765800` |
| `type` | Transaction type. | - `POINTS_ACCRUAL`
- `POINTS_REDEMPTION`
- `POINTS_REFUND`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_EXPIRATION`
- `POINTS_TRANSFER_IN`
- `POINTS_TRANSFER_OUT` |
| `source_id` | Unique transaction source ID. Optional and only in manual operations: `POINTS_ADDITION`, `POINTS_REMOVAL`, `POINTS_TRANSFER_OUT`. | 8638 |
| `reason` | Contains the reason for the transaction if one was included originally. Optional and only in the following manual operations: `POINTS_ADDITION`, `POINTS_REMOVAL`, `POINTS_TRANSFER_OUT`, `POINTS_TRANSFER_IN`. | `Apology for sending a broken item` |
| `balance` | The gift card or loyalty card balance after the transaction. | |
| `amount` | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| `created_at` | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | `2024-10-09T09:16:32.521Z` |
| `voucher_id` | Unique voucher ID. | `v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp` |
| `source`| Channel through which the transaction was initiated. | `API` |
| `details` | More detailed information stored in the form of JSON. | Provides more details related to the transaction in the form of an object. |
| `related_transaction_id` | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | `vtx_0c9afe802593b34b80` |
Export Campaign Transactions
This method works in the same way the [POST Export Campaign Transactions](/api-reference/campaigns/export-campaign-transactions) does, but it is limited to loyalty campaigns only. The POST Export Campaign Transactions method can also export gift card campaign transactions.
# Export Loyalty Card Transactions
Source: https://docs.voucherify.io/api-reference/loyalties/export-loyalty-card-transactions
/openapi/loyalties.json post /v1/loyalties/members/{memberId}/transactions/export
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Export transactions that are associated with point movements on a loyalty card.
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |
| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |
| reason | Contains the reason for the transaction if one was included originally. | |
| balance | The loyalty card balance after the transaction. | |
| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |
| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |
# Export Loyalty Card Transactions with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/export-loyalty-card-transactions-with-campaign-id
/openapi/loyalties.json post /v1/loyalties/{campaignId}/members/{memberId}/transactions/export
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Export transactions that are associated with point movements on a loyalty card.
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |
| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |
| reason | Contains the reason for the transaction if one was included originally. | |
| balance | The loyalty card balance after the transaction. | |
| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |
| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |
# Get Campaign Reward Assignment
Source: https://docs.voucherify.io/api-reference/loyalties/get-campaign-reward-assignment
/openapi/loyalties.json get /v1/loyalties/{campaignId}/rewards/{assignmentId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve specific reward assignment.
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/get-campaign-reward-assignments).
# Get Campaign Reward Assignments
Source: https://docs.voucherify.io/api-reference/loyalties/get-campaign-reward-assignments
/openapi/loyalties.json get /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve specific reward assignment.
# Get Earning Rule
Source: https://docs.voucherify.io/api-reference/loyalties/get-earning-rule
/openapi/loyalties.json get /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieves an earning rule assigned to a campaign.
# Get Loyalty Campaign
Source: https://docs.voucherify.io/api-reference/loyalties/get-loyalty-campaign
/openapi/loyalties.json get /v1/loyalties/{campaignId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve a specific loyalty campaign.
# Get Loyalty Tier
Source: https://docs.voucherify.io/api-reference/loyalties/get-loyalty-tier
/openapi/loyalties.json get /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID.
# Get Member
Source: https://docs.voucherify.io/api-reference/loyalties/get-member
/openapi/loyalties.json get /v1/loyalties/members/{memberId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve loyalty card with the given member ID (i.e. voucher code).
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/get-member-with-campaign-id). The URL was re-designed to allow you to retrieve loyalty card details without having to provide the `campaignId` as a path parameter.
# Get Member with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/get-member-with-campaign-id
/openapi/loyalties.json get /v1/loyalties/{campaignId}/members/{memberId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieves the loyalty card with the given member ID (i.e. voucher code).
# Get Reward Details
Source: https://docs.voucherify.io/api-reference/loyalties/get-reward-details
/openapi/loyalties.json get /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Get reward details in the context of a loyalty campaign and reward assignment ID.
# Legacy loyalty API
Source: https://docs.voucherify.io/api-reference/loyalties/introduction-to-legacy-loyalty
Legacy loyalty API endpoints for managing loyalty campaigns, members, points, tiers, and rewards.
Legacy loyalty API
These endpoints belong to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. Critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/guides/loyalty-v2-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
The Loyalties API lets you manage legacy loyalty campaigns and their members, points, earning rules, tiers, and rewards through the `/v1/loyalties` endpoints.
For the current loyalty solution, see:
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview)
* [Loyalty v2 developer overview](/guides/loyalty-v2-overview)
* [Integrate loyalty v2](/guides/loyalty-v2-integrate)
* [Loyalty hub overview](/build/loyalty-overview)
# List Campaign Pending Points
Source: https://docs.voucherify.io/api-reference/loyalties/list-campaign-pending-points
/openapi/loyalties.json get /v1/loyalties/{campaignId}/pending-points
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Lists all pending points that are currently assigned to all loyalty cards in a campaign. Once the points are added to the card, the entry is no longer returned.
Configuring pending points
Pending points are configured as part of an earning rule with [POST Create earning rule](/api-reference/loyalties/create-earning-rule) or [PUT Update earning rule](/api-reference/loyalties/update-earning-rule).
# List Campaign Rewards
Source: https://docs.voucherify.io/api-reference/loyalties/list-campaign-rewards
/openapi/loyalties.json get /v1/loyalties/{campaignId}/rewards
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Returns active rewards from a given loyalty campaign.
# List Earning Rules
Source: https://docs.voucherify.io/api-reference/loyalties/list-earning-rules
/openapi/loyalties.json get /v1/loyalties/{campaignId}/earning-rules
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Returns a list of all earning rules within a given campaign.
# List Loyalty Campaign Transactions
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-campaign-transactions
/openapi/loyalties.json get /v1/loyalties/{campaignId}/transactions
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieves all transactions for the campaign with the given campaign ID or campaign name.
# List Loyalty Campaigns
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-campaigns
/openapi/loyalties.json get /v1/loyalties
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Returns a list of your loyalty campaigns.
# List Loyalty Card Point Expiration
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-card-point-expiration
/openapi/loyalties.json get /v1/loyalties/{campaignId}/members/{memberId}/points-expiration
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the [Exports API](/api-reference/exports/create-export) to retrieve a list of both `ACTIVE` and `EXPIRED` point buckets.
# List Loyalty Card Transactions
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-card-transactions
/openapi/loyalties.json get /v1/loyalties/members/{memberId}/transactions
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve transaction data related to point movements for a specific loyalty card.
# List Loyalty Card Transactions with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-card-transactions-with-campaign-id
/openapi/loyalties.json get /v1/loyalties/{campaignId}/members/{memberId}/transactions
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve transaction data related to point movements for a specific loyalty card.
# List Loyalty Tier Earning Rules
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-tier-earning-rules
/openapi/loyalties.json get /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve available earning rules for a given tier and the calculation method for earning points.
# List Loyalty Tier Rewards
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-tier-rewards
/openapi/loyalties.json get /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/rewards
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Get available rewards for a given tier.
# List Loyalty Tiers
Source: https://docs.voucherify.io/api-reference/loyalties/list-loyalty-tiers
/openapi/loyalties.json get /v1/loyalties/{campaignId}/tiers
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve a list of loyalty tiers which were added to the loyalty program.
# List Member Activity
Source: https://docs.voucherify.io/api-reference/loyalties/list-member-activity
/openapi/loyalties.json get /v1/loyalties/members/{memberId}/activity
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/list-member-activity-with-campaign-id). The URL was re-designed to allow you to get member activities without having to provide the `campaignId` as a path parameter.
Retrieves the list of activities for the given member ID related to a voucher and customer who is the holder of the voucher.
# List Member Activity with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/list-member-activity-with-campaign-id
/openapi/loyalties.json get /v1/loyalties/{campaignId}/members/{memberId}/activity
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieves the list of activities for the given member ID related to a voucher and customer who is the holder of the voucher.
# List Member Pending Points
Source: https://docs.voucherify.io/api-reference/loyalties/list-member-pending-points
/openapi/loyalties.json get /v1/loyalties/members/{memberId}/pending-points
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/list-member-pending-points-with-campaign-id). The URL was re-designed to list member pending points without having to provide the `campaignId` as a path parameter.
Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned.
Configuring pending points
Pending points are configured as part of an earning rule with [POST Create earning rule](/api-reference/loyalties/create-earning-rule) or [PUT Update earning rule](/api-reference/loyalties/update-earning-rule).
# List Member Pending Points with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/list-member-pending-points-with-campaign-id
/openapi/loyalties.json get /v1/loyalties/{campaignId}/members/{memberId}/pending-points
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Lists all pending points that are currently assigned to the loyalty card. Once the points are added to the card, the entry is no longer returned.
Configuring pending points
Pending points are configured as part of an earning rule with [POST Create earning rule](/api-reference/loyalties/create-earning-rule) or [PUT Update earning rule](/api-reference/loyalties/update-earning-rule).
# List Member Rewards
Source: https://docs.voucherify.io/api-reference/loyalties/list-member-rewards
/openapi/loyalties.json get /v1/loyalties/members/{memberId}/rewards
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieves the list of rewards that the given customer (identified by `member_id`, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**.
You can use the `affordable_only` parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card).
Please note that rewards that are disabled (i.e. set to `Not Available` in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint.
# List Members
Source: https://docs.voucherify.io/api-reference/loyalties/list-members
/openapi/loyalties.json get /v1/loyalties/{campaignId}/members
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.
# List Member's Loyalty Tiers
Source: https://docs.voucherify.io/api-reference/loyalties/list-members-loyalty-tiers
/openapi/loyalties.json get /v1/loyalties/members/{memberId}/tiers
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Retrieve member tiers using the loyalty card ID.
# List Reward Assignments with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/list-reward-assignments-with-campaign-id
/openapi/loyalties.json get /v1/loyalties/{campaignId}/reward-assignments
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Returns reward assignments from a given loyalty campaign.
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/list-campaign-rewards). The URL was re-designed to be more contextual to the type of data returned in the response.
# Loyalty Campaign Object
Source: https://docs.voucherify.io/api-reference/loyalties/loyalty-campaign-object
Loyalty Campaign Object
| Attributes |
Description |
|
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.
-
AUTO\_UPDATE
: the campaign is dynamic, i.e. vouchers will generate based on set criteria
-
STATIC
: vouchers need to be manually published
Available values:
AUTO\_UPDATE,
STATIC
|
|
voucher
|
See:
Loyalty Card
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
activity\_duration\_after\_publishing
string
|
Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value 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.
-
true
indicates an
active
campaign
-
false
indicates an
inactive
campaign
|
|
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. The value is shown in the ISO 8601 format.
Example:
2021-12-01T08:00:50.038Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the voucher was updated. The value is shown in the 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.
|
|
access\_settings\_assignments
|
See:
Access Settings Campaign Assignments List
|
|
category\_id
string
|
Unique category ID that this campaign belongs to.
Example:
cat\_0b688929a2476386a7
|
|
categories
|
See:
Category
|
|
loyalty\_tiers\_expiration
object
|
Defines the expiration mechanism for loyalty tiers.
One of:
-
Balance
-
Points in Period
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the campaign.
|
Loyalty Card
| Attributes |
Description |
|
type
string
|
Type of voucher.
|
|
loyalty\_card
object
|
Defines the loyalty card details.
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
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).
| Attributes |
Description |
|
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
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Access Settings Campaign Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. Default is
list.
This object stores information about campaign assignments to areas and stores
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of campaign assignments.
Available values:
data
|
|
data
array
|
Contains an array of campaign assignments.
Array of
Areas and Stores Campain Assignment
|
|
total
integer
|
Total number of areas and stores to which the campaign is assigned.
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Balance
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
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.
One of:
-
Balance Drop
-
Custom
|
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.
|
Period
|
Definition
|
|
Calendar Month
|
Points collected in one calendar month
January, February, March, etc.
|
|
Calendar Quarter
|
Points collected in the quarter
\- January - March
\- April - June
\- July - September
\- October - December
|
|
Calendar Half-year
|
Points collected in the half-year
\- January - June
\- July - December
|
|
Calendar Year
|
Points 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.
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
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.
|
|
Areas and Stores Campain Assignment
| Attributes |
Description |
|
id
string
|
Unique identifier of the campaign assignment.
Example:
arsca\_0ef5ee192117ae2416
|
|
area\_id
string
|
Unique identifier of the area to which the campaign is assigned.
Example:
ar\_0ea6cd7b781b8f857f
|
|
all\_stores
boolean
|
Determines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the
access\_settings.assign.area\_all\_stores\_ids
in the request.
|
|
area\_store\_id
string
|
Unique identifier of the store to which the campaign is assigned.
Example:
ars\_0ec347e2016bed85f4
|
|
created\_at
string
|
Date and time when the assignment was made. The value is shown in the ISO 8601 format.
Example:
2024-06-25T19:04:16.260Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores.
Available values:
area\_store\_campaign\_assignment
|
Balance Drop
| Attributes |
Description |
|
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
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.
One of:
-
Calendar Periods
-
Specific Month
|
Calendar Periods
| Attributes |
Description |
|
type
string
|
Period to which the expiration will be rounded to.
-
MONTH
: The expiration date will be rounded to the end of the month.
-
QUARTER
: The expiration date will be rounded to the end of the quarter.
-
HALF\_YEAR
: The expiration date will be rounded to the half year.
-
YEAR
: The expiration date will be rounded to the end of the year.
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
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.
-
0
: January
-
1
: February
-
2
: March
-
3
: April
-
4
: May
-
5
: June
-
6
: July
-
7
: August
-
8
: September
-
9
: October
-
10
: November
-
11
: December
|
# Loyalty Card Object
Source: https://docs.voucherify.io/api-reference/loyalties/loyalty-card-object
Loyalty Card Object
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
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.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
categories
array
|
Contains details about the category.
Array of
Category
|
|
type
string
|
Defines the type of the voucher.
Available values:
LOYALTY\_CARD
|
|
discount
object,
null
|
Object representing discount parameters. Child attributes are present only if
type
is
DISCOUNT\_VOUCHER.
Defaults to
null.
|
|
gift
object,
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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.
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](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;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//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.
| Required |
Optional |
type
:
LOYALTY\_CARD
|
type
:
DISCOUNT\_VOUCHER
|
is\_referral\_code
:
true
|
type
:
GIFT\_VOUCHER
|
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
# Loyalty Tier Object
Source: https://docs.voucherify.io/api-reference/loyalties/loyalty-tier-object
Loyalty Tier
All of:
-
Loyalty Tier Base
-
| Attributes |
Description |
|
id
string
|
Unique loyalty tier ID.
|
|
campaign\_id
string
|
Unique parent campaign ID.
|
|
metadata
object,
null
|
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. The value is shown in the ISO 8601 format.
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format.
|
|
config
object
|
Defines loyalty tier range in points.
| Attributes |
Description |
|
points
object
|
Defines range of loyalty tier in points.
| Attributes |
Description |
|
from
integer
|
Bottom points threshold value.
|
|
to
integer
|
Top points threshold value.
|
|
|
|
expiration
|
See:
Loyalty Tier Expiration
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the loyalty.
Available values:
loyalty\_tier
|
Loyalty Tier Base
| Attributes |
Description |
|
name
string
|
Loyalty Tier name.
|
|
earning\_rules
object
|
Contains a list of earning rule IDs and their points mapping for the given earning rule.
|
|
rewards
object
|
Contains a list of reward IDs and their points mapping for the given reward.
|
|
points
object
|
Defines range of loyalty tier in points.
| Attributes |
Description |
|
from
integer
|
Bottom points threshold value.
|
|
to
integer
|
Top points threshold value.
|
|
Loyalty Tier Expiration
| Attributes |
Description |
|
customer\_id
string
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
campaign\_id
string
|
Unique campaign ID, assigned by Voucherify.
Example:
camp\_rRsfatlwN7unSeUIJDCYedal
|
|
tier\_id
string
|
Unique tier ID, assigned by Voucherify.
|
|
start\_date
string
|
Activation timestamp defines when the loyalty tier starts to be active in ISO 8601 format. Loyalty tier is inactive before this date.
|
|
expiration\_date
string
|
Expiration timestamp defines when the loyalty tier expires in ISO 8601 format. Loyalty tier is inactive after this date.
|
|
created\_at
string
|
Timestamp representing the date and time when the loyalty tier was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
MappingPoints
One of:
-
MappingMultiply
-
MappingFixed
MappingMultiply
| Attributes |
Description |
|
type
string
|
Type of calculation.
Available values:
MULTIPLY
|
|
multiplier
number
|
Multiplication factor used to multiply the points to obtain the mapped points.
|
MappingFixed
| Attributes |
Description |
|
type
string
|
Type of calculation.
Available values:
CUSTOM
|
|
points
integer
|
Fixed number of points to be applied.
|
# Redeem Reward
Source: https://docs.voucherify.io/api-reference/loyalties/redeem-reward
/openapi/loyalties.json post /v1/loyalties/members/{memberId}/redemption
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Alternative endpoint
This endpoint is an alternative to this [endpoint](/api-reference/loyalties/redeem-reward-with-campaign-id). The URL was re-designed to allow you to redeem a reward without having to provide the `campaignId` as a path parameter.
# Redeem Reward with campaign ID
Source: https://docs.voucherify.io/api-reference/loyalties/redeem-reward-with-campaign-id
/openapi/loyalties.json post /v1/loyalties/{campaignId}/members/{memberId}/redemption
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Exchange points from a loyalty card for a specified reward. This API method returns an assigned award in the response. It means that if a requesting customer gets a coupon code with a discount for the next order, that discount code will be visible in response as part of the reward object definition.
# Transfer Loyalty Points
Source: https://docs.voucherify.io/api-reference/loyalties/transfer-loyalty-points
/openapi/loyalties.json post /v1/loyalties/{campaignId}/members/{memberId}/transfers
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Transfer points between different loyalty cards which have holders.
Provide the campaign ID and the loyalty card ID you want the points to be transferred to as path parameters. In the request body, provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.
Transfer works only for loyalty cards that have holders, meaning the cards were published to customers.
The transferred points expire according to the target program expiration rules.
# Update Campaign Reward Assignment
Source: https://docs.voucherify.io/api-reference/loyalties/update-campaign-reward-assignment
/openapi/loyalties.json put /v1/loyalties/{campaignId}/rewards/{assignmentId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Updates rewards parameters, i.e. the points cost for the specific reward.
# Update Earning Rule
Source: https://docs.voucherify.io/api-reference/loyalties/update-earning-rule
/openapi/loyalties.json put /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Update an earning rule definition.
# Update Loyalty Campaign
Source: https://docs.voucherify.io/api-reference/loyalties/update-loyalty-campaign
/openapi/loyalties.json put /v1/loyalties/{campaignId}
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (`/v1/loyalties`).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use [Loyalty v2](/build/loyalty-overview).
If you have questions, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support").
Updates a loyalty program.
Fields other than those specified in the allowed request body payload won't be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged.
This method will update the [loyalty cards](/api-reference/loyalties/get-member) which have not been published or redeemed yet.
# Loyalty v2 API: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-api-overview
Map the Loyalty v2 API under /v2/loyalties: Programs, reusable components, members, examine, and reports
The Loyalty v2 API lives under `/v2/loyalties`. It manages modular loyalty programs: Reusable components (card definitions, earning rules, rewards, benefits, and tier structures), program assignments, members and their cards, dry-run examine calls, and aggregated reports.
This is the entry point into the API reference. For product concepts and the **Loyalty hub**, see [Loyalty program overview](/build/loyalty-overview). For an integration-oriented map of the member journey, see [Loyalty v2 developer overview](/guides/loyalty-v2-overview).
Legacy `/v1/loyalties` remains in maintenance mode. For new integrations, use Loyalty v2. See [Legacy loyalty API](/api-reference/loyalties/introduction-to-legacy-loyalty).
## How resources connect
Loyalty v2 separates configuration from runtime membership:
* **Components** are created independently under their own paths (`/card-definitions`, `/earning-rules`, `/rewards`, `/benefits`, `/tier-structures`).
* A **program** (`/programs`) is the container that assigns those components into one customer-facing setup. Activation requires at least one active card definition (point wallet in the dashboard) and one active earning rule.
* **Members** enroll under a program. Voucherify issues one loyalty card per active card definition assigned to that program.
* **Examine** endpoints estimate earnings and reward availability without writing balances.
* **Reports** return aggregated program and member statistics for dashboards and analytics.
Many integrations configure the program in the dashboard (**Loyalty hub**), then automate only the runtime member journey through the API.
## API groups
Create and manage programs, and assign wallets, earning rules, tiers, and rewards.
Enroll members, read memberships, adjust points, list transactions, pay with points, and purchase rewards.
Dry-run earning and reward evaluation for member portals and checkout previews.
Configure point wallets: pending points, expiration, limits, and pay-with-points exchange.
Define triggers and earnings for orders, custom events, and segment entry.
Build the reward catalog members can purchase with points.
Define automatic material or digital grants from earning rules.
Configure tier levels and read tier progress on memberships.
Read aggregated spending, earnings, tier movements, and earning-rule statistics.
## Core objects and identifiers
Loyalty v2 uses program-scoped resources. Store these IDs in your system and pass the correct type on each call.
| Object | ID prefix | Role in the integration |
| ------------------------------ | -------------- | ---------------------------------------------------------- |
| Program | `lprg_` | Parent container for wallets, rules, rewards, and members |
| Card definition (point wallet) | `lcdef_` | Defines how points behave on cards issued from that wallet |
| Member | `lmbr_` | Program-specific enrollment of a Voucherify customer |
| Loyalty card | `lcrd_` | Point balance for one wallet on one member |
| Earning rule | `lern_` | Trigger and effects that grant points or benefits |
| Reward | `lrew_` | Catalog item members can purchase with points |
| Benefit | `lben_` | Automatic grant (material or digital) from an earning rule |
| Tier structure / tier | `lts_` / `lt_` | Levels and progress tied to a point wallet |
| Customer (shared) | `cust_` | Must exist before enrollment; not loyalty-specific |
Do not interchange `cust_…` and `lmbr_…`. Member endpoints expect a member ID. Membership lookup can use a customer ID with the correct identification type. Mixing IDs is a common cause of `404` responses. See [Take loyalty v2 to production](/guides/loyalty-v2-take-to-production#troubleshooting).
## Shared platform APIs
Loyalty v2 does not replace the rest of the Voucherify API. Runtime flows still use:
* [Authentication](/guides/authentication) and regional base URLs from [API overview](/guides/api-overview#choose-the-right-api-endpoint)
* [Customers](/api-reference/customers/create-customer) before membership
* [Orders](/api-reference/orders/create-order) with `status: PAID` for order-paid earning rules and pay with points
* [Custom events](/api-reference/events/track-custom-event) for event-based earning rules
* Discount or gift [campaigns](/build/campaign-overview) when rewards or benefits issue vouchers or credits
* [Async actions](/api-reference/async-actions/get-async-action) for background enrollment
## Related resources
* [Loyalty v2 developer overview](/guides/loyalty-v2-overview) for the member journey, constraints, and documentation map.
* [Integrate loyalty v2](/guides/loyalty-v2-integrate) for step-by-step API flows with example payloads.
* [Take loyalty v2 to production](/guides/loyalty-v2-take-to-production) for go-live and troubleshooting.
* [Loyalty program overview](/build/loyalty-overview) for the product model and rollout context.
* [Loyalty key concepts](/build/loyalty-key-concepts) for point wallets, earning rules, rewards, tiers, and benefits.
* [Legacy loyalty API](/api-reference/loyalties/introduction-to-legacy-loyalty) for the maintenance-mode `/v1/loyalties` endpoints.
# Benefits overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-benefits-overview
Understand how benefits let Loyalty v2 earning rules grant points, material items, or digital incentives automatically
A benefit is a value granted automatically to a member when an earning rule's conditions are met. It can serve as an alternative to earning points on a loyalty card or it can be used alongside points. Members don't redeem benefits themselves; they simply receive one once they fulfill the conditions of the earning rule that references it. Benefits are optional and are only useful once connected to at least one earning rule.
## Benefit types
A benefit must define exactly one type-specific configuration object that matches its `type`:
* `points`: A fixed number of points added to a card.
* `points_proportional`: Points calculated proportionally to a triggering value, such as order amount.
* `material`: A physical product or SKU.
* `digital`: A discount coupon or gift card.
## Stock
Like rewards, benefits can be limited in quantity through a `stock` configuration. When omitted, a benefit defaults to `UNLIMITED` stock, meaning it can be granted as many times as its earning rule is triggered.
## Referenced resources
Depending on its type, a benefit references other resources: A card definition for points-based benefits, or a product/SKU/campaign for material and digital benefits. These references are validated on create and update; for example, a points-based benefit can only be activated if its connected card definition is itself `ACTIVE`.
## Lifecycle
A benefit is created in `DRAFT` status by default, and only moves between `DRAFT` and `ACTIVE` through the activate and draft endpoints. There is no `INACTIVE` state. While in `DRAFT`, every property can be updated; once `ACTIVE`, only `name` and `stock` can still be changed.
Two safeguards protect benefits that are already wired into your program:
* A benefit that's referenced by any earning rule can't be deleted until that reference is removed.
* A benefit connected to an active earning rule can't be moved back to `DRAFT`.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Earning Rules overview](/api-reference/loyalty-v2-earning-rules-overview) for how benefits are triggered.
* [Rewards overview](/api-reference/loyalty-v2-rewards-overview) for the point-redeemable counterpart to benefits.
* [Create benefits](/build/create-benefits) for the dashboard perspective on configuring benefits.
# Card definitions: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-card-definitions-overview
Understand how card definitions configure the loyalty cards (point wallets) that store and govern a member's points in Loyalty v2
A card definition is the configuration blueprint for a loyalty card. In the **Loyalty hub** dashboard, this resource is called a **point wallet**. Every loyalty card a member holds is generated from a card definition, which controls how points on that card are held, spent, returned, and eventually expired.
A loyalty program can reference multiple card definitions. When a customer becomes a member of a program, Voucherify automatically creates one loyalty card for each active card definition assigned to that program, so a member can hold several point balances at once (for example, a standard points wallet and a separate seasonal-promotion wallet).
## What a card definition controls
Besides `name` and `type`, a card definition groups several independent configuration sections. Any section left out on creation falls back to a permissive default:
* `code_config`: The pattern used to generate loyalty card codes (defaults to a 10-character alphanumeric pattern).
* `points_expiration`: Whether and how points expire (defaults to `NO_EXPIRATION`).
* `pending_points`: Whether newly earned points are available immediately or held back for a period, until a fixed date, or until an activation event (defaults to `IMMEDIATE`).
* `earning_limits` and `spending_limits`: Global and per-transaction caps on how many points a member can earn or spend (default to `NO_LIMIT`).
* `refunds`: What happens to earned or spent points when a related order is refunded (default to `NONE`).
* `balance_settings`: Whether the card balance is allowed to go negative (defaults to disallowed).
* `pay_with_points`: The exchange ratio formula used when members pay for orders with points.
## Lifecycle
A card definition is created in `DRAFT` status by default. Use the activate and draft endpoints to move it between `DRAFT` and `ACTIVE`:
* `DRAFT` > `ACTIVE`: Makes the card definition eligible to be assigned to a program and used for new loyalty cards.
* `ACTIVE` > `DRAFT`: Makes the card definition editable again. However, you can't change the statue to `DRAFT` once it has been assigned to a program.
Once a card definition is `ACTIVE` and in use – for example assigned to a program that already issued cards from it – most configuration sections become locked to protect existing point balances. Only `name`, `metadata`, and `pay_with_points` can always be updated regardless of usage; other sections may be rejected with a resource-locked error until the card definition is no longer referenced.
## How card definitions fit into a program
Card definitions are standalone resources, created and managed independently of any single program, then connected through the [Programs](/api-reference/loyalty-v2-programs-overview) assignment endpoints. A program needs at least one active card definition before it can itself become `ACTIVE`. An active card definition can be deleted or removed from a program only when the program itself is deleted first.
Every activity performed on a card definition, like creation, updates, status transitions, and program assignments, is recorded and available through its [activity history endpoint](/api-reference/card-definitions/list-card-definition-activities). The `activities` endpoint is useful for auditing configuration changes over time.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Create point wallets](/build/create-point-wallets) for the point wallet concept as presented in the dashboard.
* [Programs overview](/api-reference/loyalty-v2-programs-overview) to see how card definitions are assigned to a program.
* [Members overview](/api-reference/loyalty-v2-members-overview) to see how loyalty cards are issued to members from active card definitions.
* [Integrate loyalty v2](/guides/loyalty-v2-integrate) for an end-to-end integration walkthrough.
# Earning rules: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-earning-rules-overview
Understand how earning rules define when and how Loyalty v2 members earn points or receive benefits
An earning rule defines when a member earns points or receives another configured result for something they did. Each earning rule combines a trigger, optional conditions, and one or more earnings. Voucherify evaluates a member's earning rules and applies the first matching earning configuration for the triggering event.
## Triggers
An earning rule reacts to one of three triggers:
* **Order paid**: Triggered after an order is successfully paid and can calculate points proportionally to the order or item amounts.
* **Custom event**: Triggered when a selected custom event is sent to Voucherify.
* **Segment entered**: Triggered when a member enters a selected customer segment.
## Conditions and earnings
Beyond the trigger itself, a rule can require that the member belongs to a specific loyalty tier, or that the triggering event meets additional criteria (for example, a minimum order amount). Each earning inside the rule then defines its effect, typically adding points to a point wallet, but an earning can also grant a benefit instead of points. A single rule can hold multiple earnings, evaluated in order, with the first matching one applied.
Additionally, you can override the general point expiration settings set for a card definition by setting a custom expiration rules for the points earned by an earning rule.
## Trigger limits
Trigger limits control how often a rule is allowed to fire for the same member: A cooldown period between triggers, and/or a frequency cap over a time window. When omitted, a rule defaults to no cooldown and no frequency limit, meaning it can fire every time its trigger occurs.
## Lifecycle
An earning rule is created in `DRAFT` status unless `status` is specified explicitly. From there:
* `DRAFT` or `INACTIVE` > `ACTIVE` with the [activate endpoint](/api-reference/earning-rules/activate-earning-rule).
* `ACTIVE` > `INACTIVE` with the [deactivate endpoint](/api-reference/earning-rules/deactivate-earning-rule).
* `ACTIVE` > `DRAFT` with the [draft endpoint](/api-reference/earning-rules/move-earning-rule-to-draft).
Once a rule leaves `DRAFT`, only a some of its properties can still be changed, like name, earnings, error handling, validity hours, start/end dates, trigger limits, and metadata. However, trigger and condition definitions can't be edited. Deleting a rule performs a soft delete and keeps its last state for reference. You can delete only an earning rule that's not currently assigned to a program.
## Assigning earning rules to a program
Earning rules are created independently of any program and connected through the [Programs](/api-reference/loyalty-v2-programs-overview) batch assignment endpoint. Unlike card definitions, earning rules can be assigned or unassigned while the program is `ACTIVE`, as long as the program keeps at least one active earning rule.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Programs overview](/api-reference/loyalty-v2-programs-overview) for overall program management.
* [Benefits overview](/api-reference/loyalty-v2-benefits-overview) for the benefit effect an earning can grant.
* [Examine overview](/api-reference/loyalty-v2-examine-overview) to simulate what an earning rule would grant before it fires.
* [Reports overview](/api-reference/loyalty-v2-reports-overview) for program and member earning-rule usage statistics.
* [Create earning rules](/build/create-earning-rules) for the dashboard perspective on earning rules.
# Examine: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-examine-overview
Understand how the examine endpoints estimate earning opportunities and reward availability for a Loyalty v2 member without any side effects
The examine endpoints let you evaluate what a member could earn or redeem across their loyalty program memberships, without creating any transactions or otherwise changing stored data. Because they are pure dry-run operations, you can call them as often as needed to power member-facing UI, such as "ways to earn" screens or reward catalogs.
## Examine earning rules
The examine earning rule endpoint estimates the points and benefits a member would receive for a given scenario. You choose a trigger mode:
* `ALL`: Evaluates every active earning rule across the member's programs at once, useful for showing all the available ways a member can earn points in a single call.
* `SPECIFIC`: Evaluates only the earning rules tied to one event – an order being paid, a customer entering a segment, or a custom event. This mode requires the matching context object for that event (for example, order line items for `customer.order.paid`).
The response lists the estimated points per card and per earning rule, plus any material or digital benefits that would be granted. Because the estimation is a single dry-run pass, it does not chain further consequences of the earned points; for example, it won't simulate a tier upgrade that itself unlocks additional points.
## Examine rewards
This endpoint evaluates every reward assigned to a member's active program memberships and reports whether each one is currently redeemable on each of the member's cards. You can scope the evaluation to a single membership with `member_id`.
Each reward on each card is classified as:
* `AVAILABLE`: The member has an active card for the reward's card definition, the card balance covers the resolved point cost, and the reward assignment has stock.
* `UNAVAILABLE`: Accompanied by one or more structured reasons, such as `insufficient_balance` (with the exact points still missing), `out_of_stock`, `no_matching_cost`, `no_card_for_cost`, or `reward_inactive`.
The structured unavailability reasons are designed so your frontend doesn't need to guess why a reward is greyed out. You can use the same response to render progress bars or "points needed" messaging.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Earning rules: Overview](/api-reference/loyalty-v2-earning-rules-overview) for how to configure rules for gaining points and benefits.
* [Rewards: Overview](/api-reference/loyalty-v2-rewards-overview) for how to manage rewards.
* [Members: Overview](/api-reference/loyalty-v2-members-overview) for overall member management.
* [Integrate loyalty v2](/guides/loyalty-v2-integrate) for worked examples of both examine endpoints.
# Members: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-members-overview
Understand how customers are enrolled as members of a Loyalty v2 program, and how their loyalty cards, points, rewards, and payments are managed
A member is a Voucherify customer enrolled in a specific loyalty program. Membership is program-scoped. The same customer can be a member of several programs at once, but only once per program; a second enrollment attempt for the same customer is rejected. The customer must already exist in Voucherify, and the target program must be `ACTIVE` before it can accept new members.
## Enrollment
Members can be [created one at a time](/api-reference/programs/create-program-member), or in bulk through a [batch endpoint](/api-reference/programs/batch-create-program-members) that processes up to 10 MB of entries asynchronously in batches of 100, tracked as an [async action](/api-reference/async-actions/async-action-object). When a member is created, Voucherify automatically issues one loyalty card for every active card definition assigned to the program, so a member can start with several point wallets at once. Card `code` generation happens asynchronously, so a newly created card's `code` may briefly be `null`.
## Member lifecycle
A member is typically `ACTIVE` on creation, but can also be created as `INACTIVE`. Use the [activate](/api-reference/programs/activate-program-member) and [deactivate](/api-reference/programs/deactivate-program-member) endpoints to move a member between these two states. An inactive member can't earn or spend points. Updating a member merges metadata into the existing object and cannot change `status`; use activate or deactivate for status transitions. Deleting a member soft-deletes the member and its cards.
## Loyalty cards and points
Each of a member's loyalty cards tracks its own balance, lifetime point counters, and upcoming activation or expiration events. Beyond the automatic earning and spending flows, several endpoints let you manage points on a specific card directly:
* Manually [adjust points](/api-reference/programs/adjust-card-points) (positive values create an admin credit, negative values an admin debit).
* [List](/api-reference/programs/list-card-pending-points-buckets), and optionally manually [activate](/api-reference/programs/activate-a-pending-points-bucket) or [cancel](/api-reference/programs/cancel-a-pending-points-bucket), pending points buckets before their scheduled activation date.
* [List](/api-reference/programs/list-card-expiring-points-buckets), and optionally manually [expire](/api-reference/programs/expire-points-bucket), expiring points buckets before their scheduled expiration date.
* List [the full transaction history](/api-reference/programs/list-card-transactions) of a card.
Aggregated daily points and earning-rule usage for a member are covered in the [Reports overview](/api-reference/loyalty-v2-reports-overview).
## Rewards and payments
Members spend points in two ways, both scoped to a member's card:
* [Purchasing a reward](/api-reference/programs/purchase-reward-with-points): Spends points from the card tied to the reward's cost configuration, and can later be refunded, which returns the points to the card.
* [Paying for an order with points](/api-reference/programs/pay-for-order-with-points): Spends points based on the card definition's pay-with-points exchange ratio, capped by the card balance or an optional payment limit, and can be run as a dry run before committing to a real transaction.
Members also expose read-only history for benefit fulfillments and tier transitions (joins, upgrades, downgrades, prolongations, and exits), so you can build a complete activity feed for a member without combining several other endpoints.
## Member vs. membership
Related endpoints return a member's data from different angles:
* [Get member](/api-reference/programs/get-program-member) returns the member together with its cards within one program.
* [Get program membership](/api-reference/programs/get-program-membership) additionally enriches each card with tier progress. Use it whenever your integration needs to show progress toward the next loyalty tier.
* [Get customer memberships](/api-reference/programs/get-customer-memberships) returns every membership for a customer across programs, including member, program, and cards.
Membership lookups accept a path identifier interpreted through `identification_type` (for example customer ID or member ID).
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Programs: Overview](/api-reference/loyalty-v2-programs-overview) for overall program management.
* [Card definitions: Overview](/api-reference/loyalty-v2-card-definitions-overview) for how to manage card definitions.
* [Rewards: Overview](/api-reference/loyalty-v2-rewards-overview) for how to manage rewards.
* [Tier structures: Overview](/api-reference/loyalty-v2-tier-structures-overview) for how to manage tier structures.
* [Reports: Overview](/api-reference/loyalty-v2-reports-overview) for member card and earning-rule daily reports.
* [Integrate loyalty v2](/guides/loyalty-v2-integrate) for a step-by-step member integration walkthrough.
# Programs: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-programs-overview
Understand how a Loyalty v2 program connects card definitions, earning rules, tier structures, and rewards into one customer-facing loyalty setup
A loyalty program is the container that ties the individual Loyalty v2 building blocks, like card definitions (point wallets), earning rules, tier structures, and rewards, into a single, customer-facing loyalty setup. Members join a program, not an individual card definition or earning rule, which is what lets a program combine several of these components into one experience.
## Program status
A program is created in `DRAFT` status by default, and can be created directly as `ACTIVE` if it already has the required assignments. To become or remain `ACTIVE`, a program must have at least one active card definition and at least one active earning rule assigned; otherwise activation is rejected. Deleting a program soft-deletes it and removes all of its card definition, earning rule, reward, and tier structure assignments.
## Assigning components to a program
Card definitions, earning rules, tier structures, and rewards are all created independently (see their respective overview pages) and then connected to a program through dedicated assignment endpoints. Most component types use a batch endpoint that can assign and unassign multiple items in a single request; unassign operations are always processed before assign operations, and, in the default strict mode, any missing resource or missing assignment fails the whole batch.
A few rules are specific to each component:
* Card definitions: They can be assigned or unassigned one at a time or in a batch, but only while the program is in `DRAFT` status. Unassigning fails if the card definition is still referenced by an earning rule, reward, or tier structure assigned to the same program.
* Earning rules: They can be assigned or unassigned at any time, but if the program is `ACTIVE`, the batch is validated to leave at least one active earning rule assigned.
* Tier structures: A program can have at most one tier structure assigned, and it can't be unassigned once the program's \`ACTIVE.
* Rewards: Each reward being assigned must include its stock configuration, which can later be updated through a dedicated endpoint without going through the batch flow. Reward purchases can also be refunded through a program-scoped refund endpoint.
## Reporting
Aggregated program and member reports, like spending, points earnings, tier movements, and earning-rule evaluations, live in the [Reports](/api-reference/loyalty-v2-reports-overview) group. Use those endpoints for dashboards and analytics rather than reconstructing metrics from activity or transaction lists.
## Activity history
Every change to a program, like creation, updates, deletion, activation, deactivation, and assignment changes, is recorded and available through its [activity history endpoint](/api-reference/programs/list-program-activities). The program activity endpoint gives you an audit trail independent of your own event logging.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Card definitions: Overview](/api-reference/loyalty-v2-card-definitions-overview) for how to manage card definitions.
* [Earning rules: Overview](/api-reference/loyalty-v2-earning-rules-overview) for how to manage earning rules.
* [Tier structures: Overview](/api-reference/loyalty-v2-tier-structures-overview) for how to manage tier structures.
* [Rewards: Overview](/api-reference/loyalty-v2-rewards-overview) for how to manage rewards.
* [Members: Overview](/api-reference/loyalty-v2-members-overview) for enrolling customers into a program.
* [Reports: Overview](/api-reference/loyalty-v2-reports-overview) for program-level analytics.
* [Loyalty program overview](/build/loyalty-overview) for the dashboard perspective on programs.
# Reports: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-reports-overview
Understand how Loyalty v2 report endpoints return aggregated spending, earnings, tier movements, and earning-rule statistics for programs and members
Reports return read-only, aggregated statistics for a loyalty program or for a specific member within that program. Use them for dashboards, operational monitoring, and analytics – not for reconstructing individual transactions. Transaction and activity list endpoints are for per-event details.
Every report endpoint is scoped under a program (`programId`). Member-scoped reports additionally require `memberId` and either a card or an earning rule identifier.
## Program reports
Program reports cover four metric families. Each family exposes a daily breakdown over a date range and an all-time summary.
| Metric family | What it measures | Optional filters |
| --------------- | ------------------------------------------------------------------------------------------------ | ----------------------------- |
| Spending | Points spent across the program | Card definition |
| Points earnings | Points earned across the program | Earning rule, card definition |
| Tiers | Tier movements (joins, upgrades, downgrades, and related events) | Tier structure, tier |
| Earning rules | Earning-rule evaluation outcomes, including success and failure counts with a failures breakdown | Earning rule |
Daily endpoints require `start_date`, `end_date`, and `resolution`. Summary endpoints return totals for the lifetime of the program (subject to any filters you pass).
## Member reports
There are two member-scoped daily reports:
* [Card daily points](/api-reference/programs/get-card-daily-points-report): Aggregated points statistics for one of the member's loyalty cards over a date range and resolution.
* [Earning-rule daily](/api-reference/programs/get-member-earning-rule-daily-report): Aggregated usage statistics for one earning rule and one member over a date range and resolution.
These endpoints do not have summary counterparts in the Reports group. For per-transaction detail on a card, use the card transactions list under [Members](/api-reference/loyalty-v2-members-overview).
## Date range and resolution
Daily reports share the same resolution options and range caps.
| `resolution` | Maximum date range |
| ------------ | ------------------ |
| `day` | 90 days |
| `week` | 12 weeks |
| `month` | 12 months |
| `quarter` | 4 quarters |
`start_date` and `end_date` use `YYYY-MM-DD`. `end_date` must be after `start_date`. Requests that exceed the resolution's range limit are rejected.
## Filters
Program reports accept optional `filters` query parameters that narrow results by resource ID. For example, `filters[card_definition_id][conditions][$is]=lcdef_…` can be used with spending reports, or `filters[tier_id][conditions][$is]=lt_…` with tier reports. Filters use the same condition-operator shape as other Loyalty v2 and general Voucherify API list endpoints.
The tiers summary report also accepts `limit` and `order` to page and sort its result set (defaults: `limit=100`, `order=-id`).
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Programs overview](/api-reference/loyalty-v2-programs-overview) for the program container these reports aggregate.
* [Members overview](/api-reference/loyalty-v2-members-overview) for card transactions and member activity.
* [Earning Rules overview](/api-reference/loyalty-v2-earning-rules-overview) for the rules measured by earning-rule reports.
* [Tier Structures overview](/api-reference/loyalty-v2-tier-structures-overview) for the tiers measured by tier reports.
* [Loyalty v2 developer overview](/guides/loyalty-v2-overview) for integration orientation.
# Rewards overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-rewards-overview
Understand how rewards let Loyalty v2 members redeem their points for material products or digital incentives
A reward is what a member actively redeems by spending points, unlike a [benefit](/api-reference/loyalty-v2-benefits-overview), which is granted automatically by an earning rule. Rewards are optional and only become redeemable once assigned to a program with a stock configuration.
## Reward types
A reward requires `name`, `type`, and `costs`, plus exactly one type-specific object matching its `type`:
* `MATERIAL`: A physical product or SKU, defined in the `material` object.
* `DIGITAL`: A discount coupon or gift card, defined in the `digital` object.
## Costs and program assignment
A reward's `costs` array can define a different point price per card definition, so the same reward can be connected to multiple point wallets – even across different programs – each with its own price. The reward itself doesn't carry stock; stock is set per program when the reward is assigned through the [Programs](/api-reference/loyalty-v2-programs-overview) batch assignment endpoint, and can be updated afterwards without going through the batch flow again.
## Validity and refunds
A reward can define `validity_hours` to restrict when it's redeemable (defaulting to any time), and `refunds` behavior for what happens to spent points when a reward purchase is refunded.
## Lifecycle
A reward can be created directly in `DRAFT` or `ACTIVE` status. From there, it follows the same three-state pattern as earning rules and tier structures: `DRAFT`/`INACTIVE` > `ACTIVE` with the [reward activate endpoint](/api-reference/rewards/activate-reward), `ACTIVE` > `INACTIVE` with the [reward deactivate endpoint](/api-reference/rewards/deactivate-reward), and `ACTIVE` > `DRAFT` with the [reward draft endpoint](/api-reference/rewards/move-reward-back-to-draft) for unassigned rewards. While in `DRAFT`, every property can be updated; once active or inactive, only `name`, `metadata`, `refunds`, `validity_hours`, `start_date`, `end_date`, and `costs` can still change. Deleting a reward moves it to a `DELETED` status.
## Redeeming and checking availability
Members redeem rewards through the [member reward-purchase endpoint](/api-reference/programs/purchase-reward-with-points), which spend points from the card tied to the reward's cost configuration and can later be [refunded](/api-reference/programs/refund-a-reward-purchase). Before building a redemption flow, use the [Examine overview](/api-reference/loyalty-v2-examine-overview) endpoint to check which rewards a member can currently afford and why any others are unavailable.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Programs overview](/api-reference/loyalty-v2-programs-overview) for assigning rewards and their stock to a program.
* [Members overview](/api-reference/loyalty-v2-members-overview) for purchasing and refunding rewards.
* [Benefits overview](/api-reference/loyalty-v2-benefits-overview) for the automatically granted counterpart to rewards.
* [Create loyalty rewards](/build/create-loyalty-rewards) for the dashboard perspective on configuring rewards.
# Tier structures: Overview
Source: https://docs.voucherify.io/api-reference/loyalty-v2-tier-structures-overview
Understand how tier structures define the tiering model that determines how Loyalty v2 members qualify for and move between tiers
A tier structure defines the tiering model for a loyalty program: the levels members can reach, and the rule that decides which level a member currently qualifies for. Tier structures are optional. A program can run entirely on points and rewards without any tiers.
## Tier structure types
A tier structure qualifies members based on exactly one of two measures, set through its `type`:
* `POINT_BALANCE`: The member's current point balance on the associated card.
* `POINT_EARNED`: The total points the member has earned over a given period, regardless of how many have since been spent or expired.
Only the configuration object matching the chosen type (`point_balance` or `point_earned`) can be set; the other must be left empty. If not specified, a tier structure defaults to no tier expiration (`NO_RETENTION`) and no automatic downgrade (`NO_DOWNGRADE`).
## Tiers
Each tier structure contains its own nested tiers (like Bronze, Silver, and Gold) managed through dedicated create, list, update, and delete endpoints scoped to the parent structure. A tier structure can hold a maximum of 100 tiers. Each tier can define its own downgrade behavior, or inherit the parent structure's setting, which is the default when not specified. It can also set tier point expiration which will govern how points are retained when the member is in the tier.
## Lifecycle
A tier structure is created in `DRAFT` status by default, and moves between `DRAFT`, `ACTIVE`, and `INACTIVE` through the [activate](/api-reference/tier-structures/activate-tier-structure), [deactivate](/api-reference/tier-structures/deactivate-tier-structure), and [move tier structure back to draft](/api-reference/tier-structures/move-tier-structure-to-draft) endpoints – the same three-state pattern used by earning rules and rewards. Once a tier structure (or one of its tiers) leaves `DRAFT`, only `name` and `metadata` can still be updated. The qualification logic itself stays fixed to protect members already progressing through the tiers.
## Assigning a tier structure to a program
A program can have at most one tier structure assigned at a time, connected through the [program batch assignment endpoint](/api-reference/programs/batch-assignunassign-tier-structures). Unassigning a tier structure is only allowed while the program is in `DRAFT` status. Once the program is active, you can't unassign a tier structure. This prevents members from losing their tier context on a live program.
## Related resources
* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Programs overview](/api-reference/loyalty-v2-programs-overview) for assigning a tier structure to a program.
* [Members overview](/api-reference/loyalty-v2-members-overview) to see a member's tier progress.
* [Reports overview](/api-reference/loyalty-v2-reports-overview) for program-level tier movement statistics.
* [Create tier structures](/build/create-tier-structures) for the dashboard perspective on configuring tiers.
* [Loyalty key concepts](/build/loyalty-key-concepts#tier-structure) for the underlying tier concepts.
# Assign User
Source: https://docs.voucherify.io/api-reference/management/assign-user
/openapi/management.json post /management/v1/projects/{projectId}/users
Assigns a user to a given project. The user must be an existing user in Voucherify.
Correct Use of Data
To avoid errors, use the `"role"` key with either `"id"` or `"login"` keys.
# Copy Campaign Template to a Project
Source: https://docs.voucherify.io/api-reference/management/copy-campaign-template-to-a-project
/openapi/management.json post /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy
Copies a campaign template to another project.
The resources, like validation rules or products, will not be copied to the destination project yet. When the template is used to create a new campaign or add a new promotion tier, the resources will be created in the destination project.
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Create Brand
Source: https://docs.voucherify.io/api-reference/management/create-brand
/openapi/management.json post /management/v1/projects/{projectId}/branding
Creates a new brand configuration.
You can have only one brand configured for a project.
White Labelling
The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface.
# Create Custom Event Schema
Source: https://docs.voucherify.io/api-reference/management/create-custom-event-schema
/openapi/management.json post /management/v1/projects/{projectId}/custom-event-schemas
Creates a custom event schema.
The `"properties"` object is required, but it can be empty, however. This object is for optional custom properties (metadata).
Custom Event Documentation
Read [Custom Events](/prepare/custom-events) article to learn how custom events work in Voucherify.
Read also the details about the [Track Custom Event](/api-reference/events/track-custom-event) endpoint and the [Custom Event Object](/api-reference/events/event-object).
# Create Metadata Schema
Source: https://docs.voucherify.io/api-reference/management/create-metadata-schema
/openapi/management.json post /management/v1/projects/{projectId}/metadata-schemas
Creates a new metadata (custom attribute) schema for a given resource.
The schema consists of a set of key-value pairs to customize Voucherify resources.
You can nest your object within a standard metadata schema, e.g. within a campaign or customer schema. However, your nested object can't include another nested object. The standard metadata schemas are:
- Campaign
- Voucher
- Publication
- Redemption
- Product
- Customer
- Order
- Order line item
- Loyalty Tier
- Promotion Tier
- Earning rule
- Reward
Use this endpoint to define a metadata schema of a given resource for the first time. Once you configure a metadata schema for a given `related_object`, use the PUT [Update metadata schema](/api-reference/management/update-metadata-schema) endpoint to either update or add new metadata key-value pairs. For example, use this endpoint to define a metadata schema for `related_object: campaign` for the first time. If you want define a new metadata property for `campaign`, use the [PUT Update metadata schema](/api-reference/management/update-metadata-schema) endpoint.
Metadata Documentation
Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.
# Create Project
Source: https://docs.voucherify.io/api-reference/management/create-project
/openapi/management.json post /management/v1/projects
Creates a new project. You can add users, specify the cluster, timezone, currency, and other details.
All owners are added to the project by default.
# Create Stacking Rules
Source: https://docs.voucherify.io/api-reference/management/create-stacking-rules
/openapi/management.json post /management/v1/projects/{projectId}/stacking-rules
Overwrites the default stacking rules.
If new stacking rules have been created for the project earlier (e.g. in the user interface), it returns an error. Use [Update stacking rules](/api-reference/management/update-stacking-rules) endpoint to change the rules.
Stacking rules documentation
Read [the Stacking rules article](/orchestrate/stacking-rules) to learn how they work.
# Create Webhook
Source: https://docs.voucherify.io/api-reference/management/create-webhook
/openapi/management.json post /management/v1/projects/{projectId}/webhooks
Creates a new webhook configuration.
Webhook Documentation
Read [Introduction to webhooks](/api-reference/introduction-to-webhooks) article to learn how webhooks work in Voucherify.
# Delete Brand
Source: https://docs.voucherify.io/api-reference/management/delete-brand
/openapi/management.json delete /management/v1/projects/{projectId}/branding/{brandingId}
Deletes permanently a brand configuration.
# Delete Custom Event Schema
Source: https://docs.voucherify.io/api-reference/management/delete-custom-event-schema
/openapi/management.json delete /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}
Deletes permanently the custom event schema with its custom properties (metadata).
Custom Event Documentation
Read [Custom Events](/prepare/custom-events) article to learn how custom events work in Voucherify.
Read also the details about the [Track Custom Event](/api-reference/events/track-custom-event) endpoint and the [Custom Event Object](/api-reference/events/event-object).
# Delete Metadata Schema
Source: https://docs.voucherify.io/api-reference/management/delete-metadata-schema
/openapi/management.json delete /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}
Deletes permanently the metadata schema.
In standard metadata schemas, this endpoint removes permanently all definitions. The standard metadata schemas are:
- Campaign
- Voucher
- Publication
- Redemption
- Product
- Customer
- Order
- Order line item
- Loyalty Tier
- Promotion Tier
- Earning rule
- Reward
If you want to delete only one definition, use the [Update Metadata Schema](/api-reference/management/update-metadata-schema) endpoint. In the request, provide the `"deleted": true` pair in the definition object. This definition will be moved to Removed definitions.
If you want to create a new standard metadata schema, use the [Create Metadata Schema](/api-reference/management/create-metadata-schema) endpoint.
Metadata Purging
This endpoint deletes permanently the metadata schemas only. However, it does not purge the metadata from associated entities, so the metadata added to those entities will remain.
If you want to purge metadata from the entities:
1. Remove all the definitions you want to purge. You can do this either in Voucherify Project Settings > Metadata Schema tab or with the [Update Metadata Schema](/api-reference/management/update-metadata-schema) endpoint.
2. In Voucherify Project Settings > Metadata Schema tab, go to the relevant metadata schema.
3. In Removed definitions, click the bin button next to the definitions whose metadata you want to purge from entities.
Note:
- This is an asynchronous action. You will be notified when it has been completed.
- You cannot purge metadata for the Redemption and Publication schemas.
4. Use the Delete Metadata Schema request to delete the metadata schema from Voucherify.
Metadata Documentation
Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.
# Delete Project
Source: https://docs.voucherify.io/api-reference/management/delete-project
/openapi/management.json delete /management/v1/projects/{projectId}
Deletes an existing project.
The users currently using the deleted project will be automatically logged out.
Sandbox Project
The sandbox project cannot be deleted.
# Delete Stacking Rules
Source: https://docs.voucherify.io/api-reference/management/delete-stacking-rules
/openapi/management.json delete /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}
Deletes permanently the current settings for the stacking rules.
The stacking rules are restored to default values.
Stacking Rules Documentation
Read [the Stacking rules article](/orchestrate/stacking-rules) to learn how they work.
# Delete Webhook
Source: https://docs.voucherify.io/api-reference/management/delete-webhook
/openapi/management.json delete /management/v1/projects/{projectId}/webhooks/{webhookId}
Deletes a webhook configuration.
Webhook Documentation
Read [Introduction to webhooks](/api-reference/introduction-to-webhooks) article to learn how webhooks work in Voucherify.
# Get Brand
Source: https://docs.voucherify.io/api-reference/management/get-brand
/openapi/management.json get /management/v1/projects/{projectId}/branding/{brandingId}
Retrieves a brand configuration.
# Get Custom Event Schema
Source: https://docs.voucherify.io/api-reference/management/get-custom-event-schema
/openapi/management.json get /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}
Retrieves a custom event schema.
Custom Event Documentation
Read [Custom Events](/prepare/custom-events) article to learn how custom events work in Voucherify.
Read also the details about the [Track Custom Event](/api-reference/events/track-custom-event) endpoint and the [Custom Event Object](/api-reference/events/event-object).
# Get Metadata Schema
Source: https://docs.voucherify.io/api-reference/management/get-metadata-schema
/openapi/management.json get /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}
Retrieves a metadata schema.
Metadata Documentation
Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.
# Get Project
Source: https://docs.voucherify.io/api-reference/management/get-project
/openapi/management.json get /management/v1/projects/{projectId}
Retrieves an existing project.
# Get Stacking Rules
Source: https://docs.voucherify.io/api-reference/management/get-stacking-rules
/openapi/management.json get /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}
Retrieves the stacking rules for the project.
Stacking Rules Documentation
Read [the Stacking rules article](/orchestrate/stacking-rules) to learn how they work.
# Get User
Source: https://docs.voucherify.io/api-reference/management/get-user
/openapi/management.json get /management/v1/projects/{projectId}/users/{userId}
Retrieves the project user's details.
# Get Webhook
Source: https://docs.voucherify.io/api-reference/management/get-webhook
/openapi/management.json get /management/v1/projects/{projectId}/webhooks/{webhookId}
Retrieves a webhook configuration.
Webhook Documentation
Read [Introduction to webhooks](/api-reference/introduction-to-webhooks) article to learn how webhooks work in Voucherify.
# Invite a New User
Source: https://docs.voucherify.io/api-reference/management/invite-a-new-user
/openapi/management.json post /management/v1/projects/users/invite
Sends an invitation to an email address that has not been used yet as a Voucherify user login.
You can specify the projects to which the invited user will be assigned and define their roles.
# List Brands
Source: https://docs.voucherify.io/api-reference/management/list-brands
/openapi/management.json get /management/v1/projects/{projectId}/branding
Lists all brand configurations.
Because a project can have only one brand, it always returns a list with one item.
This endpoint can be used to retrieve the brand configuration created with the Voucherify Dashboard and the ID.
# List Campaign Templates
Source: https://docs.voucherify.io/api-reference/management/list-campaign-templates
/openapi/management.json get /management/v1/projects/{projectId}/templates/campaigns
Lists all campaign templates available in the project.
List Campaign Templates
This endpoint works in the same way as the [List Campaign Templates endpoint](/api-reference/templates/list-campaign-templates).
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# List Custom Event Schemas
Source: https://docs.voucherify.io/api-reference/management/list-custom-event-schemas
/openapi/management.json get /management/v1/projects/{projectId}/custom-event-schemas
Lists all custom event schemas available in the project.
Custom Event Documentation
Read [Custom Events](/prepare/custom-events) article to learn how custom events work in Voucherify.
Read also the details about the [Track Custom Event](/api-reference/events/track-custom-event) endpoint and the [Custom Event Object](/api-reference/events/event-object).
# List Metadata Schemas
Source: https://docs.voucherify.io/api-reference/management/list-metadata-schemas
/openapi/management.json get /management/v1/projects/{projectId}/metadata-schemas
Lists all metadata schemas available in the project.
Metadata Documentation
Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.
# List Projects
Source: https://docs.voucherify.io/api-reference/management/list-projects
/openapi/management.json get /management/v1/projects
Lists all projects for the organization.
The endpoint does not require any query parameters.
# List Stacking Rules
Source: https://docs.voucherify.io/api-reference/management/list-stacking-rules
/openapi/management.json get /management/v1/projects/{projectId}/stacking-rules
Lists all stacking rules.
Returns always a list with one item.
This endpoint can be used to retrieve the default stacking rules. The default stacking rules do not have an ID that could be used with the [Get Stacking Rules](/api-reference/management/get-stacking-rules) or [Update Stacking Rules](/api-reference/management/update-stacking-rules) endpoints.
Stacking Rules Documentation
Read [the Stacking rules article](/orchestrate/stacking-rules) to learn how they work.
# List Users
Source: https://docs.voucherify.io/api-reference/management/list-users
/openapi/management.json get /management/v1/projects/{projectId}/users
Lists all users assigned to the project.
# List Webhooks
Source: https://docs.voucherify.io/api-reference/management/list-webhooks
/openapi/management.json get /management/v1/projects/{projectId}/webhooks
Lists all webhook configurations for the project.
Webhook Documentation
Read [Introduction to webhooks](/api-reference/introduction-to-webhooks) article to learn how webhooks work in Voucherify.
# Unassign User
Source: https://docs.voucherify.io/api-reference/management/unassign-user
/openapi/management.json delete /management/v1/projects/{projectId}/users/{userId}
Unassigns the user from the project.
If the user is currently logged in, they are automatically logged out. If the user is assigned to only one project, they cannot be unassigned from that project.
# Update Brand
Source: https://docs.voucherify.io/api-reference/management/update-brand
/openapi/management.json put /management/v1/projects/{projectId}/branding/{brandingId}
Updates a brand configuration.
Only the fields sent in the request will be updated. The fields omitted in the request will remain unchanged.
White Labelling
The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface.
# Update Custom Event Schema
Source: https://docs.voucherify.io/api-reference/management/update-custom-event-schema
/openapi/management.json put /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}
Updates a custom event schema.
With this request, you can:
- Add a nonexistent property to a custom event schema.
- Update an existing property.
In the request, you can provide only those properties you want to add or update. Definitions omitted in the request remain unchanged.
Additional Notes
- You can change the type of an existing property, e.g. from `"string"` to `"number"`.
- You can remove a custom property with this endpoint by providing `"deleted": true` in the request. However, you cannot permanently remove an event definition or its property with this endpoint.
Custom Event Documentation
Read [Custom Events](/prepare/custom-events) article to learn how custom events work in Voucherify.
Read also the details about the [Track Custom Event](/api-reference/events/track-custom-event) endpoint and the [Custom Event Object](/api-reference/events/event-object).
# Update Metadata Schema
Source: https://docs.voucherify.io/api-reference/management/update-metadata-schema
/openapi/management.json put /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}
Updates a metadata schema.
With this request, you can:
- Add a nonexistent attribute definition to the metadata schema.
- Update an existing attribute definition by overwriting its current values.
In the request, you can provide only those definitions you want to add or update. Definitions omitted in the request remain unchanged.
However, if you want to update a definition, you will have to add all its current key-value pairs as well. Only the pairs sent in the request are saved for this definition. This means that the key-value pairs that are not sent in a request are restored to default values. For example, if your definition has an array with values and it is not sent in an update request, the array values will be deleted.
Additional Notes
- You cannot change the type of an existing schema, e.g. from `"string"` to `"number"`.
- You can remove a definition with this endpoint by providing `"deleted": true` in the request. It will be moved to the Removed definitions section in the user interface. However, you cannot permanently remove a definition with this endpoint.
Metadata Documentation
Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.
# Update Project
Source: https://docs.voucherify.io/api-reference/management/update-project
/openapi/management.json put /management/v1/projects/{projectId}
Updates an existing project.
You can add or modify settings for timezone, currency, notifications, and other details.
Only the fields sent in the request will be updated.
# Update Stacking Rules
Source: https://docs.voucherify.io/api-reference/management/update-stacking-rules
/openapi/management.json put /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}
Updates the stacking rules.
Only the provided fields will be updated. However, if you update an array, the content of the array is overwritten. This means that if you want to add new values to an array and retain existing ones, you need to provide both the existing and new values in the request.
Stacking Rules Documentation
Read [the Stacking rules article](/orchestrate/stacking-rules) to learn how they work.
# Update User
Source: https://docs.voucherify.io/api-reference/management/update-user
/openapi/management.json put /management/v1/projects/{projectId}/users/{userId}
Updates the user's role.
# Update Webhook
Source: https://docs.voucherify.io/api-reference/management/update-webhook
/openapi/management.json put /management/v1/projects/{projectId}/webhooks/{webhookId}
Updates a webhook configuration.
The `"events"` listed in the request are overwritten. If you want to add more events, provide also the events that are already in the webhook configuration.
Webhook Documentation
Read [Introduction to webhooks](/api-reference/introduction-to-webhooks) article to learn how webhooks work in Voucherify.
# Get Metadata Schema
Source: https://docs.voucherify.io/api-reference/metadata-schemas/get-metadata-schema
/openapi/metadata-schemas.json get /v1/metadata-schemas/{resource}
Retrieves a metadata schema per resource type.
## Resource types
### Standard
You can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.
- `campaign`
- `customer`
- `earning_rule`
- `loyalty_tier`
- `order`
- `order_item`
- `product`
- `promotion_tier`
- `publication`
- `redemption`
- `reward`
- `voucher`
### Custom
If you have defined a [custom metadata schema](/prepare/metadata#add-metadata), provide its name in the `"resource"` field to retrieve its details.
Management API
If you have Management API enabled, you can also use the [Get Metadata Schemas](/api-reference/management/get-metadata-schema) endpoint to retrieve a metadata schema using its ID.
# List Metadata Schema Definitions
Source: https://docs.voucherify.io/api-reference/metadata-schemas/list-metadata-schema-definitions
/openapi/metadata-schemas.json get /v1/metadata-schemas
Retrieve metadata schema definitions.
Management API
If you have Management API enabled, you can also use the [List Metadata Schemas](/api-reference/management/list-metadata-schemas) endpoint to list all metadata schemas.
# Metadata Schema Object
Source: https://docs.voucherify.io/api-reference/metadata-schemas/metadata-schema-object
Metadata Schema Object
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
custom\_property\_name
object
|
Custom property name. This is defined in
Project Settings
>
Metadata Schema
in the Dashboard.
| Attributes |
Description |
|
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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-08-11T08:05:30.695Z
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the metadata schema.
|
# Generate OAuth 2.0 Token
Source: https://docs.voucherify.io/api-reference/oauth/generate-oauth-20-token
/openapi/oauth.json post /v1/oauth/token
Generate an OAuth 2.0 token for an API client. The token can be used to authorize access to the Voucherify API. The token inherits the permissions and IP whitelists of the API key that is used to generate the OAuth token. You can define the scope that limits its usage. You can generate up to 1000 OAuth tokens per project. The token expires in 900 seconds (15 minutes).
If the API key that is used to generate the OAuth token is deleted or blocked, you cannot generate new OAuth tokens and the existing ones will stop working within one minute.
If the API key used to generate an OAuth token is regenerated, the OAuth token can still be used.
Format of scope values
Separate the values of the `scope` property with spaces.
# Introspect OAuth 2.0 Token
Source: https://docs.voucherify.io/api-reference/oauth/introspect-oauth-20-token
/openapi/oauth.json post /v1/oauth/introspect
Introspect an OAuth 2.0 token for an API client.
# Revoke OAuth 2.0 Token
Source: https://docs.voucherify.io/api-reference/oauth/revoke-oauth-20-token
/openapi/oauth.json post /v1/oauth/token/revoke
Revoke an OAuth 2.0 token for an API client. Once revoked, the token cannot be used anymore.
# Object Schemas
Source: https://docs.voucherify.io/api-reference/object-schemas
Schema model definitions
You can find the object definitions for the given schemas by navigating to the respective endpoint and viewing the response schema definition and examples.
| **API** | **Object** |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Vouchers | [Voucher object](/api-reference/vouchers/voucher-object) |
| Campaigns | [Campaign object](/api-reference/campaigns/campaign-object) |
| Promotions | [Promotion tier object](/api-reference/promotions/promotion-tier-object) |
| Rewards | [Reward object](/api-reference/rewards/reward-object)[Reward assignment object](/api-reference/rewards/reward-assignment-object) |
| Publications | [Publication object](/api-reference/publications/publication-object) |
| Validations | [Validation object](/api-reference/validations/validation-object) |
| Redemptions | [Redemption object](/api-reference/redemptions/redemption-object)[Redemption rollback object](/api-reference/redemptions/redemption-rollback-object) |
| Stackable Discounts | [Stackable Redemptions object](/api-reference/redemptions/stackable-redemptions-object) |
| Loyalties | [Loyalty campaign object](/api-reference/loyalties/loyalty-campaign-object)[Loyalty card object](/api-reference/loyalties/loyalty-card-object)[Earning rule object](/api-reference/loyalties/earning-rule-object)[Loyalty tier object](/api-reference/loyalties/loyalty-tier-object) |
| Customers | [Customer object](/api-reference/customers/customer-object)[Customer activity object](/api-reference/customers/customer-activity-object) |
| Orders | [Order object](/api-reference/orders/order-calculated-object) |
| Products | [Product object](/api-reference/products/product-object)[SKU object](/api-reference/products/sku-object) |
| Product Collections | [Product collection object](/api-reference/product-collections/product-collection-object) |
| Validation Rules | [Validation rule object](/api-reference/validation-rules/validation-rule-object)[Validation rule assignment object](/api-reference/validation-rules/validation-rule-assignment-object) |
| Segments | [Segment object](/api-reference/segments/segment-object) |
| Events | [Event object](/api-reference/events/event-object) |
| Async Actions | [Async action object](/api-reference/async-actions/async-action-object) |
| Exports | [Export object](/api-reference/exports/export-object) |
| Categories | [Category object](/api-reference/categories/category-object) |
| Metadata Schemas | [Metadata schema object](/api-reference/metadata-schemas/metadata-schema-object) |
# Create Order
Source: https://docs.voucherify.io/api-reference/orders/create-order
/openapi/orders.json post /v1/orders
Creates an order object and triggers an order creation event.
Upsert Mode
If you pass an `id` or a `source_id` that already exists in the order database, Voucherify will return a related order object with updated fields.
# Create Orders Export
Source: https://docs.voucherify.io/api-reference/orders/create-orders-export
/openapi/orders.json post /v1/orders/export
Creates a downloadable CSV file containing a list of orders.
The parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the `parameters.fields` object in the request body.
The available filters are all [order object](/api-reference/orders/order-calculated-object) attributes. Additionally, any metadata defined in the metadata schema can be exported.
Passing an empty JSON will generate a file containing three default fields: `id`, `source_id`, and `status`.
The fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| `id` | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |
| `source_id` | Unique order source ID. | 8638 |
| `created_at` | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |
| `updated_at` | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |
| `status` | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |
| `amount` | Total amount of order items. | 7700 |
| `discount_amount` | Represents total amount of the discount applied to whole cart. | 500 |
| `items_discount_amount` | Represents total amount of the discount applied to order line items. | 100 |
| `total_discount_amount` | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |
| `total_amount` | Total order amount after applying all discounts. | 7100 |
| `customer_id` | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |
| `referrer_id` | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |
| `metadata` | Returns all order metadata. | Response will include all order metadata. |
| `metadata.X` | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. |
# Get Order
Source: https://docs.voucherify.io/api-reference/orders/get-order
/openapi/orders.json get /v1/orders/{orderId}
Retrieve a specific order by passing its ID.
# Import Orders
Source: https://docs.voucherify.io/api-reference/orders/import-orders
/openapi/orders.json post /v1/orders/import
Historical orders
This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the [update order](/api-reference/orders/update-order) endpoint should be used. This is critical because this endpoint does not store events or launch distributions.
The orders will also have a `created_at` date that's assigned when they've been imported to Voucherify. To keep track of the actual order creation date, add an order metadata in ISO 8601 date or date time format to each imported order.
## Limitations
### Import volume
There can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one.
### Maximum count of orders in single import
There is a `2000` limit of orders per one request.
## Notifications
There are no notifications on the Dashboard because this import is launched via the API.
## Triggered actions
If you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segment's summary. Consequently, this update will trigger
- Customers entering into segments
- Distributions based on any rules tied to customer entering segment(s)
- Earning rules based on the customer entering segment(s)
## What is not triggered
1. No webhooks are triggered during the import of orders - for both orders and upserted products / SKUs.
2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a `PAID` status, the distribution is not going to be triggered.
3. No events are created during the import of orders - for both orders and upserted products / SKUs. In other words you won't see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / SKUs, then you won't see the Product created events listed, etc.
4. Earning rules based on Order Paid won't be triggered.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request with [GET Async Action](/api-reference/async-actions/get-async-action) endpoint.
# List Orders
Source: https://docs.voucherify.io/api-reference/orders/list-orders
/openapi/orders.json get /v1/orders
Returns a list of orders.
# Order Calculated Object
Source: https://docs.voucherify.io/api-reference/orders/order-calculated-object
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
# Update Order
Source: https://docs.voucherify.io/api-reference/orders/update-order
/openapi/orders.json put /v1/orders/{orderId}
Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.
# Create Product Collection
Source: https://docs.voucherify.io/api-reference/product-collections/create-product-collection
/openapi/product-collections.json post /v1/product-collections
This method creates a new product collection.
# Delete Product Collection
Source: https://docs.voucherify.io/api-reference/product-collections/delete-product-collection
/openapi/product-collections.json delete /v1/product-collections/{productCollectionId}
This method deletes a product collection.
# Get Product Collection
Source: https://docs.voucherify.io/api-reference/product-collections/get-product-collection
/openapi/product-collections.json get /v1/product-collections/{productCollectionId}
Retrieves the product collection.
# List Product Collections
Source: https://docs.voucherify.io/api-reference/product-collections/list-product-collections
/openapi/product-collections.json get /v1/product-collections
This method returns a list of product collections.
# List Products in Collection
Source: https://docs.voucherify.io/api-reference/product-collections/list-products-in-collection
/openapi/product-collections.json get /v1/product-collections/{productCollectionId}/products
Retrieves list of products from a product collection; works for both dynamic and static product collections.
# Product Collection Object
Source: https://docs.voucherify.io/api-reference/product-collections/product-collection-object
Product Collection Base
| Attributes |
Description |
|
id
string
|
Product collection ID.
|
|
name
string
|
Unique user-defined product collection name.
Example:
All Products
|
|
type
string
|
Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).
Available values:
STATIC,
AUTO\_UPDATE
|
|
filter
object
|
Defines a set of criteria and boundary conditions for an
AUTO\_UPDATE
product collection type.
| Attributes |
Description |
|
junction
|
See:
Junction
|
|
\[propertyName]
|
Valid keys:
id,
product\_id,
source\_id,
name,
price,
object,
attributes,
image\_url,
skus,
created\_at,
updated\_at
and
metadata.\*
Field Conditions
|
|
|
products
array
|
Defines a set of products for a
STATIC
product collection type.
Array of:
Product Collections Item Products Item
| Attributes |
Description |
|
id
string
|
The product ID.
Example:
prod\_0a41bcf807c5fcaaf6
|
|
product\_id
string
|
Product ID for SKUs.
|
|
object
string
|
Denotes the type of the object represented by the ID.
Available values:
sku,
product
|
|
|
created\_at
string
|
Timestamp representing the date and time when the product collection was created. The value is shown in the ISO 8601 format.
Example:
2021-12-09T12:51:29.898Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the static product collection.
Available values:
products\_collection
|
Junction
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
Field Conditions
| Attributes |
Description |
|
conditions
|
Data filters used to narrow down the data records to be returned in the result.
Filters Condition
|
Filters Condition
| Attributes |
Description |
|
\$in
|
See:
Any
|
|
\$not\_in
|
See:
Any
|
|
\$is
|
See:
Any
|
|
\$is\_days\_ago
|
See:
Any
|
|
\$is\_days\_in\_future
|
See:
Any
|
|
\$is\_not
|
See:
Any
|
|
\$has\_value
|
See:
Any
|
|
\$is\_unknown
|
See:
Any
|
|
\$contains
|
See:
Any
|
|
\$not\_contain
|
See:
Any
|
|
\$starts\_with
|
See:
Any
|
|
\$ends\_with
|
See:
Any
|
|
\$more\_than
|
See:
Any
|
|
\$less\_than
|
See:
Any
|
|
\$more\_than\_ago
|
See:
Any
|
|
\$less\_than\_ago
|
See:
Any
|
|
\$more\_than\_future
|
See:
Any
|
|
\$less\_than\_future
|
See:
Any
|
|
\$more\_than\_equal
|
See:
Any
|
|
\$less\_than\_equal
|
See:
Any
|
|
\$after
|
See:
Any
|
|
\$before
|
See:
Any
|
|
\$count
|
See:
Any
|
|
\$count\_less
|
See:
Any
|
|
\$count\_more
|
See:
Any
|
Any
Array any of:
- string
- string
- string
- number
- object
# Update Product Collection
Source: https://docs.voucherify.io/api-reference/product-collections/update-product-collection
/openapi/product-collections.json put /v1/product-collections/{productCollectionId}
Updates the product collection.
For `STATIC` collections, you can update only the `name`.
For `AUTO_UPDATE` collections, you can update its `name` and `filters`.
# Create Product
Source: https://docs.voucherify.io/api-reference/products/create-product
/openapi/products.json post /v1/products
Creates a product object.
Upsert Mode
If you pass an `id` or a `source_id` that already exists in the product database, Voucherify will return a related product object with updated fields.
# Create SKU
Source: https://docs.voucherify.io/api-reference/products/create-sku
/openapi/products.json post /v1/products/{productId}/skus
This method adds product variants to a [created product](/api-reference/products/create-product).
Upsert Mode
If you pass an `id` or a `source_id` that already exists in the sku database, Voucherify will return a related sku object with updated fields.
# Delete Product
Source: https://docs.voucherify.io/api-reference/products/delete-product
/openapi/products.json delete /v1/products/{productId}
Deletes a product and all related SKUs. This operation cannot be undone.
If the `force` parameter is set to `false` or not set at all, the product and all related SKUs will be moved to [the bin](/api-reference/bin/list-bin-entries).
# Delete SKU
Source: https://docs.voucherify.io/api-reference/products/delete-sku
/openapi/products.json delete /v1/products/{productId}/skus/{skuId}
Deletes a product SKU. This operation cannot be undone.
If the `force` parameter is set to `false` or not set at all, the SKU will be moved to [the bin](/api-reference/bin/list-bin-entries).
# Get Product
Source: https://docs.voucherify.io/api-reference/products/get-product
/openapi/products.json get /v1/products/{productId}
Retrieve details of a given product and its SKUs, if any.
# Get SKU
Source: https://docs.voucherify.io/api-reference/products/get-sku
/openapi/products.json get /v1/skus/{skuId}
Retrieve details of a SKU.
# Import Products using CSV
Source: https://docs.voucherify.io/api-reference/products/import-products-using-csv
/openapi/products.json post /v1/products/importCSV
Import products into the repository using a CSV file.
The CSV file has to include headers in the first line.
Standard product fields mapping
- Create a **comma separated value (CSV) file** or download our CSV import template. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b82ed68d51e779443f550/Import_products_template.csv).
- Supported CSV file headers: `name,source_id,price,attributes,image_url,Metadata_property_name`
- **Name** is a **required** field. The remaining fields in the CSV template are optional.
- Override/Update products' **names** in Voucherify using this method. Data will be updated for each product included in the CSV file whose **source_id** matches a source ID in Voucherify. No other data can be updated other than the product name.
- Note that dates and date-time attributes need to be provided in compliance with the **ISO 8601 standard**. For example, 2022-03-11T09:00:00.000Z or 2022-03-11
- `YYYY-MM-DD`
- `YYYY-MM-DDTHH`
- `YYYY-MM-DDTHH:mm`
- `YYYY-MM-DDTHH:mm:ss`
- `YYYY-MM-DDTHH:mm:ssZ`
- `YYYY-MM-DDTHH:mm:ssZ`
- `YYYY-MM-DDTHH:mm:ss.SSSZ`
- Columns that cannot be mapped to standard fields, will be mapped to **Custom attributes** and added as **products' metadata**. There is no limit on the number of custom attributes that you can import as metadata.
- To provide the proper data type, you need to add all custom attributes to the metadata schema **before importing the file**. Read more [here](/prepare/metadata#add-metadata).
- **Product attributes** (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e "attribute1,attribute2".
- Headers with metadata names **can't contain white-space characters**.
- If you import metadata defined in the schema as **arrays (multiple)**, you need to separate each value using a comma, for example:
- array of strings: "subscribed,premium"
- array of numbers: "123,234".
- array of dates: "2000-01-01,2000-01-02"
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# Import SKUs using CSV
Source: https://docs.voucherify.io/api-reference/products/import-skus-using-csv
/openapi/products.json post /v1/skus/importCSV
Import SKUs into the repository using a CSV file.
The CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv).
Import sequence
First import products using the [dedicated endpoint](/api-reference/products/import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.
Standard SKU fields mapping
- **Required** fields are `source_id` and `product_id`.
- Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`
- SKU **source_id** must be unique in the entire product catalog, no duplicates are allowed.
- SKU attributes need to be in the form of a stringy-fied json, i.e.`"{'color':'blue'}"`. These attributes must be defined in the **product** beforehand so you can import them to the SKU.
- You can use this method to update the following parameters in bulk: **sku** and the sku **price**.
- Columns that cannot be mapped to standard fields will be mapped to Custom attributes and added as product metadata. There is no limit on the number of custom attributes that you can import as metadata.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
# List Products
Source: https://docs.voucherify.io/api-reference/products/list-products
/openapi/products.json get /v1/products
Retrieve a list of products.
# List SKUs in Product
Source: https://docs.voucherify.io/api-reference/products/list-skus-in-product
/openapi/products.json get /v1/products/{productId}/skus
Retrieve all SKUs for a given product.
# Product Object
Source: https://docs.voucherify.io/api-reference/products/product-object
Product
This is an object representing a product.
This entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.
All of:
-
Product without Skus Object
-
Product without Skus Object
| Attributes |
Description |
|
id
string
|
Unique product ID assigned by Voucherify.
Example:
prod\_0b1da8105693710357
|
|
source\_id
string,
null
|
Unique product source ID.
Example:
productSourceID16
|
|
name
string,
null
|
Unique user-defined product name.
Example:
T-shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed 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. It can be used to create product collections.
|
|
image\_url
string,
null
|
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](https://images.com/original.jpg)
|
|
created\_at
string
|
Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.
Example:
2022-05-23T06:52:55.008Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-23T09:24:07.405Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the product.
Available values:
product
|
Skus List For Product
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of SKUs in the product.
|
SKU Object
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
Example:
sku\_0b1621b319d248b79f
|
|
source\_id
string,
null
|
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,
null
|
Unique user-defined SKU name.
Example:
Large Pink Shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed as
10000.
|
|
currency
string,
null
|
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,
null
|
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. It can be used to create product collections.
|
|
created\_at
string
|
Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:36:30.187Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:55:09.137Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
SKU.
Available values:
sku
|
# SKU Object
Source: https://docs.voucherify.io/api-reference/products/sku-object
SKU Object
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
Example:
sku\_0b1621b319d248b79f
|
|
source\_id
string,
null
|
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,
null
|
Unique user-defined SKU name.
Example:
Large Pink Shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed as
10000.
|
|
currency
string,
null
|
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,
null
|
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. It can be used to create product collections.
|
|
created\_at
string
|
Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:36:30.187Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:55:09.137Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
SKU.
Available values:
sku
|
# Update Product
Source: https://docs.voucherify.io/api-reference/products/update-product
/openapi/products.json put /v1/products/{productId}
Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
# Update Products in Bulk
Source: https://docs.voucherify.io/api-reference/products/update-products-in-bulk
/openapi/products.json post /v1/products/bulk/async
Update products in one asynchronous operation.
The request can include up to **10 MB** of data.
The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:
- The status of your request (in queue, in progress, done, or failed)
- Resources that failed to be updated
- The report file with details about the update
If a product object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.
This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
# Update Products' Metadata in Bulk
Source: https://docs.voucherify.io/api-reference/products/update-products-metadata-in-bulk
/openapi/products.json post /v1/products/metadata/async
Updates metadata parameters for a list of products. Every resource in the list will receive the metadata defined in the request.
The request can include up to **10 MB** of data.
The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:
- The status of your request (in queue, in progress, done, or failed)
- Resources that failed to be updated
- The report file with details about the update
If a product object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.
This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
# Update SKU
Source: https://docs.voucherify.io/api-reference/products/update-sku
/openapi/products.json put /v1/products/{productId}/skus/{skuId}
Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
Fields other than the ones listed in the request body schema won't be modified. Even if provided, they will be silently skipped.
# Activate pending point bucket
Source: https://docs.voucherify.io/api-reference/programs/activate-pending-point-bucket
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/pending-points/{bucketId}/activate
Manually activates a pending points bucket before its scheduled activation date, creating a `PENDING_POINTS_ACTIVATED` card transaction (status `PENDING`, processed asynchronously). No request body.
The program and member must be in `ACTIVE` status now, the card definition must have pending points enabled, the bucket must be in `PENDING` status, and the bucket's activation date must be in the future (`423` otherwise). Returns `404` when the program, member, card or bucket does not exist.
# Activate program
Source: https://docs.voucherify.io/api-reference/programs/activate-program
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Transitions the program to `ACTIVE` status. Allowed transitions to `ACTIVE` are from
`DRAFT` and `INACTIVE`. Before activation the program's card definition, earning rule
and tier structure assignments are validated (at least one active card definition and
earning rule is required). An invalid state transition is rejected with `400`
(key `invalid_state_transition`). No request body.
# Activate program member
Source: https://docs.voucherify.io/api-reference/programs/activate-program-member
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the member to `ACTIVE` status and records a `vl.member.activated` activity. No request body. Returns `404` when the program or member does not exist. Returns `400` (`invalid_state_transition`) when the member cannot be activated from its current state.
# Adjust card points
Source: https://docs.voucherify.io/api-reference/programs/adjust-card-points
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/points
Manually adjusts the points balance of the member's card.
A positive `points` value creates an `ADMIN_CREDIT` card transaction (point addition). The added points get an expiration date calculated from the point expiration settings for the card definition or earning rule.
A negative `points` value creates an `ADMIN_DEBIT` card transaction (point subtraction).
When `points` is `0`, no transaction is created and the result status is `NO_CHANGE`.
The transaction is created with status `PENDING` and processed asynchronously. Both the program and the member must be in `ACTIVE` status (`423` otherwise). Returns `404` when the program, member, or card does not exist.
# Batch assign/unassign card definitions
Source: https://docs.voucherify.io/api-reference/programs/batch-assignunassign-card-definitions
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/card-definitions/batch
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Assigns and/or unassigns card definitions to/from a program in a single batch.
Unassign operations are processed before assign operations.
The program must be in `DRAFT` status - otherwise the request is rejected with
`423 Locked` (key `non_draft_program`). In strict mode (default) missing card
definitions, inactive card definitions or missing assignments cause the whole
batch to fail.
# Batch assign/unassign earning rules
Source: https://docs.voucherify.io/api-reference/programs/batch-assignunassign-earning-rules
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/earning-rules/batch
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Assigns and/or unassigns earning rules to/from a program in a single batch.
Unassign operations are processed before assign operations. When the program is
`ACTIVE`, the batch is validated to leave at least one active earning rule assigned.
In strict mode (default) missing earning rules or missing assignments cause the whole
batch to fail.
# Batch assign/unassign rewards
Source: https://docs.voucherify.io/api-reference/programs/batch-assignunassign-rewards
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/rewards/batch
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Assigns and/or unassigns rewards to/from a program in a single batch.
Unassign operations are processed before assign operations. Each reward to assign
must include its `stock` configuration. In strict mode (default) missing rewards
or missing assignments cause the whole batch to fail (`404 Not Found`).
# Batch assign/unassign tier structures
Source: https://docs.voucherify.io/api-reference/programs/batch-assignunassign-tier-structures
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/tier-structures/batch
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Assigns and/or unassigns tier structures to/from a program in a single batch.
Unassign operations are processed before assign operations. Unassigning is only
allowed while the program is in `DRAFT` status - otherwise the request is rejected
with `423 Locked` (key `non_draft_program`). A program can have at most one tier
structure assigned. In strict mode (default) missing tier structures, inactive tier
structures or missing assignments cause the whole batch to fail.
# Batch create program members
Source: https://docs.voucherify.io/api-reference/programs/batch-create-program-members
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/batch
Schedules asynchronous batch creation of program members. The request body is a JSON array of member entries (maximum body size is 10 MB). The request is processed asynchronously in batches of 100 entries.
The program must exist (otherwise, it returns a `404` error) and be in `ACTIVE` status (otherwise, it returns a `423` error). Supported member fields are validated during background processing using the same domain validation rules as single member creation. Entries that fail validation (missing/invalid `customer_id`, unknown customer, invalid `status`, duplicate `customer_id` within the same batch, member already exists) are reported per-entry individually in the report linked from the async action result. The failed entries do not fail the whole batch (conflicting members are skipped).
Returns `202` status with the identifier of the scheduled async action. Use the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check the status of the batch creation. You can also check the processing status and the result in the Audit log – [Background tasks](/analyze/audit-logs#background-tasks) in the Voucherify dashboard.
# Cancel pending point bucket
Source: https://docs.voucherify.io/api-reference/programs/cancel-pending-point-bucket
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/pending-points/{bucketId}/cancel
Cancels a pending point bucket so its points are never activated, creating a `PENDING_POINTS_CANCELED` card transaction (status `PENDING`, processed asynchronously). No request body.
The program and member must be in `ACTIVE` status, the card definition must have pending points enabled, the bucket must be in `PENDING` status, and the bucket's activation date must be in the future (`423` otherwise). Returns `404` when the program, member, card, or bucket does not exist.
# Create program
Source: https://docs.voucherify.io/api-reference/programs/create-program
/openapi/loyalties-v2.json post /v2/loyalties/programs
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a new loyalty program. The program can be created with status `DRAFT` (default) or
`ACTIVE`. When created as `ACTIVE`, the program must be connected to at least one active
card definition and at least one active earning rule (provided via `card_definitions` and
`earning_rules` arrays), otherwise the request is rejected with `423 Locked`
(keys `missing_active_card_definition` / `missing_active_earning_rule`).
Optionally assigns card definitions, earning rules, rewards and tier structures in the same request.
# Create program member
Source: https://docs.voucherify.io/api-reference/programs/create-program-member
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members
Enrolls a customer as a member of the loyalty program. The program must be in `ACTIVE` status (returns a `423` error otherwise) and the customer must exist in Voucherify. A customer can be a member of a given program only once - creating a second member for the same customer ID returns `409` error (`member_already_exists`).
Loyalty cards are created automatically for all card definitions assigned to the program and returned in the `cards` array. Card `code` generation is asynchronous: `code` may be `null` immediately after creation.
# Deactivate program
Source: https://docs.voucherify.io/api-reference/programs/deactivate-program
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/deactivate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Transitions the program to `INACTIVE` status. Only an `ACTIVE` program can be deactivated.
An invalid state transition is rejected with `400` (key `invalid_state_transition`).
No request body.
# Deactivate program member
Source: https://docs.voucherify.io/api-reference/programs/deactivate-program-member
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/deactivate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the member to `INACTIVE` status and records a `vl.member.deactivated`
activity. No request body. Returns `404` when the program or member does not exist.
Returns 400 (`invalid_state_transition`) when the member cannot be deactivated from
its current state.
# Delete program
Source: https://docs.voucherify.io/api-reference/programs/delete-program
/openapi/loyalties-v2.json delete /v2/loyalties/programs/{programId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Soft-deletes a loyalty program and removes all of its card definition, earning rule,
reward and tier structure assignments.
# Delete program member
Source: https://docs.voucherify.io/api-reference/programs/delete-program-member
/openapi/loyalties-v2.json delete /v2/loyalties/programs/{programId}/members/{memberId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Deletes the member from the program (soft delete - status becomes `DELETED`) and
deletes the member's cards. Records a `vl.member.deleted` activity. Returns the
deleted member (without cards). Returns `404` when the program or member does not
exist.
# Expire points bucket
Source: https://docs.voucherify.io/api-reference/programs/expire-points-bucket
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/expiring-points/{bucketId}/expire
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Manually expires a points bucket before its scheduled expiration date, creating an
`ADMIN_POINTS_EXPIRATION` card transaction (status `PENDING`, processed
asynchronously). No request body.
The program and member must be in `ACTIVE` status, the card definition must have
points expiration enabled, the bucket must be in `ACTIVE` status, and the bucket's
expiration date must not be in the past (423 otherwise). Returns `404` when the
program, member, card or bucket does not exist.
# Get card daily points report
Source: https://docs.voucherify.io/api-reference/programs/get-card-daily-points-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/reports/daily
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns aggregated daily points statistics for a member's loyalty card over the given
date range and resolution.
The date range is limited per resolution:
maximum 90 days for `day`, 12 weeks for `week`, 12 months for `month`, 4 quarters
for `quarter`.
# Get customer memberships
Source: https://docs.voucherify.io/api-reference/programs/get-customer-memberships
/openapi/loyalties-v2.json get /v2/loyalties/memberships/{customerId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns all loyalty memberships for a customer across programs, including the resolved customer identity and each membership's member, program, and cards. Use `identification_type` to choose how the `customerId` path value is interpreted.
Returns an empty `memberships` array when the customer exists but has no memberships. Returns `404` when the customer or member cannot be resolved.
# Get member earning-rule daily report
Source: https://docs.voucherify.io/api-reference/programs/get-member-earning-rule-daily-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/earning-rules/{earningRuleId}/reports/daily
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns aggregated daily usage statistics for a specific earning rule and member over the given date range and resolution.
The date range is limited per resolution:
maximum 90 days for `day`, 12 weeks for `week`, 12 months for `month`, 4 quarters for `quarter`.
# Get program
Source: https://docs.voucherify.io/api-reference/programs/get-program
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single loyalty program by its id.
# Get program earning-rules daily report
Source: https://docs.voucherify.io/api-reference/programs/get-program-earning-rules-daily-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/earning-rules/daily
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns aggregated daily earning-rule evaluation statistics for the program over the given date range and resolution, optionally filtered by earning rule. Includes success and failure counts with a failures breakdown.
The date range is limited per resolution:
maximum 90 days for `day`, 12 weeks for `week`, 12 months for `month`, 4 quarters for `quarter`.
# Get program earning-rules summary report
Source: https://docs.voucherify.io/api-reference/programs/get-program-earning-rules-summary-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/earning-rules/summary
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns total earning-rule evaluation statistics for the program (all time), optionally filtered by earning rule. Includes success and failure counts with a failures breakdown.
# Get program member
Source: https://docs.voucherify.io/api-reference/programs/get-program-member
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single member of the program together with all its loyalty cards.
Each card includes the current balance, lifetime bucket counters, and next
expiration/activation info.
Card `code` may be `null` shortly after member creation because card code
generation is asynchronous.
Returns `404` when the program or member does not exist.
# Get program membership
Source: https://docs.voucherify.io/api-reference/programs/get-program-membership
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/memberships/{customerId}
Returns a single membership - the member's full loyalty profile within the program, combining the member, the program, and the member's loyalty cards enriched with tier progress. Use `identification_type` to choose how the `customerId` path value is interpreted.
Returns `404` when the program does not exist, or when the customer/member has no membership in the program.
# Get program points-earnings daily report
Source: https://docs.voucherify.io/api-reference/programs/get-program-points-earnings-daily-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/points-earnings/daily
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns aggregated daily points-earnings statistics for the program over the given date range and resolution, optionally filtered by earning rule and card definition.
The date range is limited per resolution:
maximum 90 days for `day`, 12 weeks for `week`, 12 months for `month`, 4 quarters for `quarter`.
# Get program points-earnings summary report
Source: https://docs.voucherify.io/api-reference/programs/get-program-points-earnings-summary-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/points-earnings/summary
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns total points-earnings statistics for the program (all time), optionally filtered by earning rule and card definition.
# Get program spending daily report
Source: https://docs.voucherify.io/api-reference/programs/get-program-spending-daily-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/spending/daily
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns aggregated daily points-spending statistics for the program over the given
date range and resolution, optionally filtered by card definition.
The date range is limited per resolution:
maximum 90 days for `day`, 12 weeks for `week`, 12 months for `month`, 4 quarters
for `quarter`.
# Get program spending summary report
Source: https://docs.voucherify.io/api-reference/programs/get-program-spending-summary-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/spending/summary
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns total points-spending statistics for the program (all time), optionally
filtered by card definition.
# Get program tiers daily report
Source: https://docs.voucherify.io/api-reference/programs/get-program-tiers-daily-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/tiers/daily
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns aggregated daily tier-movement statistics for the program over the given
date range and resolution, optionally filtered by tier structure and tier.
The date range is limited per resolution:
maximum 90 days for `day`, 12 weeks for `week`, 12 months for `month`, 4 quarters
for `quarter`.
# Get program tiers summary report
Source: https://docs.voucherify.io/api-reference/programs/get-program-tiers-summary-report
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/reports/tiers/summary
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns total tier-movement statistics for the program (all time), optionally
filtered by tier structure and tier.
Results are capped by `limit` (default `100`) and sorted by `order` (default `-id`).
# List card activities
Source: https://docs.voucherify.io/api-reference/programs/list-card-activities
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for the member's card
(created, assigned, unassigned, code generation succeeded/failed). Results can be
filtered by id, type and created_at. Returns `404` when the program, member or card
does not exist.
# List card expiring points buckets
Source: https://docs.voucherify.io/api-reference/programs/list-card-expiring-points-buckets
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/expiring-points
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of points expiration buckets of the member's card.
Each bucket groups active points sharing the same expiration date and expiration
type. Results can be ordered by `expiration_date`. Returns `404` when the program,
member, or card does not exist.
# List card pending point buckets
Source: https://docs.voucherify.io/api-reference/programs/list-card-pending-point-buckets
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/pending-points
Returns a cursor-paginated list of pending point buckets (`status` is `PENDING`) of the member's card. Pending points are earned points waiting for activation (period-based, fixed-dates or event-based activation, per the card definition's pending points settings).
Results can be ordered by activation `date`.
Returns `404` when the program, member, or card does not exist.
Use this endpoint to get the list of IDs of pending point bucket to use the [POST Activate pending point bucket](/api-reference/programs/activate-pending-point-bucket) or [POST Cancel pending point bucket](/api-reference/programs/cancel-a-pending-points-bucket).
# List card transactions
Source: https://docs.voucherify.io/api-reference/programs/list-card-transactions
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/cards/{cardId}/transactions
Returns a cursor-paginated list of transactions of the member's card. Results can be filtered by `id` and `created_at`, and ordered by `created_at` (default `-created_at`, newest first). Returns `404` when the program, member or card does not exist.
# List member activities
Source: https://docs.voucherify.io/api-reference/programs/list-member-activities
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for the member (created,
deleted, activated, deactivated, card assigned, card unassigned). Results can be
filtered by id, type and created_at. Returns `404` when the program or member does
not exist.
# List member benefit transactions
Source: https://docs.voucherify.io/api-reference/programs/list-member-benefit-transactions
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/benefits/transactions
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Lists benefit transactions (benefit fulfillments) for the given program member,
with cursor-based pagination. Supports filtering by benefit id and creation date.
# List member order payments
Source: https://docs.voucherify.io/api-reference/programs/list-member-order-payments
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/orders/payments
Lists persisted order transactions (pay-with-points payments) for the given program member, with cursor-based pagination. Supports filtering by transaction `id` and `created_at` date. Dry-run (`SIMULATED`) results from create are never persisted and do not appear in this list.
# List member reward purchases
Source: https://docs.voucherify.io/api-reference/programs/list-member-reward-purchases
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/rewards/purchases
Lists reward transactions of type `PURCHASE` for the given program member, with cursor-based pagination. Supports filtering by transaction `id`, `reward_id`, and `created_at` date.
It returns all persisted purchase transactions for the member, regardless of status. Purchases rejected synchronously at creation time (for example, insufficient card balance or unavailable stock) are not stored and do not appear in this list. Purchases accepted for processing (202) that later fail asynchronously appear with status: "REJECTED" and `details.rejection`.
# List member tier transactions
Source: https://docs.voucherify.io/api-reference/programs/list-member-tier-transactions
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members/{memberId}/tiers/transactions
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Lists tier transactions (tier joins, upgrades, downgrades, prolongations and exits)
for the given program member, with cursor-based pagination. Supports filtering by
card id and creation date.
# List program activities
Source: https://docs.voucherify.io/api-reference/programs/list-program-activities
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for a program (created, updated,
deleted, activated, deactivated and assignment changes). Supports filtering by activity
`id`, `type` and `created_at`.
# List program card definition assignments
Source: https://docs.voucherify.io/api-reference/programs/list-program-card-definition-assignments
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/card-definitions
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of card definitions assigned to the program.
# List program earning rule assignments
Source: https://docs.voucherify.io/api-reference/programs/list-program-earning-rule-assignments
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/earning-rules
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of earning rules assigned to the program.
# List program members
Source: https://docs.voucherify.io/api-reference/programs/list-program-members
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/members
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of members of the program. Results can be filtered
by id, status, customer_id and created_at, and ordered by created_at, status or
customer_id (ascending or descending). The same field cannot be ordered both
ascending and descending at the same time.
Returns `404` when the program does not exist.
List items do not include the `cards` array - use the get-member endpoint to
retrieve a member with cards.
# List program reward assignments
Source: https://docs.voucherify.io/api-reference/programs/list-program-reward-assignments
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/rewards
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of rewards assigned to the program, including their stock configuration and redemption counters.
# List program tier structure assignments
Source: https://docs.voucherify.io/api-reference/programs/list-program-tier-structure-assignments
/openapi/loyalties-v2.json get /v2/loyalties/programs/{programId}/tier-structures
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of tier structures assigned to the program.
# List programs
Source: https://docs.voucherify.io/api-reference/programs/list-programs
/openapi/loyalties-v2.json get /v2/loyalties/programs
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of loyalty programs. Supports filtering by `id`, `name`,
`status` and `created_at`. The same field cannot be used in both ascending and descending
order at once.
# Pay for order with points
Source: https://docs.voucherify.io/api-reference/programs/pay-for-order-with-points
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/orders/payments
Pays for an order using points from the specified member loyalty card. The payment amount and points to spend are calculated from the card definition's pay-with-points exchange ratio formula, capped by the card balance and the optional `payment_limit`.
Requires:
- `ACTIVE` program;
- `ACTIVE` member;
- Card definition with pay-with-points enabled and a configured exchange ratio formula;
- Existing order in Voucherify with order `id` or order `source_id`.
Modes:
- `TRANSACTION` (default): Creates a `PENDING` order transaction (and an underlying card transaction) processed asynchronously. Returns HTTP `202`. Sending a request for the same order `id` or `source_id` creates a new transaction each time.
- `DRY_RUN`: Simulates the payment without creating any transaction. Returns HTTP `200` with a `SIMULATED` transaction payload.
# Purchase reward with points
Source: https://docs.voucherify.io/api-reference/programs/purchase-reward-with-points
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/rewards/purchases
Purchases a reward on behalf of the program member by spending points from the member's loyalty card (the card is resolved from the reward cost's card definition).
Requires an `ACTIVE` program and an `ACTIVE` reward within their configured validity windows, an `ACTIVE` member, the reward to be assigned to the program with available stock, a matching reward cost for the customer's context, and sufficient points within the configured spending limits.
Modes:
- `TRANSACTION` (default): creates a `PENDING` reward transaction (and an underlying card transaction) processed asynchronously. Returns HTTP `202`.
- `DRY_RUN`: simulates the purchase without creating any transaction. Returns HTTP `200` with a `SIMULATED` transaction payload.
# Refund a reward purchase
Source: https://docs.voucherify.io/api-reference/programs/refund-a-reward-purchase
/openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/rewards/purchases/{rewardTransactionId}/refund
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Refunds a previously approved reward purchase transaction. Creates a REFUND-type reward
transaction and schedules the return of the spent points to the member's card
("Reward refund transaction created. Points will be returned to the member's card shortly.").
The refunded purchase transaction must be of type `PURCHASE` and in `APPROVED` status,
otherwise the request is rejected with a conflict error.
The request body is optional (an empty payload is allowed). When omitted, default
policies are applied: `refund: DEFAULT`, `stock: DEFAULT`.
# Update program
Source: https://docs.voucherify.io/api-reference/programs/update-program
/openapi/loyalties-v2.json put /v2/loyalties/programs/{programId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates a loyalty program. When the program is not in `DRAFT` status, only `name` and
`metadata` may be changed (other properties are restricted after leaving draft).
# Update program member
Source: https://docs.voucherify.io/api-reference/programs/update-program-member
/openapi/loyalties-v2.json put /v2/loyalties/programs/{programId}/members/{memberId}
Updates a program member's metadata. Provided object keys are merged into the existing metadata; omitted keys are preserved. Pass `metadata: null` to clear all metadata (sets it to an empty object).
This endpoint cannot change `status`. Use [Activate a program member](/api-reference/programs/activate-a-program-member) or [Deactivate a program member](/api-reference/programs/deactivate-a-program-member) for status transitions.
Records a `vl.member.updated` activity. Returns the updated member without the `cards` array. Returns `404` when the program or member does not exist. Returns `400` when the request body fails validation or the project `vl_member` metadata schema rejects the payload.
# Update program reward assignment
Source: https://docs.voucherify.io/api-reference/programs/update-program-reward-assignment
/openapi/loyalties-v2.json put /v2/loyalties/programs/{programId}/rewards/{rewardId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates the stock configuration of a reward assigned to a program.
Returns the updated reward assignment.
# Project settings webhooks
Source: https://docs.voucherify.io/api-reference/project-settings-webhooks
Use webhooks to get notified about project events in Voucherify
Project-level webhooks in Voucherify are notifications sent automatically to your application whenever certain actions happen in your project. Examples include when a voucher is redeemed, a customer profile changes, or an order is created.
To use these webhooks, provide Voucherify with an endpoint URL where notifications should be sent.
## Configuring webhooks
Follow these steps to configure webhooks:
1. In Voucherify dashboard, go to Project settings.
2. Scroll down to the Webhooks section.
3. Click the plus button – Add new webhook.
4. Choose v2024-01-01 webhook version.
5. Provide the following details:
1. Enter the target URL.
2. Tick the Is active? checkbox.
3. Select the [events](#webhooks-available-in-project-settings "Project setting webhooks") you want to receive. If you want to receive all the events, choose Send me all events option.
4. Provide additional custom HTTP header (optional).
5. Click Send test webhook to test your configuration (optional).
6. Click Create endpoint.
6. If necessary for authentication reasons, enter the Secret key in your system to receive webhooks from Voucherify.
You can add multiple webhooks to your projects following the steps above.
To update webhook details, click the Pencil button – edit. Enter your changes and click Update endpoint.
To delete a webhook, click the trash button and click Delete.
## Re-Enabling a Webhook
To re-enable a disabled webhook:
1. In the Project settings, go to the General tab.
2. Scroll down to the Webhooks section.
3. Edit the specific Webhook.
4. Click Is active.
5. Click Update endpoint.
## Webhooks available in Project settings
These webhooks are triggered by the events listed in the Project settings.
Documentation of some of the events is still in progress.
The following events can send a webhook:
* Redemption events:
* [Redemption succeeded](/api-reference/redemption/succeeded "Redemption succeeded event documentation")
* [Redemption failed](/api-reference/redemption/failed "Redemption failed event documentation")
* [Redemption rollback succeeded](/api-reference/redemption/rollback-succeeded "Redemption rollback succeeded event documentation")
* [Redemption rollback failed](/api-reference/redemption/rollback-failed "Redemption rollback failed event documentation")
* Publication event:
* [Publication succeeded](/api-reference/publication/succeeded "Publication succeeded event documentation")
* Customer events:
* [Customer created](/api-reference/customer/created "Customer created event documentation")
* [Customer updated](/api-reference/customer/updated "Customer updated event documentation")
* [Customer deleted](/api-reference/customer/deleted "Customer deleted event documentation")
* [Customer rewarded](/api-reference/customer/rewarded "Customer rewarded event documentation")
* [Customer rewarded loyalty points](/api-reference/customer/rewarded-loyalty-points "Customer rewarded loyalty points event documentation")
* Customer confirmed
* Voucher events:
* [Voucher created](/api-reference/voucher/created "Voucher created event documentation")
* [Voucher disabled](/api-reference/voucher/disabled "Voucher disabled event documentation")
* [Voucher enabled](/api-reference/voucher/enabled "Voucher enabled event documentation")
* [Voucher updated](/api-reference/voucher/updated "Voucher updated event documentation")
* [Voucher published](/api-reference/voucher/published "Voucher published event documentation")
* [Voucher loyalty card pending points activated](/api-reference/voucher/loyalty-card-pending-points-activated "Voucher loyalty card pending points activated event documentation")
* [Voucher loyalty card pending points added](/api-reference/voucher/loyalty-card-pending-points-added "Voucher loyalty card pending points added event documentation")
* [Voucher loyalty card pending points canceled](/api-reference/voucher/loyalty-card-pending-points-canceled "Voucher loyalty card pending points canceled event documentation")
* [Voucher loyalty card pending points updated](/api-reference/voucher/loyalty-card-pending-points-updated "Voucher loyalty card pending points update event documentation")
* [Voucher loyalty card points added](/api-reference/voucher/loyalty-card-points-added "Voucher loyalty card points added event documentation")
* [Voucher loyalty card points expired](/api-reference/voucher/loyalty-card-points-expired "Voucher loyalty card points expired event documentation")
* [Voucher loyalty card transaction created](/api-reference/voucher/loyalty-card-transaction-created "Voucher loyalty card transaction created event documentation")
* [Voucher gift transaction created](/api-reference/voucher/gift-transaction-created "Voucher gift transaction created event documentation")
* [Voucher gift balance added](/api-reference/voucher/gift-balance-added "Voucher gift balance added event documentation")
* [Voucher deleted](/api-reference/voucher/deleted "Voucher deleted event documentation")
* Campaign events:
* [Campaign created](/api-reference/campaign/created "Campaign created event documentation")
* [Campaign voucher generation completed](/api-reference/campaign/vouchers-generation-completed "Campaign voucher generation completed event documentation")
* [Campaign disabled](/api-reference/campaign/disabled "Campaign disabled event documentation")
* [Campaign enabled](/api-reference/campaign/enabled "Campaign enabled event documentation")
* [Campaign updated](/api-reference/campaign/updated "Campaign updated event documentation")
* [Campaign deleted](/api-reference/campaign/deleted "Campaign deleted event documentation")
* Campaign vouchers added
* Promotion tier events:
* [Promotion tier created](/api-reference/campaign/promotion-tier-created "Promotion tier created event documentation")
* [Promotion tier disabled](/api-reference/campaign/promotion-tier-disabled "Promotion tier disabled event documentation")
* [Promotion tier enabled](/api-reference/campaign/promotion-tier-enabled "Promotion tier enabled event documentation")
* [Promotion tier updated](/api-reference/campaign/promotion-tier-updated "Promotion tier updated event documentation")
* [Promotion tier deleted](/api-reference/campaign/promotion-tier-deleted "Promotion tier deleted event documentation")
* Business validation rule events:
* [Business validation rule created](/api-reference/validation-rules/created "Validation rule created event documentation")
* [Business validation rule updated](/api-reference/validation-rules/updated "Validation rule updated event documentation")
* [Business validation rule assignment created](/api-reference/validation-rules/assignment-created "Validation rule assignment created event documentation")
* [Business validation rule assignment deleted](/api-reference/validation-rules/assignment-deleted "Validation rule assignment deleted event documentation")
* [Business validation rule deleted](/api-reference/validation-rules/deleted "Validation rule deleted event documentation")
* Earning rule events:
* Earning rule assigned
* Earning rule deleted
* Earning rule disabled
* Earning rule enabled
* Earning rule updated
* Loyalty tier related events:
* [Loyalty tier created](/api-reference/campaign/loyalty-tier-created "Campaign loyalty tier created documentation")
* [Loyalty tier deleted](/api-reference/campaign/loyalty-tier-deleted "Campaign loyalty tier deleted documentation")
* [Loyalty tier updated](/api-reference/campaign/loyalty-tier-updated "Campaign loyalty tier updated documentation")
* Promotion stack events:
* Promotion stack created
* Promotion stack updated
* Referral tier related events:
* Referral tier created
* Referral tier deleted
* Referral tier updated
* Reward assignment events:
* Reward assignment created
* Reward assignment deleted
* Reward assignment updated
* Voucher generation events:
* Voucher generation failed
* Voucher generation started
### Project setting webhook payload
The list shows a general structure of a webhook payload set in Project settings. Indented bullet points mean that an object contains further properties or objects.
* `id` (`string`): Unique identifier of the send out for this webhook. **Example:** `whs_0e16e42bc6e0c65b57`
* `project_id` (`string`): Unique identifier of the Voucherify project. **Example:** `proj_5T4Rpl4T1nuM`
* `created_at` (`string`): The exact moment when the webhook was created. **Example:** `2024-01-01T11:11:11.111Z`
* `type` (`string`): Name of the event that triggered the webhook send out. Available values: `business_validation_rule.assignment.created`, `business_validation_rule.assignment.deleted`, `business_validation_rule.created`, `business_validation_rule.deleted`, `business_validation_rule.updated`, `campaign.created`, `campaign.deleted`, `campaign.disabled`, `campaign.enabled`, `campaign.earning_rule.assigned`, `campaign.earning_rule.deleted`, `campaign.earning_rule.disabled`, `campaign.earning_rule.enabled`, `campaign.earning_rule.updated`, `campaign.loyalty_tier.created`, `campaign.loyalty_tier.deleted`, `campaign.loyalty_tier.updated`, `campaign.promotion_stack.created`, `campaign.promotion_stack.updated`, `campaign.promotion_tier.created`, `campaign.promotion_tier.deleted`, `campaign.promotion_tier.disabled`, `campaign.promotion_tier.enabled`, `campaign.promotion_tier.updated`, `campaign.referral_tier.created`, `campaign.referral_tier.deleted`, `campaign.referral_tier.updated`, `campaign.reward.assignment.created`, `campaign.reward.assignment.deleted`, `campaign.reward.assignment.updated`, `campaign.updated`, `campaign.vouchers.added`, `campaign.vouchers.generation.completed`, `campaign.vouchers.generation.failed`, `campaign.vouchers.generation.started`, `customer.confirmed`, `customer.created`, `customer.updated`, `customer.deleted`, `customer.rewarded`, `customer.rewarded.loyalty_points`, `publication.succeeded`, `redemption.failed`, `redemption.rollback.failed`, `redemption.rollback.succeeded`, `redemption.succeeded`, `voucher.created`, `voucher.deleted`, `voucher.disabled`, `voucher.enabled`, `voucher.gift.balance_added`, `voucher.gift.transaction.created`, `voucher.loyalty_card.pending_points.activated`, `voucher.loyalty_card.pending_points.added`, `voucher.loyalty_card.pending_points.canceled`, `voucher.loyalty_card.pending_points.updated`, `voucher.loyalty_card.points_added`, `voucher.loyalty_card.points_expired`, `voucher.loyalty_card.transaction.created`, `voucher.published`, `voucher.updated`
* `data` (`object`): Payload depends on the event that triggered the webhook send out. Project settings cover the following events:
* [business\_validation\_rule.assignment.created](/api-reference/validation-rules/assignment-created)
* [business\_validation\_rule.assignment.deleted](/api-reference/validation-rules/assignment-deleted)
* [business\_validation\_rule.created](/api-reference/validation-rules/created)
* [business\_validation\_rule.deleted](/api-reference/validation-rules/deleted)
* [business\_validation\_rule.updated](/api-reference/validation-rules/updated)
* [campaign.created](/api-reference/campaign/created)
* [campaign.deleted](/api-reference/campaign/deleted)
* [campaign.disabled](/api-reference/campaign/disabled)
* [campaign.enabled](/api-reference/campaign/enabled)
* [campaign.updated](/api-reference/campaign/updated)
* campaign.earning\_rule.assigned
* campaign.earning\_rule.deleted
* campaign.earning\_rule.disabled
* campaign.earning\_rule.enabled
* campaign.earning\_rule.updated
* [campaign.loyalty\_tier.created](/api-reference/campaign/loyalty-tier-created)
* [campaign.loyalty\_tier.deleted](/api-reference/campaign/loyalty-tier-deleted)
* [campaign.loyalty\_tier.updated](/api-reference/campaign/loyalty-tier-updated)
* [campaign.promotion\_tier.created](/api-reference/campaign/promotion-tier-created)
* [campaign.promotion\_tier.deleted](/api-reference/campaign/promotion-tier-deleted)
* [campaign.promotion\_tier.disabled](/api-reference/campaign/promotion-tier-disabled)
* [campaign.promotion\_tier.enabled](/api-reference/campaign/promotion-tier-enabled)
* [campaign.promotion\_tier.updated](/api-reference/campaign/promotion-tier-updated)
* campaign.promotion\_stack.created
* campaign.promotion\_stack.updated
* campaign.referral\_tier.created
* campaign.referral\_tier.deleted
* campaign.referral\_tier.updated
* campaign.reward.assignment.created
* campaign.reward.assignment.deleted
* campaign.reward.assignment.updated
* [campaign.vouchers.generation.completed](/api-reference/campaign/vouchers-generation-completed)
* campaign.vouchers.generation.failed
* campaign.vouchers.generation.started
* campaign.vouchers.added
* [customer.created](/api-reference/customer/created)
* [customer.updated](/api-reference/customer/updated)
* [customer.deleted](/api-reference/customer/deleted)
* customer.confirmed
* [customer.rewarded](/api-reference/customer/rewarded)
* [customer.rewarded.loyalty\_points](/api-reference/customer/rewarded-loyalty-points)
* [publication.succeeded](/api-reference/publication/succeeded)
* [redemption.failed](/api-reference/redemption/failed)
* [redemption.rollback.failed](/api-reference/redemption/rollback-failed)
* [redemption.rollback.succeeded](/api-reference/redemption/rollback-succeeded)
* [redemption.succeeded](/api-reference/redemption/succeeded)
* [voucher.created](/api-reference/voucher/created)
* [voucher.deleted](/api-reference/voucher/deleted)
* [voucher.disabled](/api-reference/voucher/disabled)
* [voucher.enabled](/api-reference/voucher/enabled)
* [voucher.gift.balance\_added](/api-reference/voucher/gift-balance-added)
* [voucher.gift.transaction.created](/api-reference/voucher/gift-transaction-created)
* [voucher.loyalty\_card.pending\_points.activated](/api-reference/voucher/loyalty-card-pending-points-activated)
* [voucher.loyalty\_card.pending\_points.added](/api-reference/voucher/loyalty-card-pending-points-added)
* [voucher.loyalty\_card.pending\_points.canceled](/api-reference/voucher/loyalty-card-pending-points-canceled)
* [voucher.loyalty\_card.pending\_points.updated](/api-reference/voucher/loyalty-card-pending-points-updated)
* [voucher.loyalty\_card.points\_added](/api-reference/voucher/loyalty-card-points-added)
* [voucher.loyalty\_card.points\_expired](/api-reference/voucher/loyalty-card-points-expired)
* [voucher.loyalty\_card.transaction.created](/api-reference/voucher/loyalty-card-transaction-created)
* [voucher.published](/api-reference/voucher/published)
* [voucher.updated](/api-reference/voucher/updated)
* `source` (`object`): Contains details about the source of the webhook send out. Properties:
* `id` (`string`): ID number of the webhook. **Example:** `wh_j56Vfy47Vx9YOX7QYD1fzHnc`
* `object` (`string`): Determines the type of the object. Available values: `webhook` **Example:** `webhook`
* `target_url` (`string`): The address where the webhook will be sent.
* `event` (`object`): Contains other data of the event that triggered the send out.
* `id` (`string`): Unique identifier of the event that triggered the send out. **Example:** `evred_1f3611301g3127begb`
* `type` (`string`): Determines the type of the event. **Example:** `redemption.succeeded`
* `created_at` (`string`): The exact moment when the event was created. **Example:** `2024-01-01T11:11:11.111Z`
* `entity_id` (`string`): Unique identifier of the entity that triggered the send out. **Example:** `r_1f3611302bf107befb`
* `group_id` (`string`): Unique identifier of the request that triggered the event. **Example:** `v-1f36113948e50fc4ge`
* `event_source` (`object`): Contains the source of the object that triggered the send out. Properties:
* `channel` (`string`): Determines the channel that triggered the send out. Available values: `USER_PORTAL`, `API`, `CLIENT_API`, `INTERNAL` **Example:** `API`
* `user` (`object`): Defines the user who triggered the event.
* `id` (`string`): ID of the user who triggered the event.
* `api_key` (`object`): Determines the API key used to initiate the send out. Properties:
* `name` (`string`): Channel name in the application keys.
* `app_id` (`string`): Contains the application ID from the Voucherify API key pair. **Example:** `1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX`
```JSON Voucher published payload example theme={null}
{
"id": "whs_ID",
"project_id": "proj_ID",
"created_at": "2025-10-16T16:03:23.071Z",
"type": "voucher.published",
"data": {
"customer": {
"id": "cust_ID",
"name": "Alex Doe",
"email": "alex.doe@doe.alex.io",
"source_id": "4lx-d03",
"metadata": {
"acquisition_channel": "Website"
},
"object": "customer"
},
"campaign": {
"id": "camp_ID",
"name": "Autumn-2025",
"campaign_type": "DISCOUNT_COUPONS",
"type": "STANDALONE",
"is_referral_code": false,
"voucher": {
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 100,
"units": null,
"effect": "APPLY_TO_ITEMS"
},
"gift": null,
"loyalty_card": null,
"redemption": {
"quantity": null,
"redeemed_quantity": 0
},
"code_config": {
"pattern": "########",
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"prefix": "",
"postfix": "",
"min_desired": 1
}
},
"auto_join": false,
"join_once": false,
"active": true,
"category_id": null,
"category": null,
"metadata": {},
"start_date": null,
"expiration_date": null,
"description": null,
"created_at": "2025-10-14T08:45:08.857Z",
"updated_at": "2025-10-14T12:39:52.798Z",
"object": "campaign"
},
"publication": {
"id": "pub_ID",
"object": "publication",
"created_at": "2025-10-16T16:03:23.065Z",
"customer_id": "cust_ID",
"tracking_id": "4lx-d03",
"metadata": {},
"channel": "voucherify-web-ui",
"source_id": "manual-publication-2020-02-02-v01",
"result": "SUCCESS",
"customer": {
"id": "cust_ID",
"source_id": "4lx-d03",
"name": "Alex Doe",
"email": "alex.doe@doe.alex.io",
"address": null,
"summary": null,
"loyalty": null,
"referrals": null,
"metadata": {
"acquisition_channel": "Website"
},
"object": "customer"
},
"vouchers_id": [
"v_ID"
]
},
"voucher": {
"id": "v_ID",
"code": "kUs7oM-cOD3",
"discount": {
"type": "AMOUNT",
"amount_off": 100,
"effect": "APPLY_TO_ITEMS"
},
"type": "DISCOUNT_VOUCHER",
"campaign": "Autumn2025",
"campaign_id": "camp_ID",
"is_referral_code": false,
"holder_id": "cust_ID",
"category_id": null,
"active": true,
"created_at": "2025-10-16T16:02:41.255Z",
"updated_at": "2025-10-16T16:03:23.070Z",
"redemption": {
"quantity": null,
"redeemed_quantity": 0
},
"start_date": null,
"expiration_date": null,
"metadata": {},
"object": "voucher",
"categories": []
},
"created_at": "2025-10-16T16:03:23.071Z"
},
"source": {
"id": "wh_ID",
"object": "webhook",
"target_url": "https:/your.url.io"
},
"event": {
"id": "evvou_ID",
"type": "voucher.published",
"created_at": "2025-10-16T16:03:23.071Z",
"entity_id": "v_ID",
"group_id": "v-ID",
"event_source": {
"channel": "USER_PORTAL",
"user": {
"id": "user_ID"
}
}
}
}
```
# Add Promotion Tier to Campaign
Source: https://docs.voucherify.io/api-reference/promotions/add-promotion-tier-to-campaign
/openapi/promotions.json post /v1/promotions/{campaignId}/tiers
This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.
# Create Promotion Stack
Source: https://docs.voucherify.io/api-reference/promotions/create-promotion-stack
/openapi/promotions.json post /v1/promotions/{campaignId}/stacks
This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.
# Delete Promotion Stack
Source: https://docs.voucherify.io/api-reference/promotions/delete-promotion-stack
/openapi/promotions.json delete /v1/promotions/{campaignId}/stacks/{stackId}
This method deletes a promotion stack.
# Delete Promotion Tier
Source: https://docs.voucherify.io/api-reference/promotions/delete-promotion-tier
/openapi/promotions.json delete /v1/promotions/tiers/{promotionTierId}
This method deletes a promotion tier.
# Disable Promotion Tier
Source: https://docs.voucherify.io/api-reference/promotions/disable-promotion-tier
/openapi/promotions.json post /v1/promotions/tiers/{promotionTierId}/disable
This method disables a promotion tier, i.e. makes the `active` parameter = `false`.
# Enable Promotion Tier
Source: https://docs.voucherify.io/api-reference/promotions/enable-promotion-tier
/openapi/promotions.json post /v1/promotions/tiers/{promotionTierId}/enable
This method enables a promotion tier, i.e. makes the `active` parameter = `true`.
# Get Promotion Stack
Source: https://docs.voucherify.io/api-reference/promotions/get-promotion-stack
/openapi/promotions.json get /v1/promotions/{campaignId}/stacks/{stackId}
This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.
# Get Promotion Tier
Source: https://docs.voucherify.io/api-reference/promotions/get-promotion-tier
/openapi/promotions.json get /v1/promotions/tiers/{promotionTierId}
This method enables you to retrieve a specific promotion tier.
# List Promotion Stacks
Source: https://docs.voucherify.io/api-reference/promotions/list-promotion-stacks
/openapi/promotions.json get /v1/promotions/stacks
This method enables you to list promotion stacks irrespective of the campaign they are associated with.
You can use filters in the query parameters to specify the stacks to be returned in the response.
## Advanced filters for fetching promotion stacks
| **Filters** | **Examples** |
| :--- | :--- |
| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`
- `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |
| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`
- `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |
| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`
- `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |
| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`
- `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |
# List Promotion Stacks in Campaign
Source: https://docs.voucherify.io/api-reference/promotions/list-promotion-stacks-in-campaign
/openapi/promotions.json get /v1/promotions/{campaignId}/stacks
This method enables you to list promotion stacks from a specified campaign.
# List Promotion Tiers
Source: https://docs.voucherify.io/api-reference/promotions/list-promotion-tiers
/openapi/promotions.json get /v1/promotions/tiers
This method enables you to list promotion tiers.
# List Promotion Tiers from Campaign
Source: https://docs.voucherify.io/api-reference/promotions/list-promotion-tiers-from-campaign
/openapi/promotions.json get /v1/promotions/{campaignId}/tiers
This method enables you to list promotion tiers from a specified campaign.
# Promotion Tier Object
Source: https://docs.voucherify.io/api-reference/promotions/promotion-tier-object
Promotion Tier
| 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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-02-09T09:20:05.603Z
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
action
object
|
Contains details about the discount applied by the promotion tier.
| Attributes |
Description |
|
discount
|
See:
Discount
|
|
|
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.
|
|
promotion\_id
string
|
Promotion unique ID.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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 the 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.
-
true
indicates an
active
promotion tier
-
false
indicates an
inactive
promotion tier
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
summary
object
|
Contains statistics about promotion tier redemptions and orders.
| Attributes |
Description |
|
redemptions
object
|
Contains statistics about promotion tier redemptions.
| Attributes |
Description |
|
total\_redeemed
integer
|
Number of times the promotion tier was redeemed.
|
|
|
orders
object
|
Contains statistics about orders related to the promotion tier.
| Attributes |
Description |
|
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 the object represented by JSON. This object stores information about the promotion tier.
|
|
validation\_rule\_assignments
|
See:
Validation Rule Assignments List
|
|
category\_id
string
|
Promotion tier category ID.
Example:
cat\_0c9da30e7116ba6bba
|
|
categories
array
|
Array of
Category
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Validation Rule Assignments List
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of validation rule assignments.
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Update Promotion Stack
Source: https://docs.voucherify.io/api-reference/promotions/update-promotion-stack
/openapi/promotions.json put /v1/promotions/{campaignId}/stacks/{stackId}
This methods allows for editing an existing stack.
# Update Promotion Tier
Source: https://docs.voucherify.io/api-reference/promotions/update-promotion-tier
/openapi/promotions.json put /v1/promotions/tiers/{promotionTierId}
This method updates a promotion tier.
# Succeeded
Source: https://docs.voucherify.io/api-reference/publication/succeeded
openapi-events/events-publication.json webhook EVENTS.PUBLICATION.SUCCEEDED
The `EVENTS.PUBLICATION.SUCCEEDED` event indicates that a voucher code was successfully published to a customer.
This event serves as a real-time notification mechanism and it can notify other systems or applications that a voucher was assigned. As a result, the systems can react by, for example, sending a notification about an assignment to a customer.
In contrast to [EVENTS.VOUCHER.PUBLISHED](/api-reference/voucher/published), this event includes a `user` object that can be used to track who published a voucher through Voucherify dashboard.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Create Publication
Source: https://docs.voucherify.io/api-reference/publications/create-publication
/openapi/publications.json post /v1/publications
This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.
A voucher is suitable for publication when it's active and hasn't been published yet.
Clearly define the source of the voucher
You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code.
Publish multiple vouchers
In case you want to publish multiple vouchers within a single publication, you need to specify the campaign name and number of vouchers you want to publish.
Auto-update campaign
In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.
# Create Publication with GET
Source: https://docs.voucherify.io/api-reference/publications/create-publication-with-get
/openapi/publications.json get /v1/publications/create
This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.
A voucher is suitable for publication when it's active and hasn't been published yet.
Limited access
Access to this endpoint is limited. This endpoint is designed for specific integrations and the API keys need to be configured to access this endpoint. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request.
Clearly define the source of the voucher
You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code.
Publish multiple vouchers
This endpoint does not support the publishing of multiple vouchers from a single campaign. In case you want to publish multiple vouchers within a single publication, you need to use a [dedicated endpoint](/api-reference/publications/create-publication).
Auto-update campaign
In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.
## Example Request
```markdown Publication Query
/publications/create?campaign[name]=BlackFriday&customer[source_id]=Customer_Source_ID
```
Required
Query param `voucher` OR `campaign` MUST be filled out. If you provide both, `campaign` param will be skipped.
# List Publications
Source: https://docs.voucherify.io/api-reference/publications/list-publications
/openapi/publications.json get /v1/publications
Retrieve a list of publications. To return a **particular** publication, you can use the `source_id` query parameter and provide the `source_id` of the publication you are looking for specifically.
## Pagination
Important!
If you want to scroll through a huge set of records, it is recommended to use the [Exports API](/api-reference/exports/create-export). This API will return an error `page_over_limit` if you reach a page above 1000.
## Filter Query
The `filters` query parameter allows for joining multiple parameters with logical operators. The syntax looks as follows:
```
"$in"
"$not_in"
"$is"
"$is_not"
"$has_value"
"$is_unknown"
"$contains"
"$starts_with"
"$ends_with"
"$more_than"
"$less_than"
"$more_than_equal"
"$less_than_equal"
```
### Examples
```url
GET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL
```
```url
GET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc
```
```url
GET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR
```
# Publication Object
Source: https://docs.voucherify.io/api-reference/publications/publication-object
Publications Create Response Body
Response body schema for
POST
v1/publication
and
GET
v1/publications/create.
One of:
-
Publications Create Voucher Response Body
-
Publications Create Vouchers Response Body
Publications Create Voucher Response Body
Response body schema for
POST
v1/publication
and
GET
v1/publications/create.
All of:
-
Publications Create Base Response Body
-
| Attributes |
Description |
|
voucher
|
See:
Voucher
|
Publications Create Vouchers Response Body
Response body schema for
POST
v1/publication
and
GET
v1/publications/create.
All of:
-
Publications Create Base Response Body
-
| Attributes |
Description |
|
vouchers
array
|
Contains the unique voucher codes that was assigned by Voucherify.
|
Publications Create Base Response Body
| Attributes |
Description |
|
id
string
|
Unique publication ID, assigned by Voucherify.
Example:
pub\_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the
publication.
Available values:
publication
|
|
created\_at
string
|
Timestamp representing the date and time when the publication was created. The value is shown in the 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:
API
|
|
source\_id
string,
null
|
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
|
|
customer
|
See:
Customer With Summary Loyalty Referrals
|
|
vouchers\_id
array
|
Contains the unique internal voucher ID that was assigned by Voucherify.
|
Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
-
Voucher Base
-
Customer With Summary Loyalty Referrals
All of:
-
Customer Response Data
| Attributes |
Description |
|
id
string
|
The ID of an existing customer that will be linked to redemption in this request.
|
|
source\_id
string
|
A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.
|
|
summary
|
Customer Summary
|
|
loyalty
|
Customer Loyalty
|
|
referrals
|
Customer Referrals
|
|
system\_metadata
object
|
Object used to store system metadata information.
|
|
created\_at
string
|
Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.
Example:
2022-08-30T06:32:07.380Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-31T06:32:07.380Z
|
|
assets
object
|
Contains information about the customer's cockpit.
⚠️ Warning: Customer cockpits were removed. The customer cockpit URLs redirect to customer preference center.
| Attributes |
Description |
|
cockpit\_url
string
|
URL address to customer preference center. Previously, a customer's cockpit URL address.
|
|
cockpit\_preference\_center\_url
string
|
URL address to customer preference center.
|
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
-
Customer Base
Voucher Base
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
Gift Card Campaign
|
|
campaign\_id
string
|
Assigned by the Voucherify API, identifies the voucher's parent campaign.
Example:
camp\_FNYR4jhqZBM9xTptxDGgeNBV
|
|
category
string
|
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
|
|
discount
|
See:
Discount
|
|
gift
object
|
Object representing gift parameters. Child attributes are present only if
type
is
GIFT\_VOUCHER.
Defaults to
null.
| Attributes |
Description |
|
amount
integer
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
Example:
10000
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
balance
integer
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
active
boolean,
null
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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
|
See:
Voucher Assets
|
|
is\_referral\_code
boolean,
null
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referring person.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
|
publish
object
|
Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//redemptions
Example:
/v1/vouchers/WVPblOYX/redemptions?page=1\&limit=10
|
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Customer Summary
Customer Loyalty
| Attributes |
Description |
|
points
integer
|
Customer's loyalty points minus expired for all loyalty cards which the customer has.
|
|
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.
| Attributes |
Description |
|
\[propertyName]
object
|
Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.
| Attributes |
Description |
|
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.
|
|
|
Customer Referrals
| Attributes |
Description |
|
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:
Customer Referrals Campaigns Item
| Attributes |
Description |
|
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
Example:
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
|
|
Customer Base
| Attributes |
Description |
|
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. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
|
|
birthday
string
|
Deprecated.
Customer's birthdate; format YYYY-MM-DD.
|
|
birthdate
string
|
Customer's birthdate; format YYYY-MM-DD.
|
|
address
object,
null
|
Customer's address.
| Attributes |
Description |
|
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.
|
|
|
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.
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Voucher Assets
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D)
|
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Customer Summary Redemptions
| Attributes |
Description |
|
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.
| Attributes |
Description |
|
redeemed\_amount
integer
|
Total amount of gift card credits redeemed by customer. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
amount\_to\_go
integer
|
Remaining gift card balance across all gift cards. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
|
loyalty\_card
object
|
Summary of loyalty points.
| Attributes |
Description |
|
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.
|
|
Customer Summary Orders
| Attributes |
Description |
|
total\_amount
integer
|
The total amount spent by the customer. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
total\_count
integer
|
Total number of orders made by the customer.
|
|
average\_amount
integer
|
Average amount spent on orders.
total\_amount
÷
total\_count.
The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
last\_order\_amount
integer
|
Amount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Check Eligibility
Source: https://docs.voucherify.io/api-reference/qualifications/check-eligibility
/openapi/qualifications.json post /v1/qualifications
The Qualifications endpoint ignores the rules checking:
- Limit of total redeemed discount amount per campaign
- Limit of total redemptions count per campaign
- Redemptions per customer
- Redemptions per customer in a campaign
- Total amount before discount
Generate a list of redeemables that are applicable in the context of the customer and order.
The new qualifications method is an improved version of [Campaign Qualifications](/api-reference/campaigns/examine-campaign-qualification), [Voucher Qualifications](/api-reference/vouchers/examine-voucher-qualification) API requests. The new qualification method introduces the following improvements:
- Qualification results are returned faster
- No limit on the number of returned redeemables
- Introduces new qualification scenarios, not available in the previous version
Scenario Guide
Read [the dedicated guide](/guides/checking-eligibility) to learn about some use cases this endpoint can cover.
## Paging
The Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables per page. To get the next batch of redeemables, you need to use the `starting_after` cursor.
To process of paging the redeemables works in the following manner:
- You send the first API request for Qualifications without the `starting_after` parameter.
- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.
- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.
- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.
- Voucherify will return the next page of redeemables.
- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.
## Caching
Qualification has a 5-minute cache for the returned results. If you change your campaign settings or validation rules, the changes will apply to qualification results after the cache refreshes.
# Qualification Object
Source: https://docs.voucherify.io/api-reference/qualifications/qualification-object
Qualifications Check Eligibility Response Body
| Attributes |
Description |
|
redeemables
|
See:
Redeemables
|
|
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
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
|
|
|
stacking\_rules
|
See:
Stacking Rules
|
Redeemables
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. Default is
list.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of qualified redeemables.
Available values:
data
|
|
data
array
|
Array of qualified redeemables.
Array of
Combined response of redeemable object and multiple redeemables within
|
|
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 if there are more records for given parameters. This lets you know if you can run another request (with different options) to get more records returned in the results.
|
|
more\_starting\_after
string
|
Timestamp representing the date and time to use in
starting\_after
cursor to get more redeemables.
Example:
2023-10-31T12:13:16.374Z
|
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Stacking Rules
| Attributes |
Description |
|
redeemables\_limit
integer
|
Defines how many redeemables can be sent in one request. Note: more redeemables means more processing time.
|
|
applicable\_redeemables\_limit
integer
|
Defines how many redeemables can be applied in one request. The number must be less than or equal to
redeemables\_limit.
For example, a user can select 30 discounts but only 5 will be applied to the order and the remaining will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
applicable\_redeemables\_per\_category\_limit
integer
|
Defines how many redeemables with the same category can be applied in one request. The number must be less than or equal to
applicable\_redeemables\_limit.
The ones above the limit will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
applicable\_redeemables\_category\_limits
object
|
Lists categories by category IDs (keys) and defines their limits (values) of applicable redeemables that belong to campaigns with that category.
| Attributes |
Description |
|
\[propertyName]
integer
|
Limit of applicable redeemables per category.
|
|
|
applicable\_exclusive\_redeemables\_limit
integer
|
Defines how many redeemables with an assigned exclusive category can be applied in one request. The ones above the limit will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
applicable\_exclusive\_redeemables\_per\_category\_limit
integer
|
Defines how many redeemables with an exclusive category per category in stacking rules can be applied in one request. The ones above the limit will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
exclusive\_categories
array
|
Lists the IDs of exclusive categories. A redeemable from a campaign with an exclusive category is the only redeemable to be redeemed when applied with redeemables from other campaigns unless these campaigns are exclusive or joint.
|
|
joint\_categories
array
|
Lists the IDs of the joint categories. A campaign with a joint category is always applied regardless of the exclusivity of other campaigns.
|
|
redeemables\_application\_mode
string
|
Defines the application mode for redeemables.
"ALL"
means that all redeemables must be validated for the redemption to be successful.
"PARTIAL"
means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.
Available values:
ALL,
PARTIAL
|
|
redeemables\_sorting\_rule
string
|
Defines redeemables sorting rule.
CATEGORY\_HIERARCHY
means that redeemables are applied oaccording to the category priority.
REQUESTED\_ORDER
means that redeemables are applied in the sequence provided in the request.
Available values:
CATEGORY\_HIERARCHY,
REQUESTED\_ORDER
|
|
redeemables\_products\_application\_mode
string
|
Defines redeemables products application mode.
STACK
means that multiple discounts can be applied to a product.
ONCE
means that only one discount can be applied to the same product.
Available values:
STACK,
ONCE
|
|
redeemables\_no\_effect\_rule
string
|
Defines redeemables no effect rule.
REDEEM\_ANYWAY
means that the redeemable will be redeemed regardless of any restrictions or conditions in place.
SKIP
means that the redeemable will be processed only when an applicable effect is calculated.
Available values:
REDEEM\_ANYWAY,
SKIP
|
|
no\_effect\_skip\_categories
array
|
Lists category IDs. Redeemables with a given category are skipped even if the
redeemables\_no\_effect\_rule
is set to
REDEEM\_ANYWAY.
Category IDs can't overlap with the IDs in
no\_effect\_redeem\_anyway\_categories.
|
|
no\_effect\_redeem\_anyway\_categories
array
|
Lists category IDs. Redeemables with a given category are redeemed anyway even if the
redeemables\_no\_effect\_rule
is set to
SKIP.
Category IDs can't overlap with the IDs in
no\_effect\_skip\_categories.
|
|
redeemables\_rollback\_order\_mode
string
|
Defines the rollback mode for the order.
WITH\_ORDER
is a default setting. The redemption is rolled back together with the data about the order, including related discount values.
WITHOUT\_ORDER
allows rolling the redemption back without affecting order data, including the applied discount values.
Available values:
WITH\_ORDER,
WITHOUT\_ORDER
|
Combined response of redeemable object and multiple redeemables within
All of:
-
Single redeemable
-
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
Single redeemable
| Attributes |
Description |
|
id
string
|
ID of the redeemable. For a voucher, it's its
code
value.
|
|
object
string
|
Object type of the redeemable.
Available values:
campaign,
promotion\_tier,
promotion\_stack,
voucher
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
result
|
See:
Redeemable Result
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
|
|
|
validation\_rule\_id
string
|
A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.
|
|
applicable\_to
|
Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.
Applicable To Result List
|
|
inapplicable\_to
|
Contains list of items that do not qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These CANNOT be discounted.
Inapplicable To Result List
|
|
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.
|
|
categories
array
|
List of category information.
Array of
Category with Stacking Rules Type
|
|
banner
string
|
Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard.
Example:
Order Paid - You will get 100 points
|
|
name
string
|
Name of the redeemable.
Example:
promotion\_tier\_get\_points
|
|
campaign\_name
string
|
Name of the campaign associated to the redeemable. This field is available only if object is not
campaign
Example:
PromotionCampaign
|
|
campaign\_id
string
|
Id of the campaign associated to the redeemable. This field is available only if object is not
campaign
Example:
camp\_Mow7u4gSxagLlZ2oDQ01ZS5N
|
|
validation\_rules\_assignments
|
See:
Validation Rules Assignments List
|
Redeemable Result
Applicable To Result List
| Attributes |
Description |
|
data
array
|
Contains array of items to which the discount can apply.
Array of
Applicable To
|
|
total
integer
|
Total number of objects defining included products, SKUs, or product collections.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
list
|
|
data\_ref
string
|
The type of the object represented by JSON.
Available values:
data
|
Inapplicable To Result List
| Attributes |
Description |
|
data
array
|
Contains array of items to which the discount cannot apply.
Array of
Inapplicable To
|
|
total
integer
|
Total number of objects defining included products, SKUs, or product collections.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
list
|
|
data\_ref
string
|
The type of the object represented by JSON.
Available values:
data
|
Category with Stacking Rules Type
Category object with
stacking\_rules\_type
All of:
-
Category
-
| Attributes |
Description |
|
stacking\_rules\_type
string
|
The type of the stacking rule eligibility.
Available values:
JOINT,
EXCLUSIVE
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Bundle Details
| Attributes |
Description |
|
quantity
integer
|
Determines how many bundles are qualified. If there are missing bundle products, the value is
0.
If the bundle is qualified, the value is
1.
The maximum number of identified bundles can equal the number set in
limit.
Also defines the multiplier of the discount for
AMOUNT,
PERCENT,
and
UNIT
discount types. To inform end-customers that more products can be added to meet additional bundles, compare this parameter with
limit.
|
|
limit
integer
|
Determines the maximum number of identified bundles. This also defines the maximum multiplier of the bundle discount.
|
|
identified
array
|
Determines products from the customer's order items that meet bundle conditions. SKUs meet the conditions for their product that is used in the bundle. Returns only the products and their quantity that meet the bundle.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the product or SKU that meets the bundle condition. This is an ID assigned by Voucherify.
|
|
object
string
|
Determines the type of the object that meets the bundle condition.
Available values:
product,
sku
|
|
item\_index
integer
|
Number assigned to the order line item in accordance with the order sent in the request. It starts with
0
for the first order line item in the request.
|
|
item\_quantity
integer
|
Quantity of items that meet the bundle conditions. If the quantity in the order is higher than the quantity required by the bundle, this returns only the number that meets the bundle. For example, if the bundle requires
5
coffees, but the order includes
10
coffees,
item\_quantity
returns
5.
|
|
|
missing
array
|
Determines products, SKUs, or collections from the bundle that are missing in the customer's order items. Determines also the missing quantity. For collections, this means that order items do not include a sufficient number of items that belong to the collection. Not returned when all required bundle items are in the order.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the collection, product, or SKU that is missing in the customer's order items. This is an ID assigned by Voucherify.
|
|
object
string
|
Determines the type of the object that is missing in the customer's order items.
Available values:
product,
products\_collection,
sku
|
|
item\_quantity
integer
|
Quantity of items that are missing in the order items to meet the bundle conditions.
|
|
Redeemable Gift
| Attributes |
Description |
|
balance
number
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
credits
number
|
The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
locked\_credits
number
|
The number of credits that are locked under a validation session. This is returned if the qualification request includes
session.type: LOCK
parameter in the body. The value is multiplied by 100 to represent 2 decimal places. For example
10000
for
\$100.00.
Returns
0
if there aren't any active validation sessions for the gift card.
|
Redeemable Loyalty Card
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
Example:
6970
|
|
exchange\_ratio
number
|
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.
|
|
transfers
array
|
Array of
Loyalties Transfer Points
|
Error Object
| Attributes |
Description |
|
code
integer
|
Error's HTTP status code.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
request\_id
string
|
This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team.
Example:
v-0a885062c80375740f
|
|
resource\_id
string
|
Unique resource ID that can be used in another endpoint to get more details.
Example:
rf\_0c5d710a87c8a31f86
|
|
resource\_type
string
|
The resource type.
Example:
voucher
|
|
error
object
|
Includes additional information about the error.
| Attributes |
Description |
|
message
string
|
The message configured by the user in a validation rule.
|
|
Applicable To
| Attributes |
Description |
|
object
string
|
This object stores information about the resource to which the discount is applicable.
Available values:
product,
sku,
products\_collection
|
|
id
string
|
Unique product collection, product, or SKU identifier assigned by Voucherify.
|
|
source\_id
string
|
The source identifier from your inventory system.
|
|
product\_id
string
|
Parent product's unique ID assigned by Voucherify.
|
|
product\_source\_id
string
|
Parent product's source ID from your inventory system.
|
|
price
number
|
New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price\_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price.
|
|
price\_formula
number
|
Formula used to dynamically calculate the discounted price of an item.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Applicable To Effect
|
|
quantity\_limit
integer
|
The maximum number of units allowed to be discounted per order line item.
|
|
aggregated\_quantity\_limit
integer
|
The maximum number of units allowed to be discounted combined across all matched order line items.
|
|
amount\_limit
integer
|
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. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:
-
APPLY\_TO\_ITEMS
(each item subtotal is discounted equally)
-
APPLY\_TO\_ITEMS\_BY\_QUANTITY
(each unit of matched products has the same discount value)
|
|
product\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units (product, SKU, collection) that all customers can receive in a given campaign. If a product is selected, the limit covers all discounts across all SKUs belonging to that product. If a product collection is selected, the limit covers all products/SKUs within the collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units (product, SKU, collection) that one customer can receive in a given campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that all customers can receive in a given campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per campaign for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that one customer can receive in a campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units that all customers can receive in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units that one customer can receive in a given promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that all customers can receive in a given promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per promotion tier for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that one customer can receive in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a promotion tier for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
order\_item\_indices
array
|
Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the
order
object in the request. The first order line is assigned
0,
the second order line is assigned
1,
and so on.
|
|
order\_item\_units
array
|
Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the
index
corresponds to the order line sent in the
order
object in the request.
Array of:
| Attributes |
Description |
|
index
integer
|
Number assigned to the order line item in accordance with the order sent in the request.
|
|
units
array
|
Numbers of units in the order line covered by the discount; e.g.
2, 5, 8
for 10 units with the setting
"skip\_initially": 1,
"repeat": 3.
The counting of units starts from
1.
The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but
units\_limit\_exceeded: true.
However, the discount is calculated properly for all relevant units.
|
|
units\_limit\_exceeded
boolean
|
Returned as
true
only when the sum total of
quantity
of all order items exceeds 1000.
|
|
|
repeat
integer
|
Determines the recurrence of the discount, e.g.
"repeat": 3
means that the discount is applied to every third item.
|
|
skip\_initially
integer
|
Determines how many items are skipped before the discount is applied.
|
|
target
string
|
Determines to which kinds of objects the discount is applicable.
ITEM
includes products and SKUs.
UNIT
means particular units within an order line.
Available values:
ITEM,
UNIT
|
Inapplicable To
Applicable To
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Loyalties Transfer Points
| Attributes |
Description |
|
code
string
|
Unique loyalty card code from which the user wants to transfer loyalty points (source).
|
|
points
integer
|
The number of loyalty points that the user wants to transfer to another loyalty card. The number of points cannot be higher than the current balance on the loyalty card (source).
|
|
reason
string
|
Reason for the transfer.
|
|
source\_id
string
|
The merchant's transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service.
|
Applicable To Effect
Available values:
APPLY\_TO\_EVERY,
APPLY\_TO\_CHEAPEST,
APPLY\_FROM\_CHEAPEST,
APPLY\_TO\_MOST\_EXPENSIVE,
APPLY\_FROM\_MOST\_EXPENSIVE
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Failed
Source: https://docs.voucherify.io/api-reference/redemption/failed
openapi-events/events-redemption.json webhook EVENTS.REDEMPTION.FAILED
The `EVENTS.REDEMPTION.FAILED` event indicates that the redemption process encountered issues while applying the voucher codes or promotions tiers. As a result, the redemption was unsuccessful.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Rollback Failed
Source: https://docs.voucherify.io/api-reference/redemption/rollback-failed
openapi-events/events-redemption.json webhook EVENTS.REDEMPTION.ROLLBACK.FAILED
The `EVENTS.REDEMPTION.ROLLBACK.FAILED` event indicates that a redemption was unsuccessfully reverted.
This occurs when the system encounters difficulties in rolling back a previously redeemed voucher code or promotional tier. The main reasons are that a rollback was applied to a redemption created more than 3 months ago or an attempt was made to rollback a redemption that had been rolled back already.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Rollback Succeeded
Source: https://docs.voucherify.io/api-reference/redemption/rollback-succeeded
openapi-events/events-redemption.json webhook EVENTS.REDEMPTION.ROLLBACK.SUCCEEDED
The `EVENTS.REDEMPTION.ROLLBACK.SUCCEEDED` event indicates a redemption was successfully reversed. This occurs when a previously redeemed voucher code or promotional tier has been rolled back or undone.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Succeeded
Source: https://docs.voucherify.io/api-reference/redemption/succeeded
openapi-events/events-redemption.json webhook EVENTS.REDEMPTION.SUCCEEDED
The `EVENTS.REDEMPTION.SUCCEEDED` event indicates that the redemption process was successful. It confirms that the associated voucher codes and promotional tiers have been effectively applied.
A **redeemable stack** sends **one `redemption.succeeded` webhook for each redeemable**, plus **one extra webhook** for the whole stack.
**Example**
5 redeemables → 6 `redemption.succeeded` webhooks
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Get Redemption
Source: https://docs.voucherify.io/api-reference/redemptions/get-redemption
/openapi/redemptions.json get /v1/redemptions/{redemptionId}
Return a redemption or redemption rollback object. This object can either be a successfull or failed redemption or redemption rollback.
# Get Voucher's Redemptions
Source: https://docs.voucherify.io/api-reference/redemptions/get-vouchers-redemptions
/openapi/redemptions.json get /v1/vouchers/{code}/redemption
Retrieve the number of times a voucher was redeemed and each of the redemption details.
# List Redemptions
Source: https://docs.voucherify.io/api-reference/redemptions/list-redemptions
/openapi/redemptions.json get /v1/redemptions
Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers.
## Filtering results
The result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date:
`https://api.voucherify.io/v1/redemptions?limit=3&[created_at][before]=2017-09-08T13:52:18.227Z`.
A filter based on the object `created_at` field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: `[created_at][after]`, `[created_at][before]`.
A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`.
## Failed Redemptions
A redemption may fail for various reasons. You can figure out an exact reason from the `failure_code`:
- `resource_not_found` - voucher with given code does not exist
- `voucher_not_active` - voucher is not active yet (before start date)
- `voucher_expired` - voucher has already expired (after expiration date)
- `voucher_disabled` - voucher has been disabled (`active: false`)
- `quantity_exceeded` - voucher's redemptions limit has been exceeded
- `gift_amount_exceeded` - gift amount has been exceeded
- `customer_rules_violated` - customer did not match the segment
- `order_rules_violated` - order did not match validation rules
- `invalid_order` - order was specified incorrectly
- `invalid_amount` - order amount was specified incorrectly
- `missing_amount` - order amount was not specified
- `missing_order_items` - order items were not specified
- `missing_customer` - customer was not specified
# Redeem Promotion
Source: https://docs.voucherify.io/api-reference/redemptions/redeem-promotion
/openapi/redemptions.json post /v1/promotions/tiers/{promotionTierId}/redemption
Deprecated
This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/redemptions/redeem-stackable-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To redeem a promotion, you create a redemption object passing a context.
You can retrieve a list of active promotions through the [Validate Promotions](/api-reference/validations/validate-promotion-tier) endpoint. That validation method will return a list of active promotion tiers identified by thier IDs.
Redemption rollback
Do you need to undo a redemption? You can do it with [redemption rollback](/api-reference/redemptions/rollback-redemption).
# Redeem Stackable Discounts
Source: https://docs.voucherify.io/api-reference/redemptions/redeem-stackable-discounts
/openapi/redemptions.json post /v1/redemptions
In the table below, you can see the logic the API follows to calculate discounts and amounts:
| **Field** | **Calculation** | **Description** |
|:---|:---|:---|
| amount | N/A | This field shows the order amount before applying any discount |
| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |
| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |
| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |
| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |
| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |
| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |
| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |
API keys with a Merchant role can't use this endpoint.
Rollbacks
You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](/api-reference/redemptions/rollback-stackable-redemptions).
Also available on client-side
This method is also accessible through public keys which you can use in client-side apps: mobile and web browser apps. Go to the dedicated [endpoint](/api-reference/client-side/redeem-stackable-discounts-client-side) to learn more.
# Redeem Voucher
Source: https://docs.voucherify.io/api-reference/redemptions/redeem-voucher
/openapi/redemptions.json post /v1/vouchers/{code}/redemption
Deprecated
This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/redemptions/redeem-stackable-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To redeem a voucher, you create a redemption object. It increments the redemption counter and updates the history of the voucher.
## How discounts and order amounts are calculated in the API response?
In the table below, you can see the logic the API follows to calculate discounts and amounts:
| **Field** | **Calculation** | **Description** |
|:---|:---|:---|
| amount | N/A | This field shows the order amount before applying any discount |
| total_amount | total_amount = amount - total_discount_amount | This field shows the order amount after applying all the discounts |
| discount_amount | discount_amount = previous_discount_amount + applied_discount_amount | This field sums up all order-level discounts applied to a patricular order |
| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts applied to this order |
| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts applied to this order |
| applied_discount_amount | N/A | This field shows order-level discount applied in a particular request |
| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |
| total_applied_discount_amount | total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount | This field sums up all order-level and all product-specific discounts applied in a particular request |
# Redemption Object
Source: https://docs.voucherify.io/api-reference/redemptions/redemption-object
Redemption
This is an object representing a redemption for
POST
v1/redemptions
and
POST
/client/v1/redemptions.
All of:
-
Redemption Base
-
Redemption Base
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
object
string
|
The type of the object represented by the JSON
Available values:
redemption
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
customer\_id
string,
null
|
Unique customer ID of the redeeming customer.
Example:
cust\_i8t5Tt6eiKG5K79KQlJ0Vs64
|
|
tracking\_id
string,
null
|
Hashed customer source ID.
|
|
metadata
object,
null
|
The metadata object stores all custom attributes assigned to the redemption.
|
|
amount
integer
|
For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the number of redeemed credits.
For loyalty cards, this is the number of loyalty points used in the transaction.
Example:
10000
|
|
redemption
string,
null
|
Unique redemption ID of the parent redemption.
Example:
r\_0c656311b5878a2031
|
|
result
string
|
Redemption result.
Available values:
SUCCESS,
FAILURE
|
|
status
string
|
Redemption status.
Available values:
SUCCEEDED,
FAILED,
ROLLED\_BACK
|
|
session
object
|
Contains details about the redemption session lock. Sessions can be established only for discount vouchers, promotions, and gift cards.
| Attributes |
Description |
|
key
string
|
The session unique ID assigned by Voucherify or your own unique session ID sent in the request.
|
|
|
related\_redemptions
object
|
| Attributes |
Description |
|
rollbacks
array
|
Array of:
Redemption Related Redemptions Rollbacks Item
| Attributes |
Description |
|
id
string
|
Unique rollback redemption ID.
Example:
rr\_0bc92f81a6801f9bca
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
rollback\_order\_mode
string
|
Defines the rollback mode for the order.
WITH\_ORDER
is a default setting. The redemption is rolled back together with the data about the order, including related discount values.
WITHOUT\_ORDER
allows rolling the redemption back without affecting order data, including the applied discount values. This is returned only in GET
v1/redemptions/
and GET
v1/redemptions/
endpoints.
Available values:
WITH\_ORDER,
WITHOUT\_ORDER
|
|
|
redemptions
array
|
Array of:
Redemption Related Redemptions Item
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
|
|
failure\_code
string
|
If the result is
FAILURE,
this parameter will provide a generic reason as to why the redemption failed.
Example:
customer\_rules\_violated
|
|
failure\_message
string
|
If the result is
FAILURE,
this parameter will provide a more expanded reason as to why the redemption failed.
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
|
|
|
channel
object
|
Defines the details of the channel through which the redemption was issued.
| Attributes |
Description |
|
channel\_id
string
|
Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API. For
AUTO\_REDEEM,
it is the reward assignment ID.
Example:
user\_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
|
|
channel\_type
string
|
The source of the channel for the redemption. A
USER
corresponds to the Voucherify Dashboard,
API
corresponds to the API, and
AUTO\_REDEEM
corresponds to a loyalty campaign reward that has been redeemed automatically.
Available values:
USER,
API,
AUTO\_REDEEM
|
|
|
customer
|
Simple Customer
|
|
related\_object\_type
string
|
Defines the related object.
Available values:
voucher,
promotion\_tier,
redemption
|
|
related\_object\_id
string
|
Unique related object ID assigned by Voucherify, i.e. v\_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
|
|
promotion\_tier
|
Contains details of the promotion tier and the parent campaign.
Promotion Tier
|
|
reward
|
See:
Redemption Reward Result
|
|
gift
object
|
Contains the amount subtracted from the gift card for the redemption.
| Attributes |
Description |
|
amount
integer
|
Amount subtracted from the gift card as a result of the redemption. The amount is expressed as the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
|
loyalty\_card
object
|
Contains the number of points subtracted from the loyalty card for the redemption.
| Attributes |
Description |
|
points
integer
|
Number of points subtracted from the loyalty card as a result of the redemption.
|
|
Voucher with categories and validation rules assignments
This is an object representing a voucher with categories and validation rules assignments for
POST
v1/qualifications,
POST
v1/redemptions,
and
POST
v1/validations.
All of:
-
Voucher Base
-
Voucher Holder
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Simple Customer
| Attributes |
Description |
|
id
string
|
Unique identifier of an existing customer. It is assigned by Voucherify.
|
|
name
string
|
Customer's first and last name.
|
|
email
string
|
Customer's email address.
|
|
source\_id
string
|
A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service.
|
|
metadata
object
|
A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Promotion Tier
| 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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-02-09T09:20:05.603Z
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
action
object
|
Contains details about the discount applied by the promotion tier.
| Attributes |
Description |
|
discount
|
See:
Discount
|
|
|
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.
|
|
promotion\_id
string
|
Promotion unique ID.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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 the 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.
-
true
indicates an
active
promotion tier
-
false
indicates an
inactive
promotion tier
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
summary
object
|
Contains statistics about promotion tier redemptions and orders.
| Attributes |
Description |
|
redemptions
object
|
Contains statistics about promotion tier redemptions.
| Attributes |
Description |
|
total\_redeemed
integer
|
Number of times the promotion tier was redeemed.
|
|
|
orders
object
|
Contains statistics about orders related to the promotion tier.
| Attributes |
Description |
|
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 the object represented by JSON. This object stores information about the promotion tier.
|
|
validation\_rule\_assignments
|
See:
Validation Rule Assignments List
|
|
category\_id
string
|
Promotion tier category ID.
Example:
cat\_0c9da30e7116ba6bba
|
|
categories
array
|
Array of
Category
|
Redemption Reward Result
| Attributes |
Description |
|
customer
|
Simple Customer
|
|
assignment\_id
string,
null
|
Unique reward assignment ID assigned by Voucherify.
|
|
voucher
|
Voucher
|
|
product
|
Product
|
|
sku
|
SKU Object
|
|
loyalty\_tier\_id
string,
null
|
Unique loyalty tier ID assigned by Voucherify.
|
|
id
string
|
Unique reward ID.
Example:
rew\_0bc92f81a6801f9bca
|
|
name
string
|
Name of the reward.
Example:
Reward Name
|
|
object
string
|
The type of the object represented by the JSON
Available values:
reward
|
|
created\_at
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp in ISO 8601 format indicating when the reward was updated.
Example:
2022-10-03T12:24:58.008Z
|
|
parameters
object
|
These are parameters representing a material reward.
| Attributes |
Description |
|
campaign
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Campaign unique ID.
Example:
camp\_13BbZ0kQsNinhqsX3wUts2UP
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
|
|
type
string
|
Defines the type of the campaign.
|
|
|
product
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
Example:
prod\_0b7d7dfb05cbe5c616
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
Example:
sku\_0a41e31c7b41c28358
|
|
|
coin
object
|
Defines the ratio by mapping the number of loyalty points in
points\_ratio
to a predefined cash amount in
exchange\_ratio.
| Attributes |
Description |
|
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.
|
|
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward.
|
|
type
string
|
Reward type.
Available values:
CAMPAIGN,
COIN,
MATERIAL
|
Voucher Base
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
Gift Card Campaign
|
|
campaign\_id
string
|
Assigned by the Voucherify API, identifies the voucher's parent campaign.
Example:
camp\_FNYR4jhqZBM9xTptxDGgeNBV
|
|
category
string
|
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
|
|
discount
|
See:
Discount
|
|
gift
object
|
Object representing gift parameters. Child attributes are present only if
type
is
GIFT\_VOUCHER.
Defaults to
null.
| Attributes |
Description |
|
amount
integer
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
Example:
10000
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
balance
integer
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
active
boolean,
null
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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
|
See:
Voucher Assets
|
|
is\_referral\_code
boolean,
null
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referring person.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
|
publish
object
|
Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//redemptions
Example:
/v1/vouchers/WVPblOYX/redemptions?page=1\&limit=10
|
|
Category with Stacking Rules Type
Category object with
stacking\_rules\_type
All of:
-
Category
-
| Attributes |
Description |
|
stacking\_rules\_type
string
|
The type of the stacking rule eligibility.
Available values:
JOINT,
EXCLUSIVE
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Validation Rule Assignments List
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of validation rule assignments.
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
-
Voucher Base
-
Product
This is an object representing a product.
This entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.
All of:
-
Product without Skus Object
-
SKU Object
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
Example:
sku\_0b1621b319d248b79f
|
|
source\_id
string,
null
|
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,
null
|
Unique user-defined SKU name.
Example:
Large Pink Shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed as
10000.
|
|
currency
string,
null
|
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,
null
|
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. It can be used to create product collections.
|
|
created\_at
string
|
Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:36:30.187Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:55:09.137Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
SKU.
Available values:
sku
|
Voucher Assets
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D)
|
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
Product without Skus Object
| Attributes |
Description |
|
id
string
|
Unique product ID assigned by Voucherify.
Example:
prod\_0b1da8105693710357
|
|
source\_id
string,
null
|
Unique product source ID.
Example:
productSourceID16
|
|
name
string,
null
|
Unique user-defined product name.
Example:
T-shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed 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. It can be used to create product collections.
|
|
image\_url
string,
null
|
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](https://images.com/original.jpg)
|
|
created\_at
string
|
Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.
Example:
2022-05-23T06:52:55.008Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-23T09:24:07.405Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the product.
Available values:
product
|
Skus List For Product
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of SKUs in the product.
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Redemption Rollback Object
Source: https://docs.voucherify.io/api-reference/redemptions/redemption-rollback-object
Redemption Rollback
| Attributes |
Description |
|
id
string
|
Unique identifier of the redemption rollback.
Example:
rr\_0efeb3dab05e62e599
|
|
object
string
|
The type of the object represented by the JSON
Available values:
redemption\_rollback
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
customer\_id
string,
null
|
Unique customer ID of the redeeming customer.
Example:
cust\_i8t5Tt6eiKG5K79KQlJ0Vs64
|
|
tracking\_id
string,
null
|
Hashed customer source ID.
|
|
metadata
object,
null
|
The metadata object stores all custom attributes assigned to the redemption.
|
|
amount
integer
|
For gift cards, this represents the number of the credits restored to the card in the rolledback redemption. The number is a negative integer in the smallest currency unit, e.g. -100 cents for \$1.00 added back to the card.
For loyalty cards, this represents the number of loyalty points restored to the card in the rolledback redemption. The number is a negative integer.
Example:
-10000
|
|
redemption
string,
null
|
Unique redemption ID of the parent redemption.
Example:
r\_0c656311b5878a2031
|
|
reason
string
|
System generated cause for the redemption being invalid in the context of the provided parameters.
|
|
result
string
|
Redemption result.
Available values:
SUCCESS,
FAILURE
|
|
status
string
|
Redemption status.
Available values:
SUCCEEDED,
FAILED
|
|
failure\_code
string
|
If the result is
FAILURE,
this parameter will provide a generic reason as to why the redemption failed.
Example:
customer\_rules\_violated
|
|
failure\_message
string
|
If the result is
FAILURE,
this parameter will provide a more expanded reason as to why the redemption failed.
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
Array of
Order Item Calculated
|
|
|
channel
object
|
Defines the details of the channel through which the redemption was issued.
| Attributes |
Description |
|
channel\_id
string
|
Unique identifier of the channel which was used by the user performing the redemption rollback. This is either a user ID from the user using the Voucherify Dashboard or an X-APP-Id of a user using the API.
Example:
user\_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
|
|
channel\_type
string
|
The source of the channel for the redemption. A
USER
corresponds to the Voucherify Dashboard and an
API
corresponds to the API.
Available values:
USER,
API
|
|
|
customer
|
Simple Customer
|
|
related\_object\_type
string
|
Defines the related object.
Available values:
voucher,
promotion\_tier,
redemption
|
|
related\_object\_id
string
|
Unique identifier of the related object. It is assigned by Voucherify, i.e.
v\_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno
for a voucher.
|
|
voucher
|
Defines the details of the voucher being originally redeemed.
Voucher
|
|
promotion\_tier
|
Contains details of the promotion tier and the parent campaign.
Promotion Tier
|
|
reward
|
See:
Redemption Reward Result
|
|
gift
object
|
Contains the amount returned to the gift card in the redemption rollback. It is expressed as a negative integer.
| Attributes |
Description |
|
amount
integer
|
Amount returned to the gift card as a result of the redemption rollback and expressed as a negative integer. The amount is expressed as the smallest currency unit (e.g. -100 cents for \$1.00 returned).
|
|
|
loyalty\_card
object
|
Contains the number of points returned to the loyalty card in the reward redemption rollback. It is expressed as a negative integer.
| Attributes |
Description |
|
points
integer
|
Number of points being returned to the loyalty card for the reward redemption rollback. It is expressed as a negative integer.
|
|
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Order Item Calculated
| Attributes |
Description |
|
id
string
|
Unique identifier of the order line item.
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
|
|
product\_id
string
|
Unique identifier of the product. It is assigned by Voucherify.
|
|
related\_object
string
|
Used along with the source\_id property, can be set to either sku or product.
Available values:
product,
sku
|
|
source\_id
string
|
The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
|
|
quantity
integer
|
The quantity of the particular item in the cart.
|
|
discount\_quantity
integer
|
Number of dicounted items.
|
|
initial\_quantity
integer
|
A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity.
|
|
amount
integer
|
The total amount of the order item (price \* quantity).
|
|
discount\_amount
integer
|
Sum of all order-item-level discounts applied to the order.
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied.
|
|
applied\_discount\_quantity
integer
|
Number of the discounted items applied in the transaction.
|
|
applied\_quantity
integer
|
Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
applied\_quantity\_amount
integer
|
Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
initial\_amount
integer
|
A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the total amount of the order. This is the sum of the order items' amounts.
|
|
price
integer
|
Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
\-
applied\_discount\_amount
|
|
product
object
|
An object containing details of the related product.
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the product and is assigned by Voucherify.
|
|
source\_id
string
|
The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
|
|
override
boolean
|
The override set to
true
is used to store the product information in the system. If the product does not exist, it will be created with a source\_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
|
|
name
string
|
Product name.
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections.
|
|
price
number
|
Product price. A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
|
sku
object
|
An object containing details of the related SKU.
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
|
|
source\_id
string
|
The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
|
|
override
boolean
|
The override set to
true
is used to store the product information in the system. If the product does not exist, it will be created with a source\_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
|
|
sku
string
|
The SKU name.
|
|
price
number
|
SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections.
|
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order\_item
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas.
|
Simple Customer
| Attributes |
Description |
|
id
string
|
Unique identifier of an existing customer. It is assigned by Voucherify.
|
|
name
string
|
Customer's first and last name.
|
|
email
string
|
Customer's email address.
|
|
source\_id
string
|
A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service.
|
|
metadata
object
|
A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
-
Voucher Base
-
Promotion Tier
| 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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-02-09T09:20:05.603Z
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
action
object
|
Contains details about the discount applied by the promotion tier.
| Attributes |
Description |
|
discount
|
See:
Discount
|
|
|
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.
|
|
promotion\_id
string
|
Promotion unique ID.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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 the 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.
-
true
indicates an
active
promotion tier
-
false
indicates an
inactive
promotion tier
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
summary
object
|
Contains statistics about promotion tier redemptions and orders.
| Attributes |
Description |
|
redemptions
object
|
Contains statistics about promotion tier redemptions.
| Attributes |
Description |
|
total\_redeemed
integer
|
Number of times the promotion tier was redeemed.
|
|
|
orders
object
|
Contains statistics about orders related to the promotion tier.
| Attributes |
Description |
|
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 the object represented by JSON. This object stores information about the promotion tier.
|
|
validation\_rule\_assignments
|
See:
Validation Rule Assignments List
|
|
category\_id
string
|
Promotion tier category ID.
Example:
cat\_0c9da30e7116ba6bba
|
|
categories
array
|
Array of
Category
|
Redemption Reward Result
| Attributes |
Description |
|
customer
|
Simple Customer
|
|
assignment\_id
string,
null
|
Unique reward assignment ID assigned by Voucherify.
|
|
voucher
|
Voucher
|
|
product
|
Product
|
|
sku
|
SKU Object
|
|
loyalty\_tier\_id
string,
null
|
Unique loyalty tier ID assigned by Voucherify.
|
|
id
string
|
Unique reward ID.
Example:
rew\_0bc92f81a6801f9bca
|
|
name
string
|
Name of the reward.
Example:
Reward Name
|
|
object
string
|
The type of the object represented by the JSON
Available values:
reward
|
|
created\_at
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp in ISO 8601 format indicating when the reward was updated.
Example:
2022-10-03T12:24:58.008Z
|
|
parameters
object
|
These are parameters representing a material reward.
| Attributes |
Description |
|
campaign
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Campaign unique ID.
Example:
camp\_13BbZ0kQsNinhqsX3wUts2UP
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
|
|
type
string
|
Defines the type of the campaign.
|
|
|
product
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
Example:
prod\_0b7d7dfb05cbe5c616
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
Example:
sku\_0a41e31c7b41c28358
|
|
|
coin
object
|
Defines the ratio by mapping the number of loyalty points in
points\_ratio
to a predefined cash amount in
exchange\_ratio.
| Attributes |
Description |
|
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.
|
|
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward.
|
|
type
string
|
Reward type.
Available values:
CAMPAIGN,
COIN,
MATERIAL
|
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
Voucher Base
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
Gift Card Campaign
|
|
campaign\_id
string
|
Assigned by the Voucherify API, identifies the voucher's parent campaign.
Example:
camp\_FNYR4jhqZBM9xTptxDGgeNBV
|
|
category
string
|
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
|
|
discount
|
See:
Discount
|
|
gift
object
|
Object representing gift parameters. Child attributes are present only if
type
is
GIFT\_VOUCHER.
Defaults to
null.
| Attributes |
Description |
|
amount
integer
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
Example:
10000
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
balance
integer
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
active
boolean,
null
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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
|
See:
Voucher Assets
|
|
is\_referral\_code
boolean,
null
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referring person.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
|
publish
object
|
Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//redemptions
Example:
/v1/vouchers/WVPblOYX/redemptions?page=1\&limit=10
|
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Validation Rule Assignments List
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of validation rule assignments.
|
Product
This is an object representing a product.
This entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.
All of:
-
Product without Skus Object
-
SKU Object
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
Example:
sku\_0b1621b319d248b79f
|
|
source\_id
string,
null
|
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,
null
|
Unique user-defined SKU name.
Example:
Large Pink Shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed as
10000.
|
|
currency
string,
null
|
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,
null
|
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. It can be used to create product collections.
|
|
created\_at
string
|
Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:36:30.187Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:55:09.137Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
SKU.
Available values:
sku
|
Voucher Assets
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D)
|
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
Product without Skus Object
| Attributes |
Description |
|
id
string
|
Unique product ID assigned by Voucherify.
Example:
prod\_0b1da8105693710357
|
|
source\_id
string,
null
|
Unique product source ID.
Example:
productSourceID16
|
|
name
string,
null
|
Unique user-defined product name.
Example:
T-shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed 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. It can be used to create product collections.
|
|
image\_url
string,
null
|
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](https://images.com/original.jpg)
|
|
created\_at
string
|
Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.
Example:
2022-05-23T06:52:55.008Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-23T09:24:07.405Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the product.
Available values:
product
|
Skus List For Product
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of SKUs in the product.
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Rollback Redemption
Source: https://docs.voucherify.io/api-reference/redemptions/rollback-redemption
/openapi/redemptions.json post /v1/redemptions/{redemptionId}/rollback
Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. This endpoint rolls back only single redemptions, meaning those that are not stacked. Stacked redemptions belong to a parent redemption. To roll back a parent redemption, including all of its individual redemptions, use the [POST Rollback Stackable Redemptions](/api-reference/redemptions/rollback-stackable-redemptions)
You can roll back a redemption up to 3 months back.
## Effect
The operation
- creates a rollback entry in voucher's redemption history (`redemption.redemption_entries`) and
- gives 1 redemption back to the pool (decreases `redeemed_quantity` by 1).
## Returned funds
In case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption.
# Rollback Stackable Redemptions
Source: https://docs.voucherify.io/api-reference/redemptions/rollback-stackable-redemptions
/openapi/redemptions.json post /v1/redemptions/{parentRedemptionId}/rollbacks
Rollback a stackable redemption. When you roll back a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter. However, you can use this endpoint to roll back a single redemption that does not have a parent, similarly to [POST Rollback redemption](/api-reference/redemptions/rollback-redemption).
You can roll back a redemption up to 3 months back.
# Stackable Redemptions Object
Source: https://docs.voucherify.io/api-reference/redemptions/stackable-redemptions-object
Redemptions Redeem Response Body
| Attributes |
Description |
|
redemptions
array
|
Array of
Redemption
|
|
parent\_redemption
|
See:
Redemption
|
|
order
|
Contains the order details associated with the redemption.
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
|
|
|
inapplicable\_redeemables
array
|
Lists validation results of each inapplicable redeemable.
Array of
Inapplicable Redeemable
|
|
skipped\_redeemables
array
|
Lists validation results of each redeemable. If a redeemable can be applied, the API returns
"status": "APPLICABLE".
Array of
Skipped Redeemable
|
Redemption
This is an object representing a redemption for
POST
v1/redemptions
and
POST
/client/v1/redemptions.
All of:
-
Redemption Base
-
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Inapplicable Redeemable
| Attributes |
Description |
|
status
string
|
Indicates whether the redeemable can be applied or not applied based on the validation rules.
Available values:
INAPPLICABLE
|
|
id
string
|
Redeemable ID, i.e. the voucher code.
|
|
object
string
|
Redeemable's object type.
Available values:
voucher,
promotion\_tier
|
|
result
object
|
Includes the error object with details about the reason why the redeemable is inapplicable
| Attributes |
Description |
|
error
|
See:
Error Object
|
|
details
object
|
Provides details about the reason why the redeemable is inapplicable.
| Attributes |
Description |
|
message
string
|
Generic message from the
message
string shown in the
error
object or the message configured in a validation rule.
|
|
key
string
|
Generic message from the
key
string shown in the
error
object.
|
|
|
bundle
|
See:
Bundle Details
|
|
|
metadata
object
|
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.
|
|
categories
array
|
Array of
Category with Stacking Rules Type
|
|
campaign\_name
string
|
Campaign name. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
|
campaign\_id
string
|
Unique campaign ID assigned by Voucherify. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
Example:
camp\_pqZjuhG6Mgtp4GD0zD7b8hA3
|
|
name
string
|
Name of the promotion tier. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
Skipped Redeemable
| Attributes |
Description |
|
status
string
|
Indicates whether the redeemable can be applied or not applied based on the validation rules.
Available values:
SKIPPED
|
|
id
string
|
Redeemable ID, i.e. the voucher code.
|
|
object
string
|
Redeemable's object type.
Available values:
voucher,
promotion\_tier
|
|
result
object
|
Provides details about the reason why the redeemable is skipped.
|
|
metadata
object
|
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.
|
|
categories
array
|
Array of
Category with Stacking Rules Type
|
|
campaign\_name
string
|
Campaign name. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
|
campaign\_id
string
|
Unique campaign ID assigned by Voucherify. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
Example:
camp\_pqZjuhG6Mgtp4GD0zD7b8hA3
|
|
name
string
|
Name of the promotion tier. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
Redemption Base
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
object
string
|
The type of the object represented by the JSON
Available values:
redemption
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
customer\_id
string,
null
|
Unique customer ID of the redeeming customer.
Example:
cust\_i8t5Tt6eiKG5K79KQlJ0Vs64
|
|
tracking\_id
string,
null
|
Hashed customer source ID.
|
|
metadata
object,
null
|
The metadata object stores all custom attributes assigned to the redemption.
|
|
amount
integer
|
For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the number of redeemed credits.
For loyalty cards, this is the number of loyalty points used in the transaction.
Example:
10000
|
|
redemption
string,
null
|
Unique redemption ID of the parent redemption.
Example:
r\_0c656311b5878a2031
|
|
result
string
|
Redemption result.
Available values:
SUCCESS,
FAILURE
|
|
status
string
|
Redemption status.
Available values:
SUCCEEDED,
FAILED,
ROLLED\_BACK
|
|
session
object
|
Contains details about the redemption session lock. Sessions can be established only for discount vouchers, promotions, and gift cards.
| Attributes |
Description |
|
key
string
|
The session unique ID assigned by Voucherify or your own unique session ID sent in the request.
|
|
|
related\_redemptions
object
|
| Attributes |
Description |
|
rollbacks
array
|
Array of:
Redemption Related Redemptions Rollbacks Item
| Attributes |
Description |
|
id
string
|
Unique rollback redemption ID.
Example:
rr\_0bc92f81a6801f9bca
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
rollback\_order\_mode
string
|
Defines the rollback mode for the order.
WITH\_ORDER
is a default setting. The redemption is rolled back together with the data about the order, including related discount values.
WITHOUT\_ORDER
allows rolling the redemption back without affecting order data, including the applied discount values. This is returned only in GET
v1/redemptions/
and GET
v1/redemptions/
endpoints.
Available values:
WITH\_ORDER,
WITHOUT\_ORDER
|
|
|
redemptions
array
|
Array of:
Redemption Related Redemptions Item
| Attributes |
Description |
|
id
string
|
Unique redemption ID.
Example:
r\_0bc92f81a6801f9bca
|
|
date
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
|
|
failure\_code
string
|
If the result is
FAILURE,
this parameter will provide a generic reason as to why the redemption failed.
Example:
customer\_rules\_violated
|
|
failure\_message
string
|
If the result is
FAILURE,
this parameter will provide a more expanded reason as to why the redemption failed.
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
|
|
|
channel
object
|
Defines the details of the channel through which the redemption was issued.
| Attributes |
Description |
|
channel\_id
string
|
Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API. For
AUTO\_REDEEM,
it is the reward assignment ID.
Example:
user\_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
|
|
channel\_type
string
|
The source of the channel for the redemption. A
USER
corresponds to the Voucherify Dashboard,
API
corresponds to the API, and
AUTO\_REDEEM
corresponds to a loyalty campaign reward that has been redeemed automatically.
Available values:
USER,
API,
AUTO\_REDEEM
|
|
|
customer
|
Simple Customer
|
|
related\_object\_type
string
|
Defines the related object.
Available values:
voucher,
promotion\_tier,
redemption
|
|
related\_object\_id
string
|
Unique related object ID assigned by Voucherify, i.e. v\_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
|
|
promotion\_tier
|
Contains details of the promotion tier and the parent campaign.
Promotion Tier
|
|
reward
|
See:
Redemption Reward Result
|
|
gift
object
|
Contains the amount subtracted from the gift card for the redemption.
| Attributes |
Description |
|
amount
integer
|
Amount subtracted from the gift card as a result of the redemption. The amount is expressed as the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
|
loyalty\_card
object
|
Contains the number of points subtracted from the loyalty card for the redemption.
| Attributes |
Description |
|
points
integer
|
Number of points subtracted from the loyalty card as a result of the redemption.
|
|
Voucher with categories and validation rules assignments
This is an object representing a voucher with categories and validation rules assignments for
POST
v1/qualifications,
POST
v1/redemptions,
and
POST
v1/validations.
All of:
-
Voucher Base
-
Voucher Holder
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
Error Object
| Attributes |
Description |
|
code
integer
|
Error's HTTP status code.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
request\_id
string
|
This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team.
Example:
v-0a885062c80375740f
|
|
resource\_id
string
|
Unique resource ID that can be used in another endpoint to get more details.
Example:
rf\_0c5d710a87c8a31f86
|
|
resource\_type
string
|
The resource type.
Example:
voucher
|
|
error
object
|
Includes additional information about the error.
| Attributes |
Description |
|
message
string
|
The message configured by the user in a validation rule.
|
|
Bundle Details
| Attributes |
Description |
|
quantity
integer
|
Determines how many bundles are qualified. If there are missing bundle products, the value is
0.
If the bundle is qualified, the value is
1.
The maximum number of identified bundles can equal the number set in
limit.
Also defines the multiplier of the discount for
AMOUNT,
PERCENT,
and
UNIT
discount types. To inform end-customers that more products can be added to meet additional bundles, compare this parameter with
limit.
|
|
limit
integer
|
Determines the maximum number of identified bundles. This also defines the maximum multiplier of the bundle discount.
|
|
identified
array
|
Determines products from the customer's order items that meet bundle conditions. SKUs meet the conditions for their product that is used in the bundle. Returns only the products and their quantity that meet the bundle.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the product or SKU that meets the bundle condition. This is an ID assigned by Voucherify.
|
|
object
string
|
Determines the type of the object that meets the bundle condition.
Available values:
product,
sku
|
|
item\_index
integer
|
Number assigned to the order line item in accordance with the order sent in the request. It starts with
0
for the first order line item in the request.
|
|
item\_quantity
integer
|
Quantity of items that meet the bundle conditions. If the quantity in the order is higher than the quantity required by the bundle, this returns only the number that meets the bundle. For example, if the bundle requires
5
coffees, but the order includes
10
coffees,
item\_quantity
returns
5.
|
|
|
missing
array
|
Determines products, SKUs, or collections from the bundle that are missing in the customer's order items. Determines also the missing quantity. For collections, this means that order items do not include a sufficient number of items that belong to the collection. Not returned when all required bundle items are in the order.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the collection, product, or SKU that is missing in the customer's order items. This is an ID assigned by Voucherify.
|
|
object
string
|
Determines the type of the object that is missing in the customer's order items.
Available values:
product,
products\_collection,
sku
|
|
item\_quantity
integer
|
Quantity of items that are missing in the order items to meet the bundle conditions.
|
|
Category with Stacking Rules Type
Category object with
stacking\_rules\_type
All of:
-
Category
-
| Attributes |
Description |
|
stacking\_rules\_type
string
|
The type of the stacking rule eligibility.
Available values:
JOINT,
EXCLUSIVE
|
Validations Redeemable Skipped Result Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_redeemables\_limit\_exceeded
|
|
message
string
|
Example:
Applicable redeemables limit exceeded
|
Validations Redeemable Skipped Result Category Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_redeemables\_per\_category\_limit\_exceeded
|
|
message
string
|
Example:
Applicable redeemables limit per category exceeded
|
Validations Redeemable Skipped Result Redeemables Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_exclusive\_redeemables\_limit\_exceeded
|
|
message
string
|
Example:
Applicable exclusive redeemables limit exceeded
|
Validations Redeemable Skipped Result Redeemables Category Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_exclusive\_redeemables\_per\_category\_limit\_exceeded
|
|
message
string
|
Example:
Applicable exclusive redeemables limit per category exceeded
|
Validations Redeemable Skipped Result Exclusion Rules Not Met
| Attributes |
Description |
|
key
string
|
Available values:
exclusion\_rules\_not\_met
|
|
message
string
|
Example:
Redeemable cannot be applied due to exclusion rules
|
Validations Redeemable Skipped Result Preceding Validation Failed
| Attributes |
Description |
|
key
string
|
Available values:
preceding\_validation\_failed
|
|
message
string
|
Example:
Redeemable cannot be applied due to preceding validation failure
|
Validations Redeemable Skipped Result No Effect
| Attributes |
Description |
|
key
string
|
Available values:
no\_effect
|
|
message
string
|
Example:
Redeemable cannot be applied due to no effect
|
Simple Customer
| Attributes |
Description |
|
id
string
|
Unique identifier of an existing customer. It is assigned by Voucherify.
|
|
name
string
|
Customer's first and last name.
|
|
email
string
|
Customer's email address.
|
|
source\_id
string
|
A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service.
|
|
metadata
object
|
A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Promotion Tier
| 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. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-02-09T09:20:05.603Z
|
|
name
string
|
Name of the promotion tier.
|
|
banner
string
|
Text to be displayed to your customers on your website.
|
|
action
object
|
Contains details about the discount applied by the promotion tier.
| Attributes |
Description |
|
discount
|
See:
Discount
|
|
|
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.
|
|
promotion\_id
string
|
Promotion unique ID.
|
|
campaign
object
|
Contains details about promotion tier's parent campaign.
| Attributes |
Description |
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
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 the 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.
-
true
indicates an
active
promotion tier
-
false
indicates an
inactive
promotion tier
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
summary
object
|
Contains statistics about promotion tier redemptions and orders.
| Attributes |
Description |
|
redemptions
object
|
Contains statistics about promotion tier redemptions.
| Attributes |
Description |
|
total\_redeemed
integer
|
Number of times the promotion tier was redeemed.
|
|
|
orders
object
|
Contains statistics about orders related to the promotion tier.
| Attributes |
Description |
|
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 the object represented by JSON. This object stores information about the promotion tier.
|
|
validation\_rule\_assignments
|
See:
Validation Rule Assignments List
|
|
category\_id
string
|
Promotion tier category ID.
Example:
cat\_0c9da30e7116ba6bba
|
|
categories
array
|
Array of
Category
|
Redemption Reward Result
| Attributes |
Description |
|
customer
|
Simple Customer
|
|
assignment\_id
string,
null
|
Unique reward assignment ID assigned by Voucherify.
|
|
voucher
|
Voucher
|
|
product
|
Product
|
|
sku
|
SKU Object
|
|
loyalty\_tier\_id
string,
null
|
Unique loyalty tier ID assigned by Voucherify.
|
|
id
string
|
Unique reward ID.
Example:
rew\_0bc92f81a6801f9bca
|
|
name
string
|
Name of the reward.
Example:
Reward Name
|
|
object
string
|
The type of the object represented by the JSON
Available values:
reward
|
|
created\_at
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string
|
Timestamp in ISO 8601 format indicating when the reward was updated.
Example:
2022-10-03T12:24:58.008Z
|
|
parameters
object
|
These are parameters representing a material reward.
| Attributes |
Description |
|
campaign
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Campaign unique ID.
Example:
camp\_13BbZ0kQsNinhqsX3wUts2UP
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
|
|
type
string
|
Defines the type of the campaign.
|
|
|
product
object
|
Defines the product redeemed as a reward.
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
Example:
prod\_0b7d7dfb05cbe5c616
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
Example:
sku\_0a41e31c7b41c28358
|
|
|
coin
object
|
Defines the ratio by mapping the number of loyalty points in
points\_ratio
to a predefined cash amount in
exchange\_ratio.
| Attributes |
Description |
|
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.
|
|
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward.
|
|
type
string
|
Reward type.
Available values:
CAMPAIGN,
COIN,
MATERIAL
|
Voucher Base
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
Gift Card Campaign
|
|
campaign\_id
string
|
Assigned by the Voucherify API, identifies the voucher's parent campaign.
Example:
camp\_FNYR4jhqZBM9xTptxDGgeNBV
|
|
category
string
|
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
|
|
discount
|
See:
Discount
|
|
gift
object
|
Object representing gift parameters. Child attributes are present only if
type
is
GIFT\_VOUCHER.
Defaults to
null.
| Attributes |
Description |
|
amount
integer
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
Example:
10000
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
balance
integer
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
active
boolean,
null
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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
|
See:
Voucher Assets
|
|
is\_referral\_code
boolean,
null
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referring person.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
|
publish
object
|
Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//redemptions
Example:
/v1/vouchers/WVPblOYX/redemptions?page=1\&limit=10
|
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Validation Rule Assignments List
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of validation rule assignments.
|
Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
-
Voucher Base
-
Product
This is an object representing a product.
This entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.
All of:
-
Product without Skus Object
-
SKU Object
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
Example:
sku\_0b1621b319d248b79f
|
|
source\_id
string,
null
|
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,
null
|
Unique user-defined SKU name.
Example:
Large Pink Shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed as
10000.
|
|
currency
string,
null
|
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,
null
|
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. It can be used to create product collections.
|
|
created\_at
string
|
Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:36:30.187Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-17T10:55:09.137Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the
SKU.
Available values:
sku
|
Voucher Assets
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D)
|
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
Product without Skus Object
| Attributes |
Description |
|
id
string
|
Unique product ID assigned by Voucherify.
Example:
prod\_0b1da8105693710357
|
|
source\_id
string,
null
|
Unique product source ID.
Example:
productSourceID16
|
|
name
string,
null
|
Unique user-defined product name.
Example:
T-shirt
|
|
price
integer,
null
|
Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as
\$100.00
being expressed 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. It can be used to create product collections.
|
|
image\_url
string,
null
|
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](https://images.com/original.jpg)
|
|
created\_at
string
|
Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.
Example:
2022-05-23T06:52:55.008Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.
Example:
2022-05-23T09:24:07.405Z
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the product.
Available values:
product
|
Skus List For Product
| Attributes |
Description |
|
object
string
|
The type of the 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
|
|
total
integer
|
Total number of SKUs in the product.
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Add Referral Code Holders
Source: https://docs.voucherify.io/api-reference/referrals/add-referral-code-holders
/openapi/referrals.json post /v1/referrals/members/{memberId}/holders
Adds new holders to a referral code as **referees**. The data sent in the request is upserted into the customer data.
If the request returns an error even for one customer, you have to resend the whole request. Customer data is upserted if the data for all customers is correct.
To use this endpoint, you must have the following permissions:
- Create and modify Customers and Segments (`customers.modify`)
- Publish Voucher (`vouchers.publish`)
To add a holder as a referrer, use the [Create Publication](/api-reference/publications/create-publication) endpoint.
Alternative endpoint
This endpoint is an alternative to the [Add Referral Code Holders endpoint](/api-reference/referrals/add-referral-code-holders-with-campaign-id). The URL was re-designed to retrieve the referral member holders without providing the `campaignId` as a path paremeter.
# Add Referral Code Holders with Campaign ID
Source: https://docs.voucherify.io/api-reference/referrals/add-referral-code-holders-with-campaign-id
/openapi/referrals.json post /v1/referrals/{campaignId}/members/{memberId}/holders
Adds new holders to a referral code as **referees**. The data sent in the request is upserted into the customer data.
If the request returns an error even for one customer, you have to resend the whole request. Customer data is upserted if the data for all customers is correct.
To use this endpoint, you must have the following permissions:
- Create and modify Customers and Segments (`customers.modify`)
- Publish Voucher (`vouchers.publish`)
To add a holder as a referrer, use the [Create Publication](/api-reference/publications/create-publication) endpoint.
# List Referral Code Holders
Source: https://docs.voucherify.io/api-reference/referrals/list-referral-code-holders
/openapi/referrals.json get /v1/referrals/members/{memberId}/holders
Retrieves the holders of the referral code from a referral campaign.
To use this endpoint, you must have the following permissions:
- Read Customers (`customers.details.read`)
Alternative endpoint
This endpoint is an alternative to the [List Member Holders endpoint](/api-reference/referrals/list-referral-code-holders-with-campaign-id). The URL was re-designed to retrieve the referral member holders without providing the `campaignId` as a path paremeter.
# List Referral Code Holders with campaign ID
Source: https://docs.voucherify.io/api-reference/referrals/list-referral-code-holders-with-campaign-id
/openapi/referrals.json get /v1/referrals/{campaignId}/members/{memberId}/holders
Retrieves all the redeemables that have been assigned to the customer.
To use this endpoint, you must have the following permissions:
- Read Customers (`customers.details.read`)
# Remove Referral Card Holder
Source: https://docs.voucherify.io/api-reference/referrals/remove-referral-card-holder
/openapi/referrals.json delete /v1/referrals/members/{memberId}/holders/{holderId}
Removes the holder from a referral card. You can remove a referee only.
To use this endpoint, you must have the following permissions:
- Create and modify Customers and Segments (`customers.modify`)
- Publish Voucher (`vouchers.publish`)
Alternative endpoint
This endpoint is an alternative to the [Remove Referral Card Holder endpoint](/api-reference/referrals/remove-referral-card-holder-with-campaign-id). The URL was re-designed to retrieve the referral member holders without providing the `campaignId` as a path paremeter.
# Remove Referral Card Holder with campaign ID
Source: https://docs.voucherify.io/api-reference/referrals/remove-referral-card-holder-with-campaign-id
/openapi/referrals.json delete /v1/referrals/{campaignId}/members/{memberId}/holders/{holderId}
Removes the holder from a referral card. You can remove a referee only.
To use this endpoint, you must have the following permissions:
- Create and modify Customers and Segments (`customers.modify`)
- Publish Voucher (`vouchers.publish`)
# Activate reward
Source: https://docs.voucherify.io/api-reference/rewards/activate-reward
/openapi/loyalties-v2.json post /v2/loyalties/rewards/{rewardId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the reward to the ACTIVE status. Allowed from DRAFT or INACTIVE status;
other transitions are rejected with a conflict error. This endpoint takes no
request body.
# Create a reward
Source: https://docs.voucherify.io/api-reference/rewards/create-a-reward
/openapi/loyalties-v2.json post /v2/loyalties/rewards
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a new reward. `name`, `type` and `costs` are required. When `type` is
`MATERIAL` the `material` object is required and `digital` must be null; when
`type` is `DIGITAL` the `digital` object is required and `material` must be null.
The reward can be created directly in `DRAFT` (default) or `ACTIVE` status.
When `validity_hours` is not provided it defaults to `{ "type": "ANY_TIME" }`.
# Create Reward
Source: https://docs.voucherify.io/api-reference/rewards/create-reward
/openapi/rewards.json post /v1/rewards
Create a new reward.
# Create Reward Assignment
Source: https://docs.voucherify.io/api-reference/rewards/create-reward-assignment
/openapi/rewards.json post /v1/rewards/{rewardId}/assignments
Assigns a reward to a specified loyalty campaign.
# Deactivate reward
Source: https://docs.voucherify.io/api-reference/rewards/deactivate-reward
/openapi/loyalties-v2.json post /v2/loyalties/rewards/{rewardId}/deactivate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the reward to the INACTIVE status. Allowed only from ACTIVE status;
other transitions are rejected with a conflict error. This endpoint takes no
request body.
# Delete a reward
Source: https://docs.voucherify.io/api-reference/rewards/delete-a-reward
/openapi/loyalties-v2.json delete /v2/loyalties/rewards/{rewardId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Deletes a reward (moves it to the DELETED status). Returns the deleted reward.
# Delete Reward
Source: https://docs.voucherify.io/api-reference/rewards/delete-reward
/openapi/rewards.json delete /v1/rewards/{rewardId}
Delete a reward.
# Delete Reward Assignment
Source: https://docs.voucherify.io/api-reference/rewards/delete-reward-assignment
/openapi/rewards.json delete /v1/rewards/{rewardId}/assignments/{assignmentId}
This method deletes a reward assignment for a particular reward.
# Get Reward
Source: https://docs.voucherify.io/api-reference/rewards/get-reward
/openapi/rewards.json get /v1/rewards/{rewardId}
Retrieve a reward by the reward ID.
# Get Reward Assignment
Source: https://docs.voucherify.io/api-reference/rewards/get-reward-assignment
/openapi/rewards.json get /v1/rewards/{rewardId}/assignments/{assignmentId}
Retrieve a reward assignment.
# Get reward by ID
Source: https://docs.voucherify.io/api-reference/rewards/get-reward-by-id
/openapi/loyalties-v2.json get /v2/loyalties/rewards/{rewardId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single reward by its ID.
# List reward activities
Source: https://docs.voucherify.io/api-reference/rewards/list-reward-activities
/openapi/loyalties-v2.json get /v2/loyalties/rewards/{rewardId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for the given reward
(created, updated, deleted, assigned, unassigned, activated, deactivated, drafted).
Returns `404` when the reward does not exist.
# List Reward Assignments
Source: https://docs.voucherify.io/api-reference/rewards/list-reward-assignments
/openapi/rewards.json get /v1/rewards/{rewardId}/assignments
Retrieve reward assignments by the reward ID.
# List Rewards
Source: https://docs.voucherify.io/api-reference/rewards/list-rewards
/openapi/rewards.json get /v1/rewards
Retrieve rewards.
# List rewards v2
Source: https://docs.voucherify.io/api-reference/rewards/list-rewards-v2
/openapi/loyalties-v2.json get /v2/loyalties/rewards
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of rewards. Results can be filtered by id, name,
type and created_at, and ordered by created_at or name (ascending or descending).
The same field cannot be ordered both ascending and descending at the same time.
# Move reward back to draft
Source: https://docs.voucherify.io/api-reference/rewards/move-reward-back-to-draft
/openapi/loyalties-v2.json post /v2/loyalties/rewards/{rewardId}/draft
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the reward back to the DRAFT status. Allowed only from `ACTIVE` status;
other transitions are rejected with a conflict error. The reward can't be assigned to a loyalty program. This endpoint takes no
request body.
# Reward Assignment Object
Source: https://docs.voucherify.io/api-reference/rewards/reward-assignment-object
Reward Assignment
All of:
-
Reward Assignment Base
-
Digital or Material Reward - Parameters
Reward Assignment Base
| Attributes |
Description |
|
id
string
|
Unique reward assignment ID, assigned by Voucherify.
Example:
rewa\_PbIRoMXpwe5QhobW4JKu0VjH
|
|
reward\_id
string
|
Associated reward ID.
Example:
rew\_C7wS9eHFDN4CIbXI5PpLSkGY
|
|
created\_at
string
|
Timestamp representing the date and time when the reward assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-08-11T14:49:22.586Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the reward assignment was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-11T16:01:34.885Z
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the reward assignment.
Available values:
reward\_assignment
|
|
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.
Available values:
campaign
|
Digital or Material Reward - Parameters
| Attributes |
Description |
|
parameters
object
|
Defines the cost of the reward.
| Attributes |
Description |
|
loyalty
object
|
Defines the equivalent points value of the reward.
| Attributes |
Description |
|
points
integer
|
The number of points required to redeem the reward.
|
|
auto\_redeem
boolean,
null
|
Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value
true
means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value
true.
|
|
|
# Reward Object
Source: https://docs.voucherify.io/api-reference/rewards/reward-object
Reward
| Attributes |
Description |
|
id
string
|
Unique reward ID, assigned by Voucherify.
Example:
rew\_nIy4gHpQHle2c3pNMwuj7G6j
|
|
name
string
|
Reward name.
|
|
stock
integer,
null
|
Configurable for
material rewards.
The number of units of the product that you want to share as a reward. Use this parameter to code a stock-taking logic.
|
|
redeemed
integer,
null
|
Defines the number of already invoked (successful) reward redemptions.
|
|
attributes
object
|
These properties are configurable for
material rewards.
| Attributes |
Description |
|
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.
|
|
|
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.
|
|
type
string
|
Reward type.
Available values:
CAMPAIGN,
COIN,
MATERIAL
|
|
parameters
|
Defines how the reward is generated.
Reward type
|
|
created\_at
string
|
Timestamp representing the date and time when the reward was created. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-08-11T16:01:34.885Z
|
|
object
|
The type of the object represented by the JSON. This object stores information about the reward.
Available values:
reward
|
Reward type
One of:
-
Digital
-
Pay with Points
-
Material
Digital
| Attributes |
Description |
|
campaign
object
|
Objects stores information about the campaign related to the reward.
| Attributes |
Description |
|
id
string
|
Unique campaign ID, assigned by Voucherify.
|
|
balance
integer
|
The number of points to be added to a loyalty card or the amount to be added to the current balance on the gift card.
For gift cards, the value is multiplied by 100 to precisely represent 2 decimal places. For example, \$100 amount is written as 10000.
|
|
type
string
|
Campaign type.
Available values:
DISCOUNT\_COUPONS,
GIFT\_VOUCHERS,
LOYALTY\_PROGRAM
|
|
Pay with Points
| Attributes |
Description |
|
coin
object
|
Defines the ratio by mapping the number of loyalty points in points\_ratio to a predefined cash amount in exchange\_ratio.
| Attributes |
Description |
|
exchange\_ratio
number
|
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
object
|
Contains information about the product given as a reward.
| Attributes |
Description |
|
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
|
|
# Update a reward
Source: https://docs.voucherify.io/api-reference/rewards/update-a-reward
/openapi/loyalties-v2.json put /v2/loyalties/rewards/{rewardId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates an existing reward. When `type` is provided as `MATERIAL` the `material`
object is required and `digital` must be null; when `type` is provided as `DIGITAL`
the `digital` object is required and `material` must be null.
In `DRAFT` status all properties can be updated. In `ACTIVE`/`INACTIVE` status only
the following properties can be updated: `name`, `metadata`, `refunds`,
`validity_hours`, `start_date`, `end_date`, `costs`.
# Update Reward
Source: https://docs.voucherify.io/api-reference/rewards/update-reward
/openapi/rewards.json put /v1/rewards/{rewardId}
Update the details of a reward.
# Update Reward Assignment
Source: https://docs.voucherify.io/api-reference/rewards/update-reward-assignment
/openapi/rewards.json put /v1/rewards/{rewardId}/assignments/{assignmentId}
Update the number of points needed to successfully redeem the reward.
# Create Segment
Source: https://docs.voucherify.io/api-reference/segments/create-segment
/openapi/segments.json post /v1/segments
Create a customer segment.
Limit on static segments
There is a cap on the number of customers that you can assign to a static segment: **20,000**. If you would like to create a bigger segment, then you can use the unlimited `auto-update` or `passive` segment instead and use some customer metadata to build this segment.
Limit on Active and Passive segments
You can create a maximum of 100 passive and active segments.
# Delete Segment
Source: https://docs.voucherify.io/api-reference/segments/delete-segment
/openapi/segments.json delete /v1/segments/{segmentId}
This method deletes a customer segment.
# Get Segment
Source: https://docs.voucherify.io/api-reference/segments/get-segment
/openapi/segments.json get /v1/segments/{segmentId}
Retrieves the segment with a given segment ID.
This method doesn't return the customers that belong to the segment. To return a list of customers who belong to a segment, use [GET List customers](/api-reference/customers/list-customers) endpoint with the `segment_id` query parameter.
# List segments
Source: https://docs.voucherify.io/api-reference/segments/list-segments
/openapi/segments.json get /v1/segments
Retrieves a list of segments.
The list doesn't include the customers that belong to respective segments. To return a list of customers who belong to a segment, use [GET List customers](/api-reference/customers/list-customers) endpoint with the `segment_id` query parameter.
To return a list of different results, use the `filters[created_at][conditions][$before]` and `filters[created_at][conditions][$after]` query parameters as pagination.
# Segment Object
Source: https://docs.voucherify.io/api-reference/segments/segment-object
Segment
| Attributes |
Description |
|
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. The value is shown in the ISO 8601 format.
Example:
2022-05-12T13:01:56.896Z
|
|
updated\_at
string
|
Timestamp in ISO 8601 format indicating when the segment was updated.
Example:
2022-10-03T12:24:58.008Z
|
|
type
string
|
Defines whether the segment is:
-
Active (
auto-update
): customers enter and leave the segment based on the defined filters and the
customer.segment.entered
and
customer.segment.left
events are triggered,
-
Passive (
passive
): customers enter and leave the segment based on the defined filters, but the
customer.segment.entered
and
customer.segment.left
events are not triggered,
-
Static (
static
): manually selected customers.
Available values:
auto-update,
passive,
static
|
|
filter
object,
null
|
Defines a set of criteria for an
auto-update
or
passive
segment type.
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the customer segment.
Available values:
segment
|
# Add Promotion Tier From Template
Source: https://docs.voucherify.io/api-reference/templates/add-promotion-tier-from-template
/openapi/templates.json post /v1/templates/campaigns/{campaignTemplateId}/tier-setup
Creates a promotion tier out of a discount campaign template and adds it to an existing promotion campaign.
To add a promotion tier to a campaign, you need to provide the name in the request and the campaign ID. Other fields are optional. If no other fields are sent, the configuration from the template will be used.
You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an action or an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the promotion tier. When the promotion tier has been created, then you can:
- [Update the validation rule](/api-reference/validation-rules/update-validation-rule),
- [Unassign the validation rule](/api-reference/validation-rules/delete-validation-rule-assignment),
- [Assign an existing validation rule](/api-reference/validation-rules/create-validation-rule-assignment).
Promotion Tiers and Campaign Templates
You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the `DISCOUNT_COUPON` type. You can use this template to create:
- [Discount campaign](/api-reference/templates/create-campaign-from-template)
- [Promotion tier](/api-reference/templates/add-promotion-tier-from-template)
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Create Campaign From Template
Source: https://docs.voucherify.io/api-reference/templates/create-campaign-from-template
/openapi/templates.json post /v1/templates/campaigns/{campaignTemplateId}/campaign-setup
Creates a campaign out of a campaign template.
To create a campaign, you need to provide the name in the request, while other fields are optional. If no other fields are sent, the configuration from the template will be used.
You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the campaign. When the campaign has been created, then you can:
- [Update the validation rule](/api-reference/validation-rules/update-validation-rule),
- [Unassign the validation rule](/api-reference/validation-rules/delete-validation-rule-assignment),
- [Assign an existing validation rule](/api-reference/validation-rules/create-validation-rules-assignments).
Promotion Tiers and Campaign Templates
You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the `DISCOUNT_COUPON` type. You can use this template to create:
- [Discount campaign](/api-reference/templates/create-campaign-from-template)
- [Promotion tier](/api-reference/templates/add-promotion-tier-from-template)
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Create Campaign Template
Source: https://docs.voucherify.io/api-reference/templates/create-campaign-template
/openapi/templates.json post /v1/templates/campaigns
Creates a template for a discount or gift campaign, or a promotion tier.
A template stores campaign configuration **without** the following details:
- Campaign name
- Category
- Code count
The following elements are not supported by campaign templates:
- Redeeming API keys
- Redeeming users
- Customer loyalty tier
- Static segments
Promotion Tiers and Campaign Templates
You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the `DISCOUNT_COUPON` type. You can use this template to create:
- [Discount campaign](/api-reference/templates/create-campaign-from-template),
- [Promotion tier](/api-reference/templates/add-promotion-tier-from-template).
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Delete Campaign Template
Source: https://docs.voucherify.io/api-reference/templates/delete-campaign-template
/openapi/templates.json delete /v1/templates/campaigns/{campaignTemplateId}
Deletes the campaign template permanently.
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Get Campaign Template
Source: https://docs.voucherify.io/api-reference/templates/get-campaign-template
/openapi/templates.json get /v1/templates/campaigns/{campaignTemplateId}
Retrieves a campaign template available in the project.
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# List Campaign Templates
Source: https://docs.voucherify.io/api-reference/templates/list-campaign-templates
/openapi/templates.json get /v1/templates/campaigns
Lists all campaign templates available in the project.
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Update Campaign Template
Source: https://docs.voucherify.io/api-reference/templates/update-campaign-template
/openapi/templates.json put /v1/templates/campaigns/{campaignTemplateId}
Updates the name or description of the campaign template.
Campaign Templates – Documentation
Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
# Activate tier structure
Source: https://docs.voucherify.io/api-reference/tier-structures/activate-tier-structure
/openapi/loyalties-v2.json post /v2/loyalties/tier-structures/{tierStructureId}/activate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the tier structure to the `ACTIVE` status. Allowed state transitions:
`DRAFT` -> `ACTIVE` and `INACTIVE` -> `ACTIVE`. No request body.
# Create tier
Source: https://docs.voucherify.io/api-reference/tier-structures/create-tier
/openapi/loyalties-v2.json post /v2/loyalties/tier-structures/{tierStructureId}/tiers
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a tier within the tier structure. If `downgrade` is omitted it defaults to
`{ "type": "INHERIT" }`. A tier structure can hold at most 10 tiers.
# Create tier structure
Source: https://docs.voucherify.io/api-reference/tier-structures/create-tier-structure
/openapi/loyalties-v2.json post /v2/loyalties/tier-structures
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Creates a new tier structure. Depending on `type`, either
`point_balance` (for `POINT_BALANCE`) or `point_earned` (for `POINT_EARNED`)
is required and the other must be null/omitted. If `expiration` is omitted it
defaults to `{ "type": "NO_RETENTION" }`; if `downgrade` is omitted it defaults
to `{ "type": "NO_DOWNGRADE" }`; if `status` is omitted it defaults to `DRAFT`.
# Deactivate tier structure
Source: https://docs.voucherify.io/api-reference/tier-structures/deactivate-tier-structure
/openapi/loyalties-v2.json post /v2/loyalties/tier-structures/{tierStructureId}/deactivate
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the tier structure to the `INACTIVE` status. Allowed state transition:
`ACTIVE` -> `INACTIVE`. No request body.
# Delete tier
Source: https://docs.voucherify.io/api-reference/tier-structures/delete-tier
/openapi/loyalties-v2.json delete /v2/loyalties/tier-structures/{tierStructureId}/tiers/{tierId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Deletes a tier from the tier structure and returns the deleted resource.
# Delete tier structure
Source: https://docs.voucherify.io/api-reference/tier-structures/delete-tier-structure
/openapi/loyalties-v2.json delete /v2/loyalties/tier-structures/{tierStructureId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Deletes a tier structure and returns the deleted resource.
# Get tier structure
Source: https://docs.voucherify.io/api-reference/tier-structures/get-tier-structure
/openapi/loyalties-v2.json get /v2/loyalties/tier-structures/{tierStructureId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a single tier structure by its id.
# List tier structure activities
Source: https://docs.voucherify.io/api-reference/tier-structures/list-tier-structure-activities
/openapi/loyalties-v2.json get /v2/loyalties/tier-structures/{tierStructureId}/activities
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of activities recorded for the tier structure
(creation, updates, state transitions, assignments, and nested tier changes).
The same field cannot be requested in both ascending and descending order at once.
Default order is `-created_at`.
# List tier structures
Source: https://docs.voucherify.io/api-reference/tier-structures/list-tier-structures
/openapi/loyalties-v2.json get /v2/loyalties/tier-structures
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of tier structures. The same field cannot be
requested in both ascending and descending order at once. Default order is
`-created_at`.
# List tiers
Source: https://docs.voucherify.io/api-reference/tier-structures/list-tiers
/openapi/loyalties-v2.json get /v2/loyalties/tier-structures/{tierStructureId}/tiers
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Returns a cursor-paginated list of tiers belonging to the tier structure. This
endpoint does not support a `filters` parameter. The same field cannot be requested
in both ascending and descending order at once. Default order is `-created_at`.
# Move tier structure to draft
Source: https://docs.voucherify.io/api-reference/tier-structures/move-tier-structure-to-draft
/openapi/loyalties-v2.json post /v2/loyalties/tier-structures/{tierStructureId}/draft
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Moves the tier structure back to the `DRAFT` status. Allowed state transition:
`ACTIVE` -> `DRAFT`. No request body.
# Update tier
Source: https://docs.voucherify.io/api-reference/tier-structures/update-tier
/openapi/loyalties-v2.json put /v2/loyalties/tier-structures/{tierStructureId}/tiers/{tierId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates a tier within the tier structure. All properties are optional. When the
parent tier structure is not in `DRAFT` status, only `name` and `metadata` may be
updated.
# Update tier structure
Source: https://docs.voucherify.io/api-reference/tier-structures/update-tier-structure
/openapi/loyalties-v2.json put /v2/loyalties/tier-structures/{tierStructureId}
Documentation in progress
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.
Updates a tier structure. All properties are optional; provided
values are merged with the existing tier structure. When `type` is provided as
`POINT_EARNED`, `point_earned` is required and `point_balance` must be null; when
`type` is `POINT_BALANCE`, `point_balance` is required and `point_earned` must be null.
When the tier structure is not in `DRAFT` status, only `name` and `metadata` may be
updated; attempting to update other properties results in a validation error.
# Assignment Created
Source: https://docs.voucherify.io/api-reference/validation-rules/assignment-created
openapi-events/events-bus_val_rule.json webhook EVENTS.BUS_VAL_RULE.ASSIGNMENT.CREATED
The `EVENTS.BUS_VAL_RULE.ASSIGNMENT.CREATED` event indicates that a business validation rule has been assigned. A business validation rule can be assigned to a:
* Campaign,
* Voucher code,
* Promotion tier,
* Earning rule,
* Or any other entity that can be associated with a validation rule within Voucherify.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Assignment Deleted
Source: https://docs.voucherify.io/api-reference/validation-rules/assignment-deleted
openapi-events/events-bus_val_rule.json webhook EVENTS.BUS_VAL_RULE.ASSIGNMENT.DELETED
The `EVENTS.BUS_VAL_RULE.ASSIGNMENT.DELETED` event indicates that a business validation rule has been successfully unassigned.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Create Validation Rules
Source: https://docs.voucherify.io/api-reference/validation-rules/create-validation-rules
/openapi/validation-rules.json post /v1/validation-rules
Create a validation rule.
Managing validation rules
It is recommended to [create or update validation rules](/personalize/create-validation-rules) in the Voucherify dashboard. The rule builder in the dashboard helps configuring the desired conditions in a convenient way. The API should not be used as a preferable way to create and manage validation rules.
# Create Validation Rules Assignments
Source: https://docs.voucherify.io/api-reference/validation-rules/create-validation-rules-assignments
/openapi/validation-rules.json post /v1/validation-rules/{validationRuleId}/assignments
Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.
# Created
Source: https://docs.voucherify.io/api-reference/validation-rules/created
openapi-events/events-bus_val_rule.json webhook EVENTS.BUS_VAL_RULE.CREATED
The `EVENTS.BUS_VAL_RULE.CREATED` event indicates that a new business validation rule has been successfully created in Voucherify. This event provides, among others, the following details about the newly created rule:
* ID,
* Conditions,
* Logic.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Delete Validation Rule
Source: https://docs.voucherify.io/api-reference/validation-rules/delete-validation-rule
/openapi/validation-rules.json delete /v1/validation-rules/{validationRuleId}
This method deletes a validation rule.
# Delete Validation Rule Assignment
Source: https://docs.voucherify.io/api-reference/validation-rules/delete-validation-rule-assignment
/openapi/validation-rules.json delete /v1/validation-rules/{validationRuleId}/assignments/{assignmentId}
This method deletes a validation rule assignment.
# Deleted
Source: https://docs.voucherify.io/api-reference/validation-rules/deleted
openapi-events/events-bus_val_rule.json webhook EVENTS.BUS_VAL_RULE.DELETED
The `EVENTS.BUS_VAL_RULE.DELETED` event indicates that a business validation rule has been successfully deleted from Voucherify.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Get Validation Rule
Source: https://docs.voucherify.io/api-reference/validation-rules/get-validation-rule
/openapi/validation-rules.json get /v1/validation-rules/{validationRuleId}
Retrieve the details of a validation rule.
# List Validation Rule Assignments
Source: https://docs.voucherify.io/api-reference/validation-rules/list-validation-rule-assignments
/openapi/validation-rules.json get /v1/validation-rules/{validationRuleId}/assignments
Retrieve validation rule assignments for a specific validation rule.
# List Validation Rules
Source: https://docs.voucherify.io/api-reference/validation-rules/list-validation-rules
/openapi/validation-rules.json get /v1/validation-rules
Retrieve validation rules.
# List Validation Rules' Assignment(s)
Source: https://docs.voucherify.io/api-reference/validation-rules/list-validation-rules-assignments
/openapi/validation-rules.json get /v1/validation-rules-assignments
List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters.
# Update Validation Rule
Source: https://docs.voucherify.io/api-reference/validation-rules/update-validation-rule
/openapi/validation-rules.json put /v1/validation-rules/{validationRuleId}
Update validation rule parameters.
Managing validation rules
It is recommended to [create or update validation rules](/personalize/create-validation-rules) in the Voucherify dashboard. The rule builder in the dashboard helps configuring the desired conditions in a convenient way. The API should not be used as a preferable way to create and manage validation rules.
# Updated
Source: https://docs.voucherify.io/api-reference/validation-rules/updated
openapi-events/events-bus_val_rule.json webhook EVENTS.BUS_VAL_RULE.UPDATED
The `EVENTS.BUS_VAL_RULE.UPDATED` event indicates that an existing business validation rule has been successfully modified. The event provides the details about the business validation rule with the changes included.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Validation Rule Assignment Object
Source: https://docs.voucherify.io/api-reference/validation-rules/validation-rule-assignment-object
Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
Validation rule assignment ID.
Example:
asgm\_74F7QZoYbUoljwQO
|
|
rule\_id
string
|
Validation rule ID.
Example:
val\_4j7DCRm2IS59
|
|
related\_object\_id
string
|
The resource ID to which the validation rule was assigned.
Example:
v\_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
|
|
related\_object\_type
string
|
The type of resource to which the validation rule was assigned.
Available values:
voucher,
campaign,
earning\_rule,
reward\_assignment,
promotion\_tier,
distribution
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
Example:
2022-02-17T08:18:15.085Z
|
|
object
string
|
The type of the object represented by the ID.
Available values:
validation\_rules\_assignment
|
# Validation Rule Object
Source: https://docs.voucherify.io/api-reference/validation-rules/validation-rule-object
Validation Rule
All of:
-
Validation Rule Base
-
Validation Rule
| Attributes |
Description |
|
id
string
|
Unique validation rule ID.
Example:
val\_eR1c41hu0vUU
|
|
created\_at
string
|
Timestamp representing the date and time when the validation rule was created. The value is shown in the 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. The value is shown in the ISO 8601 format.
Example:
2022-04-26T08:35:54.960Z
|
|
assignments\_count
integer
|
The number of instances the validation rule has been assigned to different types of redeemables.
|
|
object
string
|
The type of the object represented by JSON. This object stores information about the validation rule.
|
Validation Rule Base
| Attributes |
Description |
|
name
string
|
Custom, unique name for set of validation rules.
Example:
Business Validation Rule
|
|
rules
|
See:
Validation Rule Rules
|
|
bundle\_rules
|
See:
Validation Rule Bundle Rules
|
|
error
object
|
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.
| Attributes |
Description |
|
message
string
|
The error message returned from API when validation / redemption fails to meet requirements of defined rules.
|
|
|
applicable\_to
object
|
| Attributes |
Description |
|
excluded
array
|
Defines which items are excluded from a discount.
Array of
Applicable To
|
|
included
array
|
Defines which items are included in a discount.
Array of
Applicable To
|
|
included\_all
boolean
|
Indicates whether all items are included in the discount.
|
|
|
type
string
|
Type of validation rule.
Available values:
expression,
basic,
advanced,
complex
|
|
context\_type
string
|
Validation rule context type.
|
Context Type
|
Definition
|
| 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 |
|
| 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 |
|
| distribution.custom\_event |
|
| reward\_assignment.pay\_with\_points |
|
| global |
|
Available values:
earning\_rule.order.paid,
earning\_rule.custom\_event,
earning\_rule.customer.segment.entered,
earning\_rule.customer.tier.joined,
earning\_rule.customer.tier.left,
earning\_rule.customer.tier.upgraded,
earning\_rule.customer.tier.downgraded,
earning\_rule.customer.tier.prolonged,
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.apply\_to\_items\_by\_quantity,
campaign.discount\_coupons.discount.fixed.apply\_to\_items,
campaign.discount\_coupons.discount.percent.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.apply\_to\_items\_by\_quantity,
campaign.referral\_program.discount.fixed.apply\_to\_items,
campaign.referral\_program.discount.percent.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.apply\_to\_items\_by\_quantity,
campaign.promotion.discount.fixed.apply\_to\_items,
campaign.promotion.discount.percent.apply\_to\_items,
campaign.loyalty\_program,
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.apply\_to\_items\_by\_quantity,
voucher.discount\_voucher.discount.fixed.apply\_to\_items,
voucher.discount\_voucher.discount.percent.apply\_to\_items,
voucher.gift\_voucher,
voucher.gift\_voucher.gift.apply\_to\_order,
voucher.gift\_voucher.gift.apply\_to\_items,
voucher.loyalty\_card,
distribution.custom\_event,
distribution.order.paid,
distribution.order.created,
distribution.order.canceled,
distribution.order.updated,
reward\_assignment.pay\_with\_points,
global
|
Validation Rule Rules
| Attributes |
Description |
|
logic
string
|
Defines the logic between the rules.
Example:
(1 and 2) and (3)
|
|
\[propertyName]
object
|
Contains the name of the validation rule.
| Attributes |
Description |
|
name
string
|
Voucherify's specific rule name. Read
Validation rule reference
to learn how specific rules work. The list of available names is provided below.
|
Type
|
Name
|
|
Customer
|
customer.segment
customer.metadata\*
|
|
Order
|
order.amount
order.total\_amount
order.initial\_amount
order.items.count
order.items.price\_any
order.items.price\_each
order.items.metadata\_any
order.items.metadata\_each
order.metadata\*
|
|
Campaign
|
campaign.orders.amount\_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.weekly
campaign.redemptions.count.monthly
campaign.redemptions.customers\_count
campaign.redemptions.customers\_count.daily
campaign.redemptions.customers\_count.weekly
campaign.redemptions.customers\_count.monthly
|
|
Redemption
|
redemption.gift.amount
redemption.count.daily
redemption.count.weekly
redemption.count.monthly
redemption.count.per\_customer
redemption.count.per\_customer.daily
redemption.count.per\_customer.weekly
redemption.count.per\_customer.monthly
redemption.api\_key
redemption.count.per\_api\_key
redemption.user.login
redemption.count.per\_user
redemption.metadata
redemption.reward.pay\_with\_points.points\_used
|
|
Product
|
product.id
product.price
product.quantity
product.discount\_applicable
product.metadata\*
product.metadata.aggregated\_quantity
product.metadata.aggregated\_amount
product.metadata.discount\_applicable
product.metadata.match\_all
|
|
SKU
|
sku.id
sku.price
sku.quantity
sku.discount\_applicable
|
|
Publication
|
publication.redeemable\_by\_linked\_customer |
|
Custom Event
|
custom\_event.metadata\* |
|
Order items
|
order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most\_expensive
|
\*Requires the
property
field to be defined.
|
|
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
|
See:
Validation Rule Conditions
|
|
rules
|
See:
Validation Rule Rules
|
|
error
object
|
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
| Attributes |
Description |
|
message
string
|
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
|
|
|
Validation Rule Bundle Rules
| Attributes |
Description |
|
limit
integer,
null
|
Defines how many bundles can be identified in the order and the maximum multiplier of the discount per identified bundle. For example, if the order meets 3 bundles, but
limit: 2,
the discount will be multiplied by 2.
|
|
\[propertyName]
object
|
Contains the name of the bundle rule.
| Attributes |
Description |
|
name
string
|
Voucherify's specific bundle rule name. Currently, it is only
order.items.any.
Available values:
order.items.any
|
|
conditions
object
|
Defines the conditions of the bundle rule. The order items in the customer's cart must meet the conditions. Because the rule concerns order items, the only permissible condition is
\$is.
| Attributes |
Description |
|
\$is
array
|
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the product, SKU, or collection assigned by Voucherify.
|
|
type
string
|
Type of the order item. It can be a
product\_or\_sku
or
products\_collection
Available values:
product\_or\_sku,
products\_collection
|
|
object
string
|
Object used in the bundle rule. It can be a
products\_collection,
product,
or
sku.
Available values:
products\_collection,
product,
sku
|
|
|
|
rules
|
|
|
error
object
|
CURRENTLY UNSUPPORTED.
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
| Attributes |
Description |
|
message
string
|
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
|
|
|
Applicable To
| Attributes |
Description |
|
object
string
|
This object stores information about the resource to which the discount is applicable.
Available values:
product,
sku,
products\_collection
|
|
id
string
|
Unique product collection, product, or SKU identifier assigned by Voucherify.
|
|
source\_id
string
|
The source identifier from your inventory system.
|
|
product\_id
string
|
Parent product's unique ID assigned by Voucherify.
|
|
product\_source\_id
string
|
Parent product's source ID from your inventory system.
|
|
price
number
|
New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price\_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price.
|
|
price\_formula
number
|
Formula used to dynamically calculate the discounted price of an item.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Applicable To Effect
|
|
quantity\_limit
integer
|
The maximum number of units allowed to be discounted per order line item.
|
|
aggregated\_quantity\_limit
integer
|
The maximum number of units allowed to be discounted combined across all matched order line items.
|
|
amount\_limit
integer
|
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. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:
-
APPLY\_TO\_ITEMS
(each item subtotal is discounted equally)
-
APPLY\_TO\_ITEMS\_BY\_QUANTITY
(each unit of matched products has the same discount value)
|
|
product\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units (product, SKU, collection) that all customers can receive in a given campaign. If a product is selected, the limit covers all discounts across all SKUs belonging to that product. If a product collection is selected, the limit covers all products/SKUs within the collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units (product, SKU, collection) that one customer can receive in a given campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that all customers can receive in a given campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per campaign for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that one customer can receive in a campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units that all customers can receive in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units that one customer can receive in a given promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that all customers can receive in a given promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per promotion tier for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that one customer can receive in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a promotion tier for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
order\_item\_indices
array
|
Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the
order
object in the request. The first order line is assigned
0,
the second order line is assigned
1,
and so on.
|
|
order\_item\_units
array
|
Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the
index
corresponds to the order line sent in the
order
object in the request.
Array of:
| Attributes |
Description |
|
index
integer
|
Number assigned to the order line item in accordance with the order sent in the request.
|
|
units
array
|
Numbers of units in the order line covered by the discount; e.g.
2, 5, 8
for 10 units with the setting
"skip\_initially": 1,
"repeat": 3.
The counting of units starts from
1.
The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but
units\_limit\_exceeded: true.
However, the discount is calculated properly for all relevant units.
|
|
units\_limit\_exceeded
boolean
|
Returned as
true
only when the sum total of
quantity
of all order items exceeds 1000.
|
|
|
repeat
integer
|
Determines the recurrence of the discount, e.g.
"repeat": 3
means that the discount is applied to every third item.
|
|
skip\_initially
integer
|
Determines how many items are skipped before the discount is applied.
|
|
target
string
|
Determines to which kinds of objects the discount is applicable.
ITEM
includes products and SKUs.
UNIT
means particular units within an order line.
Available values:
ITEM,
UNIT
|
Validation Rule Conditions
Validation Rule Rules
| Attributes |
Description |
|
logic
string
|
Defines the logic between the rules.
Example:
(1 and 2) and (3)
|
|
\[propertyName]
object
|
Contains the name of the validation rule.
| Attributes |
Description |
|
name
string
|
Voucherify's specific rule name. Read
Validation rule reference
to learn how specific rules work. The list of available names is provided below.
|
Type
|
Name
|
|
Customer
|
customer.segment
customer.metadata\*
|
|
Order
|
order.amount
order.total\_amount
order.initial\_amount
order.items.count
order.items.price\_any
order.items.price\_each
order.items.metadata\_any
order.items.metadata\_each
order.metadata\*
|
|
Campaign
|
campaign.orders.amount\_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.weekly
campaign.redemptions.count.monthly
campaign.redemptions.customers\_count
campaign.redemptions.customers\_count.daily
campaign.redemptions.customers\_count.weekly
campaign.redemptions.customers\_count.monthly
|
|
Redemption
|
redemption.gift.amount
redemption.count.daily
redemption.count.weekly
redemption.count.monthly
redemption.count.per\_customer
redemption.count.per\_customer.daily
redemption.count.per\_customer.weekly
redemption.count.per\_customer.monthly
redemption.api\_key
redemption.count.per\_api\_key
redemption.user.login
redemption.count.per\_user
redemption.metadata
redemption.reward.pay\_with\_points.points\_used
|
|
Product
|
product.id
product.price
product.quantity
product.discount\_applicable
product.metadata\*
product.metadata.aggregated\_quantity
product.metadata.aggregated\_amount
product.metadata.discount\_applicable
product.metadata.match\_all
|
|
SKU
|
sku.id
sku.price
sku.quantity
sku.discount\_applicable
|
|
Publication
|
publication.redeemable\_by\_linked\_customer |
|
Custom Event
|
custom\_event.metadata\* |
|
Order items
|
order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most\_expensive
|
\*Requires the
property
field to be defined.
|
|
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
|
See:
Validation Rule Conditions
|
|
rules
|
See:
Validation Rule Rules
|
|
error
object
|
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
| Attributes |
Description |
|
message
string
|
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
|
|
|
Applicable To Effect
Available values:
APPLY\_TO\_EVERY,
APPLY\_TO\_CHEAPEST,
APPLY\_FROM\_CHEAPEST,
APPLY\_TO\_MOST\_EXPENSIVE,
APPLY\_FROM\_MOST\_EXPENSIVE
Any
Array any of:
- string
- string
- string
- number
- object
Any
Array any of:
- string
- string
- string
- number
- object
Any String
Any Number
Any Date and Date-Time
Array any of:
- string
- string
Validation Rule Rules
| Attributes |
Description |
|
logic
string
|
Defines the logic between the rules.
Example:
(1 and 2) and (3)
|
|
\[propertyName]
object
|
Contains the name of the validation rule.
| Attributes |
Description |
|
name
string
|
Voucherify's specific rule name. Read
Validation rule reference
to learn how specific rules work. The list of available names is provided below.
|
Type
|
Name
|
|
Customer
|
customer.segment
customer.metadata\*
|
|
Order
|
order.amount
order.total\_amount
order.initial\_amount
order.items.count
order.items.price\_any
order.items.price\_each
order.items.metadata\_any
order.items.metadata\_each
order.metadata\*
|
|
Campaign
|
campaign.orders.amount\_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.weekly
campaign.redemptions.count.monthly
campaign.redemptions.customers\_count
campaign.redemptions.customers\_count.daily
campaign.redemptions.customers\_count.weekly
campaign.redemptions.customers\_count.monthly
|
|
Redemption
|
redemption.gift.amount
redemption.count.daily
redemption.count.weekly
redemption.count.monthly
redemption.count.per\_customer
redemption.count.per\_customer.daily
redemption.count.per\_customer.weekly
redemption.count.per\_customer.monthly
redemption.api\_key
redemption.count.per\_api\_key
redemption.user.login
redemption.count.per\_user
redemption.metadata
redemption.reward.pay\_with\_points.points\_used
|
|
Product
|
product.id
product.price
product.quantity
product.discount\_applicable
product.metadata\*
product.metadata.aggregated\_quantity
product.metadata.aggregated\_amount
product.metadata.discount\_applicable
product.metadata.match\_all
|
|
SKU
|
sku.id
sku.price
sku.quantity
sku.discount\_applicable
|
|
Publication
|
publication.redeemable\_by\_linked\_customer |
|
Custom Event
|
custom\_event.metadata\* |
|
Order items
|
order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most\_expensive
|
\*Requires the
property
field to be defined.
|
|
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
|
See:
Validation Rule Conditions
|
|
rules
|
See:
Validation Rule Rules
|
|
error
object
|
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
| Attributes |
Description |
|
message
string
|
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
|
|
|
Validation Rule Rules
| Attributes |
Description |
|
logic
string
|
Defines the logic between the rules.
Example:
(1 and 2) and (3)
|
|
\[propertyName]
object
|
Contains the name of the validation rule.
| Attributes |
Description |
|
name
string
|
Voucherify's specific rule name. Read
Validation rule reference
to learn how specific rules work. The list of available names is provided below.
|
Type
|
Name
|
|
Customer
|
customer.segment
customer.metadata\*
|
|
Order
|
order.amount
order.total\_amount
order.initial\_amount
order.items.count
order.items.price\_any
order.items.price\_each
order.items.metadata\_any
order.items.metadata\_each
order.metadata\*
|
|
Campaign
|
campaign.orders.amount\_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.weekly
campaign.redemptions.count.monthly
campaign.redemptions.customers\_count
campaign.redemptions.customers\_count.daily
campaign.redemptions.customers\_count.weekly
campaign.redemptions.customers\_count.monthly
|
|
Redemption
|
redemption.gift.amount
redemption.count.daily
redemption.count.weekly
redemption.count.monthly
redemption.count.per\_customer
redemption.count.per\_customer.daily
redemption.count.per\_customer.weekly
redemption.count.per\_customer.monthly
redemption.api\_key
redemption.count.per\_api\_key
redemption.user.login
redemption.count.per\_user
redemption.metadata
redemption.reward.pay\_with\_points.points\_used
|
|
Product
|
product.id
product.price
product.quantity
product.discount\_applicable
product.metadata\*
product.metadata.aggregated\_quantity
product.metadata.aggregated\_amount
product.metadata.discount\_applicable
product.metadata.match\_all
|
|
SKU
|
sku.id
sku.price
sku.quantity
sku.discount\_applicable
|
|
Publication
|
publication.redeemable\_by\_linked\_customer |
|
Custom Event
|
custom\_event.metadata\* |
|
Order items
|
order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most\_expensive
|
\*Requires the
property
field to be defined.
|
|
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
|
See:
Validation Rule Conditions
|
|
rules
object
|
Another set of validation rules. If you need to create complex rules with more nested rules, use the validation rule builder in the dashboard.
|
|
error
object
|
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
| Attributes |
Description |
|
message
string
|
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
|
|
|
# Validate Promotion Tier
Source: https://docs.voucherify.io/api-reference/validations/validate-promotion-tier
/openapi/validations.json post /v1/promotions/tiers/{tierId}/validation
Deprecated
This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/validations/validate-stackable-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To verify whether the promotion tier discount can be applied to an order. This method is designed for server side integration which means that it is accessible only through private keys.
# Validate Promotions
Source: https://docs.voucherify.io/api-reference/validations/validate-promotions
/openapi/validations.json post /v1/promotions/validation
Deprecated
This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](/api-reference/qualifications/check-eligibility) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
Limitation
Only the first 150 most recent promotion tiers are checked for eligibility. Older promotion tiers are ignored and not returned.
Use this method to get valid promotions for a given customer and order.
### Advanced validation filters
You can narrow down a validation to a specific promotion ID or tier metadata.
# Validate Stackable Discounts
Source: https://docs.voucherify.io/api-reference/validations/validate-stackable-discounts
/openapi/validations.json post /v1/validations
Verify redeemables provided in the request. This method is designed for server side integration which means that it is accessible only through private keys.
API keys with a Merchant role can't use this endpoint.
# Validate Voucher
Source: https://docs.voucherify.io/api-reference/validations/validate-voucher
/openapi/validations.json post /v1/vouchers/{code}/validate
Deprecated
This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/validations/validate-stackable-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys.
Important
This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the [Stackable discounts API](/api-reference/validations/validate-stackable-discounts). The stacking discounts API lets you validate up to 30 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.
#### Gift Vouchers - validate Gift Card and control amount to redeem
Voucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.
This operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.
If a validation session is established, then the session details will be returned as well. Read more about sessions [here](/guides/locking-validation-session).
Voucher validation might fail because of one of these reasons:
* `voucher not found` - voucher doesn't exist or was [deleted](/api-reference/vouchers/delete-voucher)
* `voucher expired` - voucher is out of start date - expiration date time frame
* `voucher is disabled` - learn more about a [disabled voucher](/api-reference/vouchers/disable-voucher)
* `customer does not match segment rules` - learn more [customer tracking](/api-reference/customers/customer-object)
* `order does not match validation rules` - learn more about [validation rules](/api-reference/validation-rules/validation-rule-object)
# Validation Object
Source: https://docs.voucherify.io/api-reference/validations/validation-object
Validations Validate Response Body
| Attributes |
Description |
|
id
string
|
Unique identifier of the validation, assigned by Voucherify.
Example:
valid\_101740aa2869354c6d
|
|
valid
boolean
|
The result of the validation. It takes all of the redeemables into account and returns a
false
if at least one redeemable is inapplicable. Returns
true
if all redeemables are applicable.
|
|
redeemables
array
|
Lists validation results of each redeemable. If
redeemables\_application\_mode
is
PARTIAL
in the
stacking\_rules
object, all redeemables here will be
APPLICABLE.
Read more in
the Stacking rules article.
Array any of:
-
Applicable Redeemable
-
Inapplicable Redeemable
-
Skipped Redeemable
|
|
skipped\_redeemables
array
|
Lists validation results of each skipped redeemable.
|
|
inapplicable\_redeemables
array
|
Lists validation results of each inapplicable redeemable.
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
|
|
|
tracking\_id
string
|
Hashed customer source ID.
Example:
track\_VAVo1/z+G2GI2LPw==
|
|
session
|
See:
Session
|
|
stacking\_rules
|
Defines stacking rules for redeemables. Read more in the
Stacking Rule Documentation.
Stacking Rules
|
Applicable Redeemable
| Attributes |
Description |
|
status
string
|
Indicates whether the redeemable can be applied or not applied based on the validation rules.
Available values:
APPLICABLE
|
|
id
string
|
Redeemable ID, i.e. the voucher code.
|
|
object
string
|
Redeemable's object type.
Available values:
voucher,
promotion\_tier
|
|
order
|
All of:
-
Order Calculated No Customer Data
-
| Attributes |
Description |
|
items
array
|
Array of items applied to the order. It can include up to 500 items.
Array of
Order Item Calculated
|
|
|
applicable\_to
|
See:
Applicable To Result List
|
|
inapplicable\_to
|
See:
Inapplicable To Result List
|
|
result
|
Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.
One of:
-
Coupon Code
-
Gift Card
-
Loyalty Card
-
Promotion Tier
-
Promotion Stack
|
|
metadata
object
|
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.
|
|
categories
array
|
Array of
Category with Stacking Rules Type
|
|
campaign\_name
string
|
Campaign name. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
|
campaign\_id
string
|
Unique campaign ID assigned by Voucherify. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
Example:
camp\_pqZjuhG6Mgtp4GD0zD7b8hA3
|
|
name
string
|
Name of the promotion tier. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
Inapplicable Redeemable
| Attributes |
Description |
|
status
string
|
Indicates whether the redeemable can be applied or not applied based on the validation rules.
Available values:
INAPPLICABLE
|
|
id
string
|
Redeemable ID, i.e. the voucher code.
|
|
object
string
|
Redeemable's object type.
Available values:
voucher,
promotion\_tier
|
|
result
object
|
Includes the error object with details about the reason why the redeemable is inapplicable
| Attributes |
Description |
|
error
|
See:
Error Object
|
|
details
object
|
Provides details about the reason why the redeemable is inapplicable.
| Attributes |
Description |
|
message
string
|
Generic message from the
message
string shown in the
error
object or the message configured in a validation rule.
|
|
key
string
|
Generic message from the
key
string shown in the
error
object.
|
|
|
bundle
|
See:
Bundle Details
|
|
|
metadata
object
|
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.
|
|
categories
array
|
Array of
Category with Stacking Rules Type
|
|
campaign\_name
string
|
Campaign name. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
|
campaign\_id
string
|
Unique campaign ID assigned by Voucherify. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
Example:
camp\_pqZjuhG6Mgtp4GD0zD7b8hA3
|
|
name
string
|
Name of the promotion tier. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
Skipped Redeemable
| Attributes |
Description |
|
status
string
|
Indicates whether the redeemable can be applied or not applied based on the validation rules.
Available values:
SKIPPED
|
|
id
string
|
Redeemable ID, i.e. the voucher code.
|
|
object
string
|
Redeemable's object type.
Available values:
voucher,
promotion\_tier
|
|
result
object
|
Provides details about the reason why the redeemable is skipped.
|
|
metadata
object
|
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.
|
|
categories
array
|
Array of
Category with Stacking Rules Type
|
|
campaign\_name
string
|
Campaign name. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
|
campaign\_id
string
|
Unique campaign ID assigned by Voucherify. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
Example:
camp\_pqZjuhG6Mgtp4GD0zD7b8hA3
|
|
name
string
|
Name of the promotion tier. Displayed only if the
options.expand
is passed with a
redeemable
value in the validation request body.
|
Order Calculated No Customer Data
| Attributes |
Description |
|
id
string
|
Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request.
|
|
source\_id
string,
null
|
Unique source ID of an existing order that will be linked to the redemption of this request.
|
|
status
string
|
The order status.
Available values:
CREATED,
PAID,
CANCELED,
FULFILLED
|
|
amount
integer
|
This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
initial\_amount
integer
|
This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
discount\_amount
integer
|
Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_discount\_amount
integer
|
Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
total\_amount
integer
|
Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
items\_applied\_discount\_amount
integer
|
Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
sum(items, i =>i.applied\_discount\_amount)
|
|
total\_applied\_discount\_amount
integer
|
Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for \$1.00).
total\_applied\_discount\_amount
\=
applied\_discount\_amount
\+
items\_applied\_discount\_amount
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order
|
|
created\_at
string
|
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
Example:
2021-12-22T10:13:06.487Z
|
|
updated\_at
string,
null
|
Timestamp representing the date and time when the order was last updated in ISO 8601 format.
Example:
2021-12-22T10:14:45.316Z
|
|
customer\_id
string,
null
|
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
Example:
cust\_7iUa6ICKyU6gH40dBU25kQU1
|
|
referrer\_id
string,
null
|
Unique referrer ID.
Example:
cust\_nM4jqPiaXUvQdVSA6vTRUnix
|
|
customer
|
Customer Id
|
|
referrer
|
Referrer Id
|
|
redemptions
object
|
|
Session
| Attributes |
Description |
|
key
string
|
The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.
|
|
type
string
|
This parameter is required to establish a new session.
Available values:
LOCK
|
|
ttl
number
|
Value for the period of time that the session is active. Units for this parameter are defined by the session.ttl\_unit parameter.
|
|
ttl\_unit
string
|
Defines the type of unit in which the session time is counted.
Available values:
DAYS,
HOURS,
MICROSECONDS,
MILLISECONDS,
MINUTES,
NANOSECONDS,
SECONDS
|
Stacking Rules
| Attributes |
Description |
|
redeemables\_limit
integer
|
Defines how many redeemables can be sent in one request. Note: more redeemables means more processing time.
|
|
applicable\_redeemables\_limit
integer
|
Defines how many redeemables can be applied in one request. The number must be less than or equal to
redeemables\_limit.
For example, a user can select 30 discounts but only 5 will be applied to the order and the remaining will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
applicable\_redeemables\_per\_category\_limit
integer
|
Defines how many redeemables with the same category can be applied in one request. The number must be less than or equal to
applicable\_redeemables\_limit.
The ones above the limit will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
applicable\_redeemables\_category\_limits
object
|
Lists categories by category IDs (keys) and defines their limits (values) of applicable redeemables that belong to campaigns with that category.
| Attributes |
Description |
|
\[propertyName]
integer
|
Limit of applicable redeemables per category.
|
|
|
applicable\_exclusive\_redeemables\_limit
integer
|
Defines how many redeemables with an assigned exclusive category can be applied in one request. The ones above the limit will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
applicable\_exclusive\_redeemables\_per\_category\_limit
integer
|
Defines how many redeemables with an exclusive category per category in stacking rules can be applied in one request. The ones above the limit will be
SKIPPED
according to the
redeemables\_sorting\_rule.
|
|
exclusive\_categories
array
|
Lists the IDs of exclusive categories. A redeemable from a campaign with an exclusive category is the only redeemable to be redeemed when applied with redeemables from other campaigns unless these campaigns are exclusive or joint.
|
|
joint\_categories
array
|
Lists the IDs of the joint categories. A campaign with a joint category is always applied regardless of the exclusivity of other campaigns.
|
|
redeemables\_application\_mode
string
|
Defines the application mode for redeemables.
"ALL"
means that all redeemables must be validated for the redemption to be successful.
"PARTIAL"
means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.
Available values:
ALL,
PARTIAL
|
|
redeemables\_sorting\_rule
string
|
Defines redeemables sorting rule.
CATEGORY\_HIERARCHY
means that redeemables are applied oaccording to the category priority.
REQUESTED\_ORDER
means that redeemables are applied in the sequence provided in the request.
Available values:
CATEGORY\_HIERARCHY,
REQUESTED\_ORDER
|
|
redeemables\_products\_application\_mode
string
|
Defines redeemables products application mode.
STACK
means that multiple discounts can be applied to a product.
ONCE
means that only one discount can be applied to the same product.
Available values:
STACK,
ONCE
|
|
redeemables\_no\_effect\_rule
string
|
Defines redeemables no effect rule.
REDEEM\_ANYWAY
means that the redeemable will be redeemed regardless of any restrictions or conditions in place.
SKIP
means that the redeemable will be processed only when an applicable effect is calculated.
Available values:
REDEEM\_ANYWAY,
SKIP
|
|
no\_effect\_skip\_categories
array
|
Lists category IDs. Redeemables with a given category are skipped even if the
redeemables\_no\_effect\_rule
is set to
REDEEM\_ANYWAY.
Category IDs can't overlap with the IDs in
no\_effect\_redeem\_anyway\_categories.
|
|
no\_effect\_redeem\_anyway\_categories
array
|
Lists category IDs. Redeemables with a given category are redeemed anyway even if the
redeemables\_no\_effect\_rule
is set to
SKIP.
Category IDs can't overlap with the IDs in
no\_effect\_skip\_categories.
|
|
redeemables\_rollback\_order\_mode
string
|
Defines the rollback mode for the order.
WITH\_ORDER
is a default setting. The redemption is rolled back together with the data about the order, including related discount values.
WITHOUT\_ORDER
allows rolling the redemption back without affecting order data, including the applied discount values.
Available values:
WITH\_ORDER,
WITHOUT\_ORDER
|
Order Item Calculated
| Attributes |
Description |
|
id
string
|
Unique identifier of the order line item.
|
|
sku\_id
string
|
Unique identifier of the SKU. It is assigned by Voucherify.
|
|
product\_id
string
|
Unique identifier of the product. It is assigned by Voucherify.
|
|
related\_object
string
|
Used along with the source\_id property, can be set to either sku or product.
Available values:
product,
sku
|
|
source\_id
string
|
The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
|
|
quantity
integer
|
The quantity of the particular item in the cart.
|
|
discount\_quantity
integer
|
Number of dicounted items.
|
|
initial\_quantity
integer
|
A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity.
|
|
amount
integer
|
The total amount of the order item (price \* quantity).
|
|
discount\_amount
integer
|
Sum of all order-item-level discounts applied to the order.
|
|
applied\_discount\_amount
integer
|
This field shows the order-level discount applied.
|
|
applied\_discount\_quantity
integer
|
Number of the discounted items applied in the transaction.
|
|
applied\_quantity
integer
|
Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
applied\_quantity\_amount
integer
|
Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced.
|
|
initial\_amount
integer
|
A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00) representing the total amount of the order. This is the sum of the order items' amounts.
|
|
price
integer
|
Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
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
\-
applied\_discount\_amount
|
|
product
object
|
An object containing details of the related product.
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the product and is assigned by Voucherify.
|
|
source\_id
string
|
The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
|
|
override
boolean
|
The override set to
true
is used to store the product information in the system. If the product does not exist, it will be created with a source\_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
|
|
name
string
|
Product name.
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections.
|
|
price
number
|
Product price. A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
|
sku
object
|
An object containing details of the related SKU.
| Attributes |
Description |
|
id
string
|
A unique identifier that represents the SKU and is assigned by Voucherify.
|
|
source\_id
string
|
The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.
|
|
override
boolean
|
The override set to
true
is used to store the product information in the system. If the product does not exist, it will be created with a source\_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.
|
|
sku
string
|
The SKU name.
|
|
price
number
|
SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for \$1.00).
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections.
|
|
|
object
string
|
The type of the object represented by JSON.
Available values:
order\_item
|
|
metadata
object
|
A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas.
|
Applicable To Result List
| Attributes |
Description |
|
data
array
|
Contains array of items to which the discount can apply.
Array of
Applicable To
|
|
total
integer
|
Total number of objects defining included products, SKUs, or product collections.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
list
|
|
data\_ref
string
|
The type of the object represented by JSON.
Available values:
data
|
Inapplicable To Result List
| Attributes |
Description |
|
data
array
|
Contains array of items to which the discount cannot apply.
Array of
Inapplicable To
|
|
total
integer
|
Total number of objects defining included products, SKUs, or product collections.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
list
|
|
data\_ref
string
|
The type of the object represented by JSON.
Available values:
data
|
Coupon Code
Gift Card
| Attributes |
Description |
|
gift
object
|
Stores the amount of gift card credits to be applied.
| Attributes |
Description |
|
balance
integer
|
Available funds at the moment of validation. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
credits
integer
|
Total number of gift card credits to be applied. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
Loyalty Card
| Attributes |
Description |
|
loyalty\_card
object
|
Stores the amount of loyalty card points to be applied in the redemption.
| Attributes |
Description |
|
points
integer
|
Total number of loyalty points to be applied in the redemption.
|
|
Promotion Tier
Promotion Stack
Category with Stacking Rules Type
Category object with
stacking\_rules\_type
All of:
-
Category
-
| Attributes |
Description |
|
stacking\_rules\_type
string
|
The type of the stacking rule eligibility.
Available values:
JOINT,
EXCLUSIVE
|
Error Object
| Attributes |
Description |
|
code
integer
|
Error's HTTP status code.
|
|
key
string
|
Short string describing the kind of error which occurred.
|
|
message
string
|
A human-readable message providing a short description of the error.
|
|
details
string
|
A human-readable message providing more details about the error.
|
|
request\_id
string
|
This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team.
Example:
v-0a885062c80375740f
|
|
resource\_id
string
|
Unique resource ID that can be used in another endpoint to get more details.
Example:
rf\_0c5d710a87c8a31f86
|
|
resource\_type
string
|
The resource type.
Example:
voucher
|
|
error
object
|
Includes additional information about the error.
| Attributes |
Description |
|
message
string
|
The message configured by the user in a validation rule.
|
|
Bundle Details
| Attributes |
Description |
|
quantity
integer
|
Determines how many bundles are qualified. If there are missing bundle products, the value is
0.
If the bundle is qualified, the value is
1.
The maximum number of identified bundles can equal the number set in
limit.
Also defines the multiplier of the discount for
AMOUNT,
PERCENT,
and
UNIT
discount types. To inform end-customers that more products can be added to meet additional bundles, compare this parameter with
limit.
|
|
limit
integer
|
Determines the maximum number of identified bundles. This also defines the maximum multiplier of the bundle discount.
|
|
identified
array
|
Determines products from the customer's order items that meet bundle conditions. SKUs meet the conditions for their product that is used in the bundle. Returns only the products and their quantity that meet the bundle.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the product or SKU that meets the bundle condition. This is an ID assigned by Voucherify.
|
|
object
string
|
Determines the type of the object that meets the bundle condition.
Available values:
product,
sku
|
|
item\_index
integer
|
Number assigned to the order line item in accordance with the order sent in the request. It starts with
0
for the first order line item in the request.
|
|
item\_quantity
integer
|
Quantity of items that meet the bundle conditions. If the quantity in the order is higher than the quantity required by the bundle, this returns only the number that meets the bundle. For example, if the bundle requires
5
coffees, but the order includes
10
coffees,
item\_quantity
returns
5.
|
|
|
missing
array
|
Determines products, SKUs, or collections from the bundle that are missing in the customer's order items. Determines also the missing quantity. For collections, this means that order items do not include a sufficient number of items that belong to the collection. Not returned when all required bundle items are in the order.
Array of:
| Attributes |
Description |
|
id
string
|
Unique identifier of the collection, product, or SKU that is missing in the customer's order items. This is an ID assigned by Voucherify.
|
|
object
string
|
Determines the type of the object that is missing in the customer's order items.
Available values:
product,
products\_collection,
sku
|
|
item\_quantity
integer
|
Quantity of items that are missing in the order items to meet the bundle conditions.
|
|
Validations Redeemable Skipped Result Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_redeemables\_limit\_exceeded
|
|
message
string
|
Example:
Applicable redeemables limit exceeded
|
Validations Redeemable Skipped Result Category Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_redeemables\_per\_category\_limit\_exceeded
|
|
message
string
|
Example:
Applicable redeemables limit per category exceeded
|
Validations Redeemable Skipped Result Redeemables Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_exclusive\_redeemables\_limit\_exceeded
|
|
message
string
|
Example:
Applicable exclusive redeemables limit exceeded
|
Validations Redeemable Skipped Result Redeemables Category Limit Exceeded
| Attributes |
Description |
|
key
string
|
Available values:
applicable\_exclusive\_redeemables\_per\_category\_limit\_exceeded
|
|
message
string
|
Example:
Applicable exclusive redeemables limit per category exceeded
|
Validations Redeemable Skipped Result Exclusion Rules Not Met
| Attributes |
Description |
|
key
string
|
Available values:
exclusion\_rules\_not\_met
|
|
message
string
|
Example:
Redeemable cannot be applied due to exclusion rules
|
Validations Redeemable Skipped Result Preceding Validation Failed
| Attributes |
Description |
|
key
string
|
Available values:
preceding\_validation\_failed
|
|
message
string
|
Example:
Redeemable cannot be applied due to preceding validation failure
|
Validations Redeemable Skipped Result No Effect
| Attributes |
Description |
|
key
string
|
Available values:
no\_effect
|
|
message
string
|
Example:
Redeemable cannot be applied due to no effect
|
Customer Id
| Attributes |
Description |
|
id
string
|
A unique identifier of an existing customer.
|
|
object
string
|
The type of the object represented by JSON.
Available values:
customer
|
Referrer Id
Customer Id
Order Redemptions
| Attributes |
Description |
|
date
string
|
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
Example:
2022-09-02T17:06:56.649Z
|
|
rollback\_id
string
|
Unique ID of the redemption rollback.
Example:
rr\_0c63c84eb78ee0a6c0
|
|
rollback\_date
string
|
Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.
Example:
2023-01-31T14:18:37.150Z
|
|
related\_object\_type
string
|
The source of the incentive.
|
|
related\_object\_id
string
|
Unique ID of the parent redemption.
Example:
r\_0ba186c4824e4881e1
|
|
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
array
|
Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.
|
|
rollback\_stacked
array
|
Lists the rollback redemption IDs of the particular child redemptions.
|
Applicable To
| Attributes |
Description |
|
object
string
|
This object stores information about the resource to which the discount is applicable.
Available values:
product,
sku,
products\_collection
|
|
id
string
|
Unique product collection, product, or SKU identifier assigned by Voucherify.
|
|
source\_id
string
|
The source identifier from your inventory system.
|
|
product\_id
string
|
Parent product's unique ID assigned by Voucherify.
|
|
product\_source\_id
string
|
Parent product's source ID from your inventory system.
|
|
price
number
|
New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price\_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price.
|
|
price\_formula
number
|
Formula used to dynamically calculate the discounted price of an item.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Applicable To Effect
|
|
quantity\_limit
integer
|
The maximum number of units allowed to be discounted per order line item.
|
|
aggregated\_quantity\_limit
integer
|
The maximum number of units allowed to be discounted combined across all matched order line items.
|
|
amount\_limit
integer
|
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. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:
-
APPLY\_TO\_ITEMS
(each item subtotal is discounted equally)
-
APPLY\_TO\_ITEMS\_BY\_QUANTITY
(each unit of matched products has the same discount value)
|
|
product\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units (product, SKU, collection) that all customers can receive in a given campaign. If a product is selected, the limit covers all discounts across all SKUs belonging to that product. If a product collection is selected, the limit covers all products/SKUs within the collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units (product, SKU, collection) that one customer can receive in a given campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that all customers can receive in a given campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per campaign for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_campaign\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that one customer can receive in a campaign.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_campaign\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units that all customers can receive in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units that one customer can receive in a given promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_customer\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that all customers can receive in a given promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per promotion tier for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_promotion\_tier\_quantity\_limit
integer
|
Limits the number of discounted item units of a given product in a collection that one customer can receive in a promotion tier.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
product\_in\_collection\_customer\_promotion\_tier\_quantity\_limit\_formula
string
|
Formula used to dynamically calculate the maximum units per customer in a promotion tier for a product in a collection.
This limit is available on demand as part of campaign budget limits. Contact
Voucherify support
or your account manager to learn more.
|
|
order\_item\_indices
array
|
Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the
order
object in the request. The first order line is assigned
0,
the second order line is assigned
1,
and so on.
|
|
order\_item\_units
array
|
Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the
index
corresponds to the order line sent in the
order
object in the request.
Array of:
| Attributes |
Description |
|
index
integer
|
Number assigned to the order line item in accordance with the order sent in the request.
|
|
units
array
|
Numbers of units in the order line covered by the discount; e.g.
2, 5, 8
for 10 units with the setting
"skip\_initially": 1,
"repeat": 3.
The counting of units starts from
1.
The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but
units\_limit\_exceeded: true.
However, the discount is calculated properly for all relevant units.
|
|
units\_limit\_exceeded
boolean
|
Returned as
true
only when the sum total of
quantity
of all order items exceeds 1000.
|
|
|
repeat
integer
|
Determines the recurrence of the discount, e.g.
"repeat": 3
means that the discount is applied to every third item.
|
|
skip\_initially
integer
|
Determines how many items are skipped before the discount is applied.
|
|
target
string
|
Determines to which kinds of objects the discount is applicable.
ITEM
includes products and SKUs.
UNIT
means particular units within an order line.
Available values:
ITEM,
UNIT
|
Inapplicable To
Applicable To
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Applicable To Effect
Available values:
APPLY\_TO\_EVERY,
APPLY\_TO\_CHEAPEST,
APPLY\_FROM\_CHEAPEST,
APPLY\_TO\_MOST\_EXPENSIVE,
APPLY\_FROM\_MOST\_EXPENSIVE
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# API versioning
Source: https://docs.voucherify.io/api-reference/versioning
What is the latest API version?
When we make **backwards-incompatible** changes to the API, we release new, dated versions. The current version is `v2018-08-01`. Read our API [changelog](/guides/api-overview#manage-api-versions) to learn more about Voucherify API versions. The changelog lists every available version.
All requests will use the API version listed in your account **Project settings** unless you override the API version.
To set the API version for a specific request, send a `X-Voucherify-API-Version` header.
```cURL Example Request theme={null}
curl -X GET \
-H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \
-H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \
-H "Content-Type: application/json" \
-H "X-Voucherify-API-Version: v2018-08-01" \
https://api.voucherify.io/v1/vouchers/VoucherCode
```
## API upgrades
Keep track of changes and [upgrades to the Voucherify API](/guides/api-overview#manage-api-versions). If you need help, talk to [support](https://www.voucherify.io/contact-support) or write to us on our [Slack channel](https://www.voucherify.io/community).
# Created
Source: https://docs.voucherify.io/api-reference/voucher/created
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.CREATED
The `EVENTS.VOUCHER.CREATED` event indicates that a new voucher has been successfully created in Voucherify. It informs other systems or applications about the addition of a new voucher. The `VOUCHER.CREATED` webhook is sent only when a single voucher is created. When vouchers are created in bulk, this action does not trigger the webhook.
The webhook provides, among others, the following details:
* URLs to the voucher's assets, such as QR code and barcode images,
* Associated campaign and its type,
* Expiration date.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Deleted
Source: https://docs.voucherify.io/api-reference/voucher/deleted
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.DELETED
The `EVENTS.VOUCHER.DELETED` event indicates that a voucher has been successfully deleted. It provides a real-time notification that the voucher has been removed.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Disabled
Source: https://docs.voucherify.io/api-reference/voucher/disabled
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.DISABLED
The `EVENTS.VOUCHER.DISABLED` event indicates that a voucher has been successfully disabled for use. It indicates that the voucher is now inactive and it cannot be redeemed.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Enabled
Source: https://docs.voucherify.io/api-reference/voucher/enabled
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.ENABLED
The `EVENTS.VOUCHER.ENABLED` event indicates that a voucher has been successfully enabled for use. It indicates that the voucher is now active and it can be redeemed.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Gift Balance Added
Source: https://docs.voucherify.io/api-reference/voucher/gift-balance-added
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.GIFT.BALANCE_ADDED
The `EVENTS.VOUCHER.GIFT.BALANCE_ADDED` event indicates that additional balance has been successfully added to a gift voucher. It provides real-time notification that the gift voucher's balance has been increased.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Gift Transaction Created
Source: https://docs.voucherify.io/api-reference/voucher/gift-transaction-created
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.GIFT.TRANSACTION.CREATED
The `EVENTS.VOUCHER.GIFT.TRANSACTION.CREATED` event indicates that a transaction has been created for a gift voucher. It provides real-time notification that the gift voucher's balance has been increased.
The following transaction types trigger the event:
* `CREDITS_ADDITION`
* `CREDITS_REMOVAL`
* `CREDITS_REFUND`
* `CREDITS_REDEMPTION`
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Pending Points Activated
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-pending-points-activated
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ACTIVATED
The `EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ACTIVATED` event indicates that loyalty pending points have been successfully activated and added to a customer's loyalty card associated with a voucher. The pending points can be activated automatically after a predefined time set in days or manually with the [**POST** Activate Member Pending Points](api-reference/loyalties/activate-member-pending-points) endpoint.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Pending Points Added
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-pending-points-added
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ADDED
The `EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.ADDED` event indicates that loyalty pending points have been successfully added to a customer's loyalty card associated with a voucher. The pending points activate automatically after a predefined time set in days or they can be activated manually with the [**POST** Activate Member Pending Points](api-reference/loyalties/activate-member-pending-points) endpoint. The pending points can be also canceled manually with the [**POST** Cancel Member Pending Points](/api-reference/loyalties/cancel-member-pending-points) endpoint.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Pending Points Canceled
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-pending-points-canceled
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.CANCELED
The `EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.CANCELED` event indicates that loyalty pending points have been successfully canceled for a customer's loyalty card associated with a voucher. The pending points can be canceled manually with the [**POST** Cancel Member Pending Points](/api-reference/loyalties/cancel-member-pending-points) endpoint.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Pending Points Updated
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-pending-points-updated
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.UPDATED
The `EVENTS.VOUCHER.LOYALTY_CARD.PENDING_POINTS.UPDATED` event indicates that loyalty pending points have been updated on a customer's loyalty card associated with a voucher. The pending points can be updated by adding or subtracting points.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Points Added
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-points-added
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.POINTS_ADDED
The `EVENTS.VOUCHER.LOYALTY_CARD.POINTS_ADDED` event indicates that loyalty points have been successfully added to a customer's loyalty card associated with a voucher. It informs about the accumulation of loyalty points.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Points Expired
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-points-expired
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.POINTS_EXPIRED
The `EVENTS.VOUCHER.LOYALTY_CARD.POINTS_EXPIRED` event indicates that loyalty points have expired on a loyalty card. It informs about the loyalty points that were removed under the expiration rules set in the loyalty campaign.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Loyalty Card Transaction Created
Source: https://docs.voucherify.io/api-reference/voucher/loyalty-card-transaction-created
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.LOYALTY_CARD.TRANSACTION.CREATED
The `EVENTS.VOUCHER.LOYALTY_CARD.TRANSACTION.CREATED` event indicates that a transaction has been created for a loyalty card.
The following transaction types trigger the event:
* `POINTS_ACCRUAL`
* `POINTS_REDEMPTION`
* `POINTS_REFUND`
* `POINTS_ADDITION`
* `POINTS_REMOVAL`
* `POINTS_EXPIRATION`
* `POINTS_TRANSFER_IN`
* `POINTS_TRANSFER_OUT`
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Published
Source: https://docs.voucherify.io/api-reference/voucher/published
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.PUBLISHED
The `EVENTS.VOUCHER.PUBLISHED` event indicates that a voucher has been successfully published to a customer. The webhook includes, among others, the following details:
* URLs to the voucher's assets, such as QR code and barcode images,
* Associated campaign and its type,
* Expiration date.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Updated
Source: https://docs.voucherify.io/api-reference/voucher/updated
openapi-events/events-voucher.json webhook EVENTS.VOUCHER.UPDATED
The `EVENTS.VOUCHER.UPDATED` event indicates that a voucher's information or attributes have been successfully modified. It informs other systems or applications about the changes made to the voucher.
This event is used in a webhook configured in Project settings in Voucherify dashboard.
The `EVENTS.VOUCHER.UPDATED` webhook is not sent when the vouchers are updated in bulk.
This page documents only the event. If you need more details about the webhook payload data that includes this event, go to [Introduction to webhooks](/api-reference/introduction-to-webhooks "Introduction to webhooks v2024-01-01") page.
# Adjust Voucher Balance
Source: https://docs.voucherify.io/api-reference/vouchers/adjust-voucher-balance
/openapi/vouchers.json post /v1/vouchers/{code}/balance
Add balance to an existing gift card or loyalty card. For loyalty cards, it must be assigned to a holder.
# Create Voucher
Source: https://docs.voucherify.io/api-reference/vouchers/create-voucher
/openapi/vouchers.json post /v1/vouchers/{code}
Create a generic (standalone) voucher or a voucher in a campaign. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters.
When you create a new voucher, you can specify a type to create it.
If no `campaign` name or `campaign_id` is provided, the new voucher will be a generic (standalone) one. However, if an ID or name of a campaign with the `type` set to `STANDALONE` is provided, the voucher will be added to this campaign. For a loyalty card, a campaign name or ID is required.
Standalone Vouchers and Campaigns
Generic (standalone) vouchers created through the Voucherify dashboard always create a campaign for that voucher. However, vouchers created through The vouchers created with POST Create voucher and POST Generate random code endpoints do not have a campaign attached, so the values for `campaign` and `campaign_id` are `null`.
To create a generic (standalone) voucher with a `"type": "STANDALONE"`, use the [POST Create campaign](/api-reference/campaigns/create-campaign) endpoint.
# Delete Voucher
Source: https://docs.voucherify.io/api-reference/vouchers/delete-voucher
/openapi/vouchers.json delete /v1/vouchers/{code}
Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.
If the `force` parameter is set to `false` or not set at all, the voucher will be moved to [the bin](/api-reference/bin/list-bin-entries).
# Disable Voucher
Source: https://docs.voucherify.io/api-reference/vouchers/disable-voucher
/openapi/vouchers.json post /v1/vouchers/{code}/disable
This method sets the voucher state to **inactive**. The voucher cannot be redeemed.
# Enable Voucher
Source: https://docs.voucherify.io/api-reference/vouchers/enable-voucher
/openapi/vouchers.json post /v1/vouchers/{code}/enable
The method sets the voucher state to **active**. The voucher can be redeemed - only if the redemption occurs after the start date and the voucher is not expired.
# Examine Voucher Qualification
Source: https://docs.voucherify.io/api-reference/vouchers/examine-voucher-qualification
/openapi/vouchers.json post /v1/vouchers/qualification
Deprecated
This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](/api-reference/qualifications/check-eligibility) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
Display vouchers qualified to the given customer and context (e.g., order, loyalty reward). Checks up to 50 **generic (standalone) vouchers**.
Prevailing assumption
You data is synced with Voucherify.
## How does this endpoint work?
A property's value that does not meet a validation rule requirement will disqualify that particular voucher and it will not be listed in the results.
As a sample use case, you can imagine a requirement of displaying coupons available for the customer below the shopping cart. The customer can choose and apply the proposed voucher.
## What's excluded?
The verification logic won't run against _coupons from bulk unique code campaigns_. For campaigns with multiple unique codes, you should run a [dedicated function](/api-reference/campaigns/examine-campaign-qualification) for searching and identifying qualified campaigns.
## Customizing the response
Query parameters let you sort and filter the returned vouchers
Customize your response:
- If you only care about verifying a customer, use `audienceRulesOnly` set to `true`.
- If you want to limit the number of vouchers to be returned from the entire pool of eligible vouchers, set a `limit`. This will return vouchers sorted by `-created_at`, by default beginning with the most recent vouchers listed at the top.
- If you have a preference on the sorting order of the returned vouchers, you can use `order` to customize your response.
## Sending the request body payload
## Customer
You have the option of sending customer data via the dedicated `customer` object in the request body or a nested `customer` object within the `order` object.
### Available options:
- You can either pass a customer `id` (Voucherify system generated),
- a `source_id` (your own unique internal customer identifier e.g., email, database ID, CRM id),
- a combination of the remaining parameters in the customer object,
- a combination of customer `id` and remaining parameters excluding `source_id`, or
- a combination of `source_id` and remaining parameters excluding `id`
#### Note:
For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that customer in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body.
The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard. [Read more](/personalize/create-validation-rules).
## Order
### Available options:
- You can either pass an order `id` (Voucherify system generated),
- a `source_id` (your own unique internal order identifier),
- a combination of the remaining parameters in the order object,
- a combination of order `id` and remaining parameters excluding `source_id`, or
- a combination of `source_id` and remaining parameters excluding `id`
#### Note:
For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that order in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body.
The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard. [Read more](/personalize/create-validation-rules).
## Guidelines:
To validate against vouchers with total order `amount` requirements, make sure to include the total order `amount` in the order object or alternatively the `amount` for _every_ order item (the application will then add each amount to get the total and perform the qualification checks). If the total order `amount` is provided along with the individual items' amounts, the total order `amount` will take precedence.
| **Case** | **Order-Level Parameter Included** | **Item-Level Parameter Included** | **Precedence** | **Calculation Result** | **Parameter included in payload accounts for checks against requirements in these validation rules** |
|:---:|:---:|:---:|:---:|---|---|
| **1** | `amount` | `amount` | Order-level | Uses order-level `amount` | - Total order amount |
| **2** | | `amount` | Item-level | Sums each item-level `amount` | - Total order amount
- subtotal of matched items |
| **3** | | `price`
`quantity` | Item-level | Multiplies each item's (`price` x `quantity`) to get item `amount` and then adds each item's `amount` to get total order `amount` | - Total order amount
- Subtotal of matched items
- Unit price of any matching order line
- Price of each item/Price of any item |
| **4** | | `amount`
`price`
`quantity` | Item-level `amount` | Uses item-level `amount` for total order `amount` calculation, ignores (`price` x `quantity`) calculation | - Total order amount (uses item `amount` if provided or `price` x `quantity` for items without `amount` property; `amount` takes precedence in case all 3 properties are provided for an item)
- Subtotal of matched items (uses item `amount`, takes precedence if all 3 properties are provided)
- Unit price of any matching order line
- Price of each item/Price of any item |
| **5** | `amount` | `amount`
`price`
`quantity` | Order-level | Uses order-level `amount` for total order `amount` | - Total order amount (uses order-level `amount`).
- Subtotal of matched items (see case **4** for details).
- Unit price of any matching order line
- Price of each item/Price of any item |
# Export Voucher Transactions
Source: https://docs.voucherify.io/api-reference/vouchers/export-voucher-transactions
/openapi/vouchers.json post /v1/vouchers/{code}/transactions/export
Export transactions that are associated with credit movements on a gift card or loyalty card.
| **Field** | **Definition** | **Example Export** |
|:---|:---|:---|
| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |
| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION`
- `POINTS_ACCRUAL`
- `POINTS_REDEMPTION`
- `POINTS_REFUND`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_EXPIRATION`
- `POINTS_TRANSFER_IN`
- `POINTS_TRANSFER_OUT` |
| source_id | Unique transaction source ID. | 8638 |
| reason | Contains the reason for the transaction if one was included originally. | |
| balance | The gift card or loyalty card balance after the transaction. | |
| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |
| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |
| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |
| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |
| source| Channel through which the transaction was initiated. | API |
| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |
| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |
# Generate Random Code
Source: https://docs.voucherify.io/api-reference/vouchers/generate-random-code
/openapi/vouchers.json post /v1/vouchers
Create a generic (standalone) vouchers. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`.
When you create a new voucher, you can specify a type to create it.
Creating a new voucher will create a new generic (standalone) vouchers if no `campaign` name or `campaign_id` is provided. However, if an ID or name of a campaign with the `type` set to `STANDALONE` is provided, the voucher will be added to such campaign. In case of the loyalty card, a campaign name is required.
You can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.
This method will return an error when trying to create a voucher that already exists.
Standalone Vouchers and Campaigns
Generic (standalone) vouchers created through the Voucherify dashboard always create a campaign for that voucher. The vouchers created with POST Create voucher and POST Generate random code endpoints do not have a campaign attached, so the values for `campaign` and `campaign_id` are `null`.
To create a generic (standalone) voucher with a `"type": "STANDALONE"`, use the [POST Create campaign](/api-reference/campaigns/create-campaign) endpoint.
# Get Voucher
Source: https://docs.voucherify.io/api-reference/vouchers/get-voucher
/openapi/vouchers.json get /v1/vouchers/{code}
Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.
# Import Vouchers
Source: https://docs.voucherify.io/api-reference/vouchers/import-vouchers
/openapi/vouchers.json post /v1/vouchers/import
Import generic (standalone) vouchers and gift cards into the repository.
You can upload up to 100,000 codes to a campaign, as a campaign can have up to 100,000 codes by default.
Also, the request can include up to **10 MB** of data.
Important notes
- **Start and expiration dates** need to be provided in compliance with the ISO 8601 standard. For example, 2020-03-11T09:00:00.000Z.
- Custom code attributes (not supported by-default) need to be added as code **metadata**.
- You **cannot import the same codes** to a single Voucherify Project.
Any parameters not provided in the payload will be left blank or null.
For both **standalone discount vouchers and gift cards**, you can import the following fields:
- code
- category
- active
- type
- start_date
- expiration_date
- redemption.quantity
- additional_info
- metadata
For **gift cards**, you can also import the following field:
- gift.amount
For **discount vouchers**, you can import the `discount` object. The object will slightly vary depending on the type of discount. Each discount type **requires** the `type` to be defined in the import.
| **Discount Type** | **Required fields** |
|:---|:---|
| Amount | amount_off, effect |
| Percent | percent_off, effect |
| Fixed | fixed_amount, effect |
| Unit - One item | unit_off, unit_type, effect |
| Unit - Multiple items | unit_off, unit_type, effect |
| Shipping | unit_off, unit_type, effect |
Fields other than the ones listed above won't be imported. Even if provided, they will be silently skipped.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
Standalone Vouchers and Campaigns
Generic (standalone) vouchers created through the Voucherify dashboard always create a campaign for that voucher. However, vouchers imported through the dashboard in the Vouchers section or through the API do not have a campaign attached, so the values for `campaign` and `campaign_id` are `null`.
To create a generic (standalone) voucher with a `"type": "STANDALONE"`, use the [POST Create campaign](/api-reference/campaigns/create-campaign) endpoint.
# Import Vouchers using CSV
Source: https://docs.voucherify.io/api-reference/vouchers/import-vouchers-using-csv
/openapi/vouchers.json post /v1/vouchers/importCSV
Import generic (standalone) vouchers into the repository using a CSV file.
The CSV file has to include headers in the first line. All properties listed in the file headers that cannot be mapped to standard voucher fields will be added to the metadata object.
You can upload up to 100,000 codes to a campaign, as a campaign can have up to 100,000 codes by default.
Also, the request can include a max. **10 MB** CSV file.
You can find an example CSV file [here](/build/discount-code-import).
___
```cURL cURL example
curl -X **POST** \
https://api.voucherify.io/v1/vouchers/importCSV \
-F file=@/path/to/vouchers.csv \
-F webhooks_enable=true\
-H "X-App-Id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
-H "X-App-Token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```
Standard voucher fields mapping
- Go to the [import vouchers](/api-reference/vouchers/import-vouchers) endpoint to see all standard CSV fields description (body params section).
- Supported CSV file headers: Code,Voucher Type,Value,Discount Type,Category,Start Date,Expiration Date,Redemption Limit,Redeemed Quantity, Redeemed Amount,Active,Additional Info,Custom Metadata Property Name
- **Start and expiration dates** need to be provided in compliance with the ISO 8601 standard. For example, 2020-03-11T09:00:00.000Z.
- `YYYY-MM-DD`
- `YYYY-MM-DDTHH`
- `YYYY-MM-DDTHH:mm`
- `YYYY-MM-DDTHH:mm:ss`
- `YYYY-MM-DDTHH:mm:ssZ`
- `YYYY-MM-DDTHH:mm:ssZ`
- `YYYY-MM-DDTHH:mm:ss.SSSZ`
- Custom code attributes (not supported by-default) need to be added as code **metadata**.
- You **cannot import the same codes** to a single Voucherify project.
- You can, however, upload the same codes to update them.
Categories
In the structure representing your data, you can define a category that the voucher belongs to. You can later use the category of a voucher to group and search by specific criteria in the Dashboard and using the [List Vouchers](/api-reference/vouchers/list-vouchers) endpoint.
This API request starts a process that affects Voucherify data in bulk.
In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window.
The result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).
You can pass the `webhooks_enable=true` parameter to trigger a webhook sendout for created or updated vouchers. Configure the [respective webhooks](/api-reference/introduction-to-webhooks) in Project settings. For updated webhooks, a webhook is sent even if the voucher hasn't been changed in the CSV file.
Generic (standalone) vouchers and campaigns
Generic (standalone) vouchers created through the Voucherify dashboard always create a campaign for that voucher. However, vouchers imported through the dashboard in the Vouchers section or through the API do not have a campaign attached, so the values for `campaign` and `campaign_id` are `null`.
# List Voucher Transactions
Source: https://docs.voucherify.io/api-reference/vouchers/list-voucher-transactions
/openapi/vouchers.json get /v1/vouchers/{code}/transactions
List transactions that are associated with credit movements on a gift card or loyalty card.
# List Vouchers
Source: https://docs.voucherify.io/api-reference/vouchers/list-vouchers
/openapi/vouchers.json get /v1/vouchers
Returns a list of vouchers. By default, the vouchers are returned sorted by creation date, with the most recent vouchers appearing first. A maximum of 100 vouchers are returned in the response.
When you get a list of vouchers, you can optionally specify query parameters to customize the number of vouchers returned per call using `limit`, which page of vouchers to return using `page`, sort the vouchers using the `order` query parameter and more.
This method will return an error when trying to return a limit of more than 100 vouchers.
# Release Validation Session
Source: https://docs.voucherify.io/api-reference/vouchers/release-validation-session
/openapi/vouchers.json delete /v1/vouchers/{code}/sessions/{sessionKey}
Manually release a validation session that has been set up for the voucher. This method undoes the actions that are explained in the [Locking validation session](/guides/locking-validation-session) guide.
Release session in the Dashboard
You can also use the [Validations Manager](/optimize/validations-and-redemptions#sessions) in the Dashboard to unlock sessions.
# Update Voucher
Source: https://docs.voucherify.io/api-reference/vouchers/update-voucher
/openapi/vouchers.json put /v1/vouchers/{code}
Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
Fields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.
If you want to change the amount on a gift card or the number of points on a loyalty card, use the [Adjust voucher balance](/api-reference/vouchers/adjust-voucher-balance) endpoint.
# Update Vouchers in Bulk
Source: https://docs.voucherify.io/api-reference/vouchers/update-vouchers-in-bulk
/openapi/vouchers.json post /v1/vouchers/bulk/async
Updates specific metadata parameters for each code, respectively, in one asynchronous operation.
The request can include up to **10 MB** of data.
Upserts are not supported.
Currently, only **metadata** updates are supported.
The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:
- The status of your request (in queue, in progress, done, or failed)
- Resources that failed to be updated
- The report file with details about the update
This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
# Update Vouchers' Metadata in Bulk
Source: https://docs.voucherify.io/api-reference/vouchers/update-vouchers-metadata-in-bulk
/openapi/vouchers.json post /v1/vouchers/metadata/async
Updates metadata parameters for a list of codes. Every resource in the list will receive the metadata defined in the request.
The request can include up to **10 MB** of data.
Upserts are not supported.
The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:
- The status of your request (in queue, in progress, done, or failed)
- Resources that failed to be updated
- The report file with details about the update
This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
# Voucher Object
Source: https://docs.voucherify.io/api-reference/vouchers/voucher-object
Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
-
Voucher Base
-
Voucher Base
| Attributes |
Description |
|
id
string
|
Assigned by the Voucherify API, identifies the voucher.
Example:
v\_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
|
|
code
string
|
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
Example:
WVPblOYX
|
|
campaign
string
|
A unique campaign name, identifies the voucher's parent campaign.
Example:
Gift Card Campaign
|
|
campaign\_id
string
|
Assigned by the Voucherify API, identifies the voucher's parent campaign.
Example:
camp\_FNYR4jhqZBM9xTptxDGgeNBV
|
|
category
string
|
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
|
|
category\_id
string
|
Unique category ID assigned by Voucherify.
Example:
cat\_0bb343dee3cdb5ec0c
|
|
type
string
|
Defines the type of the voucher.
Available values:
GIFT\_VOUCHER,
DISCOUNT\_VOUCHER,
LOYALTY\_CARD
|
|
discount
|
See:
Discount
|
|
gift
object
|
Object representing gift parameters. Child attributes are present only if
type
is
GIFT\_VOUCHER.
Defaults to
null.
| Attributes |
Description |
|
amount
integer
|
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
Example:
10000
|
|
subtracted\_amount
integer
|
Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
|
|
balance
integer
|
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example
10000 cents
for
\$100.00.
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.
| Attributes |
Description |
|
points
integer
|
Total number of points added to the loyalty card over its lifespan.
Example:
7000
|
|
balance
integer
|
Points available for reward redemption. This is calculated as follows:
balance
\=
points
\-
expired\_points
\-
subtracted\_points
\-
redemption.redeemed\_points.
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.
|
|
pending\_points
integer
|
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
|
|
expired\_points
integer
|
Shows the total number of expired points over the lifetime of the loyalty card.
|
|
subtracted\_points
integer
|
Shows the total number of subtracted points over the lifetime of the loyalty card.
|
|
|
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
|
See:
Validity Timeframe
|
|
validity\_day\_of\_week
|
See:
Validity Day Of Week
|
|
validity\_hours
|
See:
Validity Hours
|
|
active
boolean,
null
|
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.
-
true
indicates an
active
voucher
-
false
indicates an
inactive
voucher
|
|
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
|
See:
Voucher Assets
|
|
is\_referral\_code
boolean,
null
|
Flag indicating whether this voucher is a referral code;
true
for campaign type
REFERRAL\_PROGRAM.
|
|
created\_at
string
|
Timestamp representing the date and time when the voucher was created. The value is shown in the 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 identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
Example:
cust\_eWgXlBBiY6THFRJwX45Iakv4
|
|
referrer\_id
string
|
Unique identifier of the referring person.
Example:
cust\_Vzck5i8U3OhcEUFY6MKhN9Rv
|
|
object
string
|
The type of the object represented by JSON. Default is
voucher.
|
|
publish
object
|
Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| Attributes |
Description |
|
object
string
|
The type of the 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//publications
Example:
/v1/vouchers/WVPblOYX/publications?page=1\&limit=10
|
|
|
redemption
object
|
Stores a summary of redemptions that have been applied to the voucher.
| Attributes |
Description |
|
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 the 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//redemptions
Example:
/v1/vouchers/WVPblOYX/redemptions?page=1\&limit=10
|
|
Category
| Attributes |
Description |
|
id
string
|
Unique category ID assigned by Voucherify.
|
|
name
string
|
Category name.
|
|
hierarchy
integer
|
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
|
|
object
string
|
The type of the object represented by the JSON. This object stores information about the category.
Available values:
category
|
|
created\_at
string
|
Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
Example:
2022-07-14T10:45:13.156Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
Example:
2022-08-16T10:52:08.094Z
|
Validation Rules Assignments List
| Attributes |
Description |
|
object
string
|
The type of the object represented by JSON. This object stores information about validation rules assignments.
Available values:
list
|
|
data\_ref
string
|
Identifies the name of the attribute that contains the array of validation rules assignments.
Available values:
data
|
|
data
array
|
Contains array of validation rules assignments.
Array of
Business Validation Rule Assignment
|
|
total
integer
|
Total number of validation rules assignments.
|
Discount
Contains information about discount.
One of:
-
Amount
-
Unit
-
Unit Multiple
-
Percent
-
Fixed
Validity Timeframe
| Attributes |
Description |
|
duration
string
|
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
duration
of
PT1H
will be valid for a duration of one hour.
Example:
PT1H
|
|
interval
string
|
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
interval
of
P2D
will be valid every other day.
Example:
P2D
|
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
Validity Hours
| Attributes |
Description |
|
daily
array
|
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Array of:
| Attributes |
Description |
|
start\_time
string
|
Defines the starting hour of validity in the HH:mm format. The resource is
inactive before
this time.
Example:
12:00
|
|
days\_of\_week
array
|
Integer array corresponding to the particular days of the week in which the resource is valid.
-
0
Sunday
-
1
Monday
-
2
Tuesday
-
3
Wednesday
-
4
Thursday
-
5
Friday
-
6
Saturday
|
|
expiration\_time
string
|
Defines the ending hour of validity in the HH:mm format. The resource is
inactive after
this time.
Example:
14:00
|
|
Voucher Assets
| Attributes |
Description |
|
qr
object
|
Stores Quick Response (QR) representation of encrypted code.
| Attributes |
Description |
|
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](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.
| Attributes |
Description |
|
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](https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D)
|
|
Business Validation Rule Assignment
| Attributes |
Description |
|
id
string
|
The unique identifier for a assignment
|
|
rule\_id
string
|
The unique identifier for a rule
|
|
related\_object\_id
string
|
The unique identifier for a related object
|
|
related\_object\_type
string
|
The type of related object
|
|
created\_at
string
|
Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
updated\_at
string
|
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
Example:
2022-03-09T11:19:04.819Z
|
|
object
string
|
The type of the object represented by JSON.
Available values:
validation\_rules\_assignment
|
|
validation\_status
string
|
The validation status of the assignment
Available values:
VALID,
PARTIALLY\_VALID,
INVALID
|
|
validation\_omitted\_rules
array
|
The list of omitted rules
|
Amount
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
AMOUNT
|
|
amount\_off
number
|
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.
|
|
amount\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Amount Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
unit\_off
integer
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
|
Defines how the unit is added to the customer's order.
Discount Unit Vouchers Effect Types
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
See:
Simple Sku Discount Unit
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Unit Multiple
| Attributes |
Description |
|
type
string
|
Discount type.
Available values:
UNIT
|
|
effect
string
|
Defines how the discount is applied to the customer's order.
Available values:
ADD\_MANY\_ITEMS
|
|
units
array
|
Array of
One Unit
|
Percent
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
PERCENT
|
|
percent\_off
number
|
The percent discount that the customer will receive.
|
|
percent\_off\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
amount\_limit
number
|
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.
|
|
aggregated\_amount\_limit
integer
|
Maximum discount amount per order.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Percent Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Fixed
| Attributes |
Description |
|
type
string
|
Defines the type of the voucher.
Available values:
FIXED
|
|
fixed\_amount
number
|
Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the
fixed\_amount\_formula
parameter is present in the fixed amount definition, this value becomes the
fallback value.
As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
|
|
fixed\_amount\_formula
string
|
Formula used to dynamically calculate the discount.
|
|
effect
|
Defines how the discount is applied to the customer's order.
Discount Fixed Vouchers Effect Types
|
|
is\_dynamic
boolean
|
Flag indicating whether the discount was calculated using a formula.
|
Discount Amount Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS,
APPLY\_TO\_ITEMS\_PROPORTIONALLY,
APPLY\_TO\_ITEMS\_PROPORTIONALLY\_BY\_QUANTITY,
APPLY\_TO\_ITEMS\_BY\_QUANTITY
Discount Unit Vouchers Effect Types
Available values:
ADD\_MISSING\_ITEMS,
ADD\_NEW\_ITEMS,
ADD\_MANY\_ITEMS,
ADD\_SAME\_ITEMS
Simple Product Discount Unit
| Attributes |
Description |
|
id
string
|
Unique product ID, assigned by Voucherify.
|
|
source\_id
string
|
Product's source ID.
|
|
name
string
|
Product name.
|
Simple Sku Discount Unit
| Attributes |
Description |
|
id
string
|
Unique SKU ID, assigned by Voucherify.
|
|
source\_id
string
|
Product variant's source ID.
|
|
name
string
|
Sku name
|
One Unit
| Attributes |
Description |
|
unit\_off
number
|
Number of units to be granted a full value discount.
|
|
unit\_off\_formula
string
|
Formula used to dynamically calculate the number of units.
|
|
effect
string
|
Defines how the unit is added to the customer's order.
Available values:
ADD\_NEW\_ITEMS,
ADD\_MISSING\_ITEMS
|
|
unit\_type
string
|
The product deemed as free, chosen from product inventory (e.g. time, items).
|
|
product
|
Contains information about the product.
Simple Product Discount Unit
|
|
sku
|
Contains information about the sku.
Simple Sku Discount Unit
|
Discount Percent Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
Discount Fixed Vouchers Effect Types
Available values:
APPLY\_TO\_ORDER,
APPLY\_TO\_ITEMS
# Build campaign overview
Source: https://docs.voucherify.io/build/campaign-overview
Understand how to prepare and configure campaigns in Voucherify
Voucherify is an incentive optimization engine for digital teams. The Build section covers everything you need to configure campaigns: from discount mechanics to loyalty tiers.
## Why this matters
Every setting you configure, like incentive type, validation rules, or budget caps, maps directly to how Voucherify processes campaign data and delivers customer experiences. Understanding these building blocks lets you:
* **Launch fast**: Go from idea to live campaign without engineering bottlenecks.
* **Experiment at scale**: Test variations across channels and segments.
* **Optimize ROI**: Drop underperformers, double down on what works.
Start with one campaign type, then layer in complexity as you learn what resonates with your customers.
## What you'll configure
The Build section walks you through the core campaign types:
* [Discount coupons](/build/discount-promotion-overview): Unique or bulk codes customers enter at checkout
* [Cart promotions](/build/create-discount-promotions): Automatic discounts based on cart contents
* [Loyalty programs](/build/loyalty-campaign-overview): Points, tiers, and rewards for repeat customers
* [Gift cards](/build/gift-card-overview): Prepaid balances customers can spend
* [Referral programs](/build/referral-campaign-overview): Advocate-driven acquisition with tracked rewards
## Campaign lifecycle
Campaigns move through these states:
* **Draft**: Campaign is being set up. No codes are generated yet.
* **Active**: Campaign is live. Codes can be published, validated, or redeemed and are returned for qualification.
* **Disabled**: Campaign is paused. Qualification, validation and redemption are not allowed, but codes can be published.
* **Deleted**: Campaign is removed (to bin or permanently).
Use **Disable** when you need to pause a campaign temporarily.
Use **Delete** only when the campaign is no longer needed.
Read [Campaign maintenance](/orchestrate/campaign-maintenance) for more details.
## How campaigns connect
Campaigns don't exist in isolation. They share validation rules, customer segments, and product catalogs. This composable architecture means you can:
* Reuse rules across campaign types
* Stack incentives for complex promotions
* Orchestrate omnichannel experiences from a single source of truth
# Campaign templates
Source: https://docs.voucherify.io/build/campaign-templates
A conceptual overview of campaign templates in Voucherify
Campaign templates allow you to save a configuration of a created promotion tier, discount coupon, or gift voucher campaign and recreate it later.
Referrals and loyalty programs are not supported.
## Purpose
Campaign templates help you manage campaigns by ensuring:
* **Rapid setup**: Quickly setting up new campaigns with a similar configuration.
* **Team enablement**: Making it easier for your team members to create campaigns.
* **Project migration**: Copying them to other projects, such as moving a campaign configuration from a test environment to a production environment.
* **Library creation**: Creating a library of campaigns to be used in the future.
## Permissions
You need permissions granted by the account owner to manage campaign templates.
Required permissions:
* **Campaign templates**: Permission to create, read, or delete campaign templates.
* **Campaigns**: Permission to create campaigns, required to create a new campaign from an existing template.
Optional permissions for creating related resources:
* **Validation rules**: For adding or cloning validation rules.
* **Customers (segments)**: For creating customer segments.
* **Products**: For creating a new product collection, product, or SKU.
* **Locations**: For creating a new location.
## Campaign template object details
A template saves the following elements of campaign configuration.
Saved configuration elements:
* Campaign type
* General campaign settings
* Timeframe settings
* Discount settings
* Validation rule (the validation rule is cloned)
* Product details (product collection, product, SKU)
* Dynamic segment details
* Location details
* Metadata configuration (product, customer, order, redemption, campaign, voucher, promotion tier)
* Custom event configuration
The following elements aren't saved in the template and they must be edited in the campaign builder.
Unsaved configuration elements:
* Campaign name
* Category
* Code count
* Access settings in the Areas and Stores (Enterprise feature)
The following elements **are not supported** by campaign templates:
Unsupported configuration elements:
* Redeeming API keys (validation rule)
* Redeeming users (validation rule)
* Customer loyalty tier (validation rule)
* Static segments
## Dashboard operations
Campaign templates are managed through the dashboard.
### Creating a campaign template
In Voucherify dashboard, go to **Campaigns hub** > **Campaigns** or **Promotion tiers**:
1. Select an existing campaign or an individual promotion tier.
2. In the upper right corner, click the **star-folder icon** or **Create template**.
3. Name the template and, optionally, add a description.
You cannot create a template out of a draft campaign.
Templates are listed in the **Templates** tab of the **Campaign hub** section.
### Using campaign templates
In a campaign template, click the three-dot menu to:
* **Create campaign**: Opens a builder to create a new campaign from the template. You can either leave the configuration as it is or change it.
* **Copy**: Copies the campaign template to a selected project. You can change its name and description.
* **Edit**: Edits the campaign template’s name and description within the current project.
* **Delete**: Deletes the campaign template.
Discount campaign templates can be also used to create promotion tiers and the other way round; promotion tier templates can be used to create discount campaigns.
When a campaign is created out of a template in a different project, the template itself is not copied to the campaign template list in the target project.
## Template resource behavior
When you create a campaign from a template, its resources will be **created, cloned, or used again**.
When you click **Confirm** in the **Campaign Resource Summary**, the new resources listed there will be created or cloned within the project, even if you leave the campaign builder.
### Create a new resource
New resources are created when they don't exist or have been changed since the template was saved:
* **Does not exist**: A validation rule is added because the template is used in a project which does not have it yet.
* **Restored**: An SKU was permanently deleted and it is restored from a template.
* **Changed**: A validation rule or static collection used in the template has been changed in the meantime, so it will be created again.
### Selecting different resources during campaign creation
When creating a campaign from a template, you can select different existing resources instead of using the ones saved in the template.
This applies to:
* Product collections (static or dynamic)
* Dynamic customer segments
If you select a different resource:
* The system compares it with the resource saved in the template.
* If it has the same configuration, no warning appears.
* If it is different, a warning appears. However, you can still continue and create the campaign using the selected resource.
This allows you to reuse the same campaign structure while choosing a different product collection or customer segment, without changing the template.
### Clone resource
A resource is cloned for example when an existing validation rule used in the template is copied so it can be used separately in a new campaign. This prevents changes from being introduced to other campaigns that use the validation rule saved in the template.
### Reuse resource
Resources are reused when they already exist and haven't been modified:
For example, a product collection is reused in its current state because it already exists in the project and it has not been changed.
### Specific resource behavior
The following resources behave in specific ways depending on the case:
* **Dynamic segments**: Only the configuration of the dynamic customer segments is copied between projects. To fill a segment, you can import customers from the other project.
* **Discounting main product**: When discounting a main product, all its SKUs will be recreated in the new project.
* **Discounting SKU**: When discounting an SKU, only the selected SKUs will be recreated, including the main product in the new project.
* **Modified resources**: If the product or SKU has been modified in the meantime, its current state is used. For example, if the price has been changed from \$10 to \$15, the product will be reused with the current price of \$15 and not copied or recreated with the original \$10 price.
* **In-bin products**: Any products/SKUs currently in the bin make it impossible to use the template since `source_id` is a unique identifier that cannot be reused.
* **Backup function**: Resources deleted after the template’s creation will still be correctly reproduced in any project. The template can serve as a backup for your resources.
### Metadata schema and custom event schema
Definitions of metadata and custom events are **never created** by copying the template to a different project or if they have been deleted. However, products containing the metadata are completely recreated, meaning all products will have proper metadata.
The template stores information about:
* **Metadata**: Properties along with their required types.
* **Custom events**: Only the names without properties and types.
Before using a template in a new project, recreate relevant metadata or custom event schemas.
#### Schema statuses
Schemas, just like other resources, have their own statuses when a campaign is created from a template:
| Status | Description | Action/Outcome |
| :------------------ | :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Schemas matched** | The schema present in the template matches the schema in the project. | The campaign is created from the template. |
| **Schemas differ** | The schema type in the template differs from the one in the project. | The campaign template **cannot be created**. This outcome is available for metadata schema only. Contact your project administrator or the account owner to modify the metadata definitions in this project. |
| **Schemas missing** | The schema in the template does not correspond to any schema in the project. | You can create the campaign from the template, however, the campaign may not work correctly. Ask the project administrator or the account owner to configure the schema definitions. |
If the metadata types saved in the template differ from those defined in the project (for example string in one project, object in the other project), you **cannot** create a campaign from the template.
## Related features
Experiment with other features to improve your campaign results.
You can also use [Templates API](/api-reference/templates/list-campaign-templates) to manage campaign templates programmatically.
Additionally, you can also use the following endpoints from the Management API (enterprise feature):
* [List campaign templates](/api-reference/management/list-campaign-templates)
* [Copy campaign template to a project](/api-reference/management/copy-campaign-template-to-a-project)
# Create benefits
Source: https://docs.voucherify.io/build/create-benefits
Configure a reusable benefit for loyalty earning rules
Benefits define rewards that can be awarded through loyalty earning rules.
Go to **Loyalty hub** > **Benefits**.
From the **Benefits** view, you can:
* View all existing benefits and their status
* Open benefits to review their configuration
* Search benefits using the search bar
* Filter benefits using **Add filter**
* Reload the benefits list using **Reload**
* Create benefits using **+ Create benefit**
* Activate, edit, or delete benefits using the **⋮** actions menu
## Prerequisites for creating benefits
Before creating a benefit, prepare the resources required for the selected benefit type.
Depending on the benefit type, you may need:
* A point wallet for point-based benefits.
* Products or SKUs for material benefits.
* Gift voucher or discount coupon campaigns for digital benefits.
* Metadata schemas for metadata-based proportional points.
* Custom event schemas for metadata values based on custom events.
Some resources can be created directly from the builder using the **+** icon. SKUs, gift voucher campaigns, and discount coupon campaigns cannot be created from the benefit builder.
## Create a benefit
Benefits are configured in a multi-step builder.
You can use **Save draft** and complete the configuration later.
Go to **Loyalty hub** > **Benefits** and use **+ Create benefit**.
### General settings
Configure the benefit name and stock.
Enter the benefit name in **Name benefit**.
By the default, the stock checkbox is set to **Unlimited stock**. Uncheck it and enter the **Stock limit**, which defines how many times the benefit can be issued.
### Configuration
Select the benefit type and configure its details.
Supported benefit types:
* **Points**
* **Material**
* **Digital**
Use **Points** to create a point-based benefit.
In **Points configuration**, select how points are awarded.
#### Fixed points
Use **Fixed** to award the same number of points each time the benefit is applied.
You can create a new point wallet directly from the builder using the **+** icon.
Configure the following fields:
* **Point wallet**: Selects the point wallet that receives the points.
* **Point value**: Number of points awarded.
#### Proportional points
Use **Proportional** to calculate points from order values, item quantities, or metadata values.
Configure the following fields:
* **Calculation type**: Defines the value used to calculate points.
* **Card definition**: Selects the wallet that receives the points.
* **Points**: Number of points awarded for the selected value
Calculation methods are grouped by type.
Use order amount calculations to award points based on total order values.
Available order amount calculations:
* **Pre-discount order amount**: Uses the total order amount before discounts are applied. Configure **Points** and **Amount**.
* **Post-discount order amount**: Uses the total order amount after discounts are applied. Configure **Points** and **Amount**.
Use order item calculations to award points based on selected order items.
Use **Applicable to** to select products, SKUs, or product collections included in the calculation. You can create a new product or product collection directly from the builder using the **+** icon.
Available order item calculations:
* **Pre-discount order items amount**: Uses selected order item values before discounts are applied. Configure **Points**, **Amount**, and **Applicable to**.
* **Post-discount order items amount**: Uses selected order item values after discounts are applied. Configure **Points**, **Amount**, and **Applicable to**.
* **Order items quantity**: Uses the quantity of selected order items. Configure **Points**, **Amount**, and **Applicable to**.
Use metadata calculations to award points based on metadata values.
You can create a new metadata property directly from the builder using the **+** icon.
Available metadata calculations:
* **Customer metadata value**: Uses a selected customer metadata property. Configure **Points**, **Value**, and **Metadata property**.
* **Order metadata value**: Uses a selected order metadata property. Configure **Value** and **Metadata property**.
* **Custom event metadata value**: Uses a selected custom event metadata property. Configure **Value** and **Metadata property**.
Use **Material** to create a benefit based on a product or SKU.
In **Material configuration**, select the source item.
#### Product
Use **Product** to select one product as the benefit.
You can create a new product directly from the builder using the **+** icon.
#### SKU
Use **SKU** to select a specific product variant as the benefit.
SKUs cannot be created from the benefit builder.
Use **Digital** to create a benefit based on an existing voucher campaign.
In **Digital configuration**, select the voucher type.
#### Gift vouchers
Use **Gift voucher campaign** to select a gift voucher campaign.
In **Balance**, enter the credit balance added to the gift voucher.
The balance adds credits to the gift voucher. If a new gift voucher is issued as a benefit, the value in **Balance** will be added to the initial value of the gift voucher as defined in the gift card campaign.
#### Discount coupons
Use **Discount coupons** to select a discount coupon campaign.
The benefit will issue a voucher from the selected campaign.
### Summary
Review the benefit configuration before saving.
The summary page displays all configured sections:
* **General settings**
* **Configuration**
Use **Go to step** to return to a selected section and make changes before saving the benefit.
After reviewing the configuration:
* Use **Save draft** to save the benefit without activating it.
* Use **Save** to create and activate the benefit.
Once saved, the benefit is listed in **Benefits** in **Loyalty hub**.
You can select it in the **Benefit** effect when configuring an **earning rule**.
# Create discount coupons
Source: https://docs.voucherify.io/build/create-discount-coupons
Learn how to create generic or bulk discount coupons in the Campaign builder
The discount coupon campaign builder guides you through the following steps to launch your promotional activity.
Go to **Campaign hub** > **Campaigns** to **Create campaign** and select **Discount coupons**.
Campaign draft
If you can't configure the whole campaign in one go, don't worry.
You can **Save draft** of the campaign. Draft campaigns are inactive until their configuration is finished and saved.
If you **Cancel** the campaign builder, you can return to the builder of that campaign by going to **Create campaign** > **Continue work**. However, if in the meantime you've started creating a new campaign, you won't be able to return to the previous one.
That's why it's best to save campaigns as drafts if you need to stop your work on campaign configuration.
## Campaign details
Start by defining the core identity of your campaign:
1. Enter unique **Campaign name**.
2. Optionally, select a **Category** to group this campaign.
3) Check **Customers can join campaign only once** if customers can receive only one code from this campaign. Customers can't receive more codes through publication.
4) Optionally, provide a **Description** for internal reference.
Next, select the **Campaign size**:
* Select **Bulk codes** to generate codes for individual customers:
* Set **Initial codes count** to generate a given number of codes when the campaign is created.
* Toggle **Auto-increase voucher count** if you want the system to generate more codes automatically during publication.
* Select **Generic code** to create a single code for public use.
* Set **Redemption limit** to define how many times an incentive can be redeemed by all customers.
Set **Code generation settings**:
* Define the pattern, format, charset, and other details for your codes.
**Code generation settings** can be defined only for **Bulk codes**.
## Time frame
**Time frame** sets additional limits on when customers can redeem their incentives.
You can add the following optional time limitations:
* **Starts on** and **Expires** dates
* **Duration and interval time frame** (for example, every 2 days for 3 hours)
* **Valid days of the week** (for example, only Wednesdays)
* **Valid hours per day** (for example, happy hours between 16:00 and 22:00 every Friday and Saturday)
- **Keep valid for a specific amount of time after publishing** to ensure that vouchers expire in a defined time after they were assigned to a customer.
## Discount value
Configure the discount details and effects for the following types in a separate discount builder.
Select one of the following types:
* **Order discount**: Discounts applied to a customer's cart.
* **Product discount**: Discounts applied to specific products or product collections.
* **Rewards**: Free products added to the cart.
* **Free shipping**: Order shipment is free of charge.
* **Bundles**: "Buy X, Get Y" and similar scenarios.
Read [Discount types and effects](/build/discount-types-and-effects) guide for a detailed description of discount types, effects, and other settings.
Read [Dynamic formula builder](/optimize/dynamic-formula-builder#dynamic-formula-builder) to learn how to create formulas that apply different discounts depending on defined conditions.
In the discount builder, you can also set up additional conditions like validation rules to limit the discount behavior (for example, only orders above \$100).
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
## Metadata (optional)
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
By default, the campaign uses **Voucher metadata schema**. This will set metadata for the campaign and its vouchers. If you're editing the campaign, changes made to the metadata will apply only to the vouchers that haven't been redeemed yet and haven't been published to any customers.
Uncheck **Use the voucher's metadata schema** to use campaign metadata schemas. The metadata will apply only to the campaign and not to its vouchers.
## Access settings
Check areas, stores, and all stores to limit the access to the campaign by restricted users and API keys.
Enterprise feature
This step is available for Enterprise clients who have the Areas and stores feature enabled.
Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).
Read [Areas and stores](/orchestrate/areas-and-stores) to learn more about access settings.
## Summary
Review your configuration if everything's correct. If you see something that needs editing, go back to a given step.
If the setup is correct, click **Save** to launch your campaign.
Editing campaign settings (for example time frame or expiration settings) affects only vouchers that *have not been published or redeemed yet*.
Vouchers that are already *published or redeemed keep their existing settings*.
To change their settings, update the voucher directly.
Campaign calendar
Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
## Related features
Experiment with other features to improve your campaign results.
You can turn your discount campaign into a campaign template.
In the campaign detail view, click the **Create template** button in the top right bar.
You can reuse the template to quickly recreate the campaign in the same project or create it in another project.
Moving to production environments
Campaign templates are especially useful when you want to migrate a campaign you've tested in a Sandbox environment to your production project.
Read [Campaign templates](/build/campaign-templates) to learn more.
Once your campaign is live, you can track its progress in the dashboard. This way you can quickly react when it underperforms and tweak its settings or experiment with your setup.
Dev tools
Devs can use the following tools for campaign tracking:
* [Voucherify Core MCP](/guides/voucherify-core-mcp)
* [Campaign summary API](/api-reference/campaigns/get-campaign-summary)
Once you've created the campaign, you can set up a distribution to notify your customers about new promotions, discounts, and other offers, or assign vouchers to them.
These articles can help you with further fine-tuning:
* [Distribution guidebook](/integrations/distributions-overview) explains how distributions work in Voucherify
* [Create distribution](/integrations/create-distribution) will help you with setting up a distribution message
Even best campaigns can be a target of fraud or exploited by customers who spot weak spots in the promotion setup.
You can stop that from happing by using fraud prevention and tracking tools built in Voucherify.
Learn more about stopping incentive fraud in:
* [Interactive tour](https://www.voucherify.io/product-tours/stop-incentive-fraud).
* [Fraud prevention and tracking](/optimize/fraud-prevention-best-practices) article.
# Create cart promotions
Source: https://docs.voucherify.io/build/create-discount-promotions
Configure a cart-level promotion campaign in Voucherify
This is a step-by-step guide on configuring a cart-level promotion campaign in Voucherify, covering all steps shown in the campaign builder.
Go to **Campaign hub** > **Campaigns** to **Create campaign** and select **Promotion**.
Campaign draft
If you can't configure the whole campaign in one go, don't worry.
You can **Save draft** of the campaign. Draft campaigns are inactive until their configuration is finished and saved.
If you **Cancel** the campaign builder, you can return to the builder of that campaign by going to **Create campaign** > **Continue work**. However, if in the meantime you've started creating a new campaign, you won't be able to return to the previous one.
That's why it's best to save campaigns as drafts if you need to stop your work on campaign configuration.
## Promotion details
Define the basic settings and timeframe for your promotion.
Start by defining the core identity of your campaign:
1. Enter unique **Campaign name**.
2. Optionally, select a **Category** to group this campaign.
You can add the following optional time limitations:
* **Starts on** and **Expires** dates
* **Duration and interval time frame** (for example, every 2 days for 3 hours)
* **Valid days of the week** (for example, only Wednesdays)
* **Valid hours per day** (for example, happy hours between 16:00 and 22:00 every Friday and Saturday)
## Discount tiers
Each **Discount tier** defines a specific discount amount and the rules that must be met to activate it. You can create one or multiple tiers.
**Create tier** to configure the promotion tier.
Define **Details**:
1. **Tier name**.
2. **Banner message**: Optional; message shown to customers.
3. **Category**: Optional; used for stacking rules.
4. **Tier timeframe**: Optional; if not set, it inherits the campaign timeframe.
Configure the discount details and effects for the following types in a separate discount builder.
Select one of the following types:
* **Order discount**: Discounts applied to a customer's cart.
* **Product discount**: Discounts applied to specific products or product collections.
* **Rewards**: Free products added to the cart.
* **Free shipping**: Order shipment is free of charge.
* **Bundles**: "Buy X, Get Y" and similar scenarios.
Read [Discount types and effects](/build/discount-types-and-effects) guide for a detailed description of discount types, effects, and other settings.
Read [Dynamic formula builder](/optimize/dynamic-formula-builder#dynamic-formula-builder) to learn how to create formulas that apply different discounts depending on defined conditions.
In the discount builder, you can also set up additional conditions like validation rules to limit the discount behavior (for example, only orders above \$100).
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
Create Tier from Template
You can generate a new discount tier based on a defined **Campaign template**. Templates allow you to reuse configuration settings for a tier that is commonly used across different campaigns, saving setup time.
You can use templates from a discount campaign or a promotion tier to create a new discount tier.
To learn more about pre-configured discount structures, see the [Campaign Templates guide](/build/campaign-templates).
## Discounts application rules
This section determines how the different tiers you defined in the previous step interact with each other. Voucherify supports two main application modes: **Tiers only** and **Tiers and stacks**.
This is the default setting. Only individual promotion tiers can be used.
You can use one or many tiers in your promotion activities.
You can combine multiple individual discount tiers into one unified promotion stack that applies together. In your promotion activities, you can also use promotion stacks together with separate promotion tiers.
A promotion stack works like a bundle of promotion tiers that act as one combined promotion.
Promotion stacks are useful for creating complex incentives like applying "10% off + free shipping" in a single action.
**Create combined promotion** and:
1. Enter **Name** (for example, *Summer stack*).
2. Optionally, select **Category** for the stack or create a new one.
3. In the **Selected Tiers** drop-down, select discount tiers to include them in this stack.
4. Once added, use the up/down arrows to set the application order. The tier at the top of the list is applied first in the transaction sequence.
5. **Save** to add the promotion stack to the campaign.
You can add many promotion stacks to the campaign.
A single promotion stack can have up to 30 tiers.
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
## Promotions hierarchy
If a customer's cart qualifies for multiple discount tiers, you can set the order in which the tier discounts are applied.
Use the arrows to place the highest priority tier at the top of the list and set the rest in the correct order. The tier at the top will be applied first.
## Metadata (optional)
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
## Access settings
Check areas, stores, and all stores to limit the access to the campaign by restricted users and API keys.
Enterprise feature
This step is available for Enterprise clients who have the Areas and stores feature enabled.
Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).
Read [Areas and stores](/orchestrate/areas-and-stores) to learn more about access settings.
## Summary
Review your configuration if everything's correct. If you see something that needs editing, go back to a given step.
If the setup is correct, click **Save** to launch your campaign.
Campaign calendar
Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
## Related features
Experiment with other features to improve your campaign results.
You can turn your discount campaign into a campaign template.
In the campaign detail view, click the **Create template** button in the top right bar.
You can reuse the template to quickly recreate the campaign in the same project or create it in another project.
Moving to production environments
Campaign templates are especially useful when you want to migrate a campaign you've tested in a Sandbox environment to your production project.
Read [Campaign templates](/build/campaign-templates) to learn more.
Once your campaign is live, you can track its progress in the dashboard. This way you can quickly react when it underperforms and tweak its settings or experiment with your setup.
Dev tools
Devs can use the following tools for campaign tracking:
* [Voucherify Core MCP](/guides/voucherify-core-mcp)
* [Campaign summary API](/api-reference/campaigns/get-campaign-summary)
Once you've created the campaign, you can set up a distribution to notify your customers about new promotions, discounts, and other offers, or assign vouchers to them.
These articles can help you with further fine-tuning:
* [Distribution guidebook](/integrations/distributions-overview) explains how distributions work in Voucherify
* [Create distribution](/integrations/create-distribution) will help you with setting up a distribution message
Even best campaigns can be a target of fraud or exploited by customers who spot weak spots in the promotion setup.
You can stop that from happing by using fraud prevention and tracking tools built in Voucherify.
Learn more about stopping incentive fraud in:
* [Interactive tour](https://www.voucherify.io/product-tours/stop-incentive-fraud).
* [Fraud prevention and tracking](/optimize/fraud-prevention-best-practices) article.
Once you've created a promotion campaign, you can manage promotion tiers to optimize and orchestrate your incentive programs by reusing tiers, disabling them when they're not needed at the moment, or deleting them altogether.
Read the [Promotion tier maintenance](/orchestrate/promotion-tier-maintenance) article to learn more.
# Create earning rules
Source: https://docs.voucherify.io/build/create-earning-rules
Create and manage rules that control how loyalty points are awarded
Earning rules define when customers receive points for selected activities and transactions.
Time-related settings in earning rule configuration use the time zone configured in **Project settings**. They are not calculated in UTC.
Go to **Loyalty hub** > **Earning rules**.
From the **Earning rules** view, you can:
* View all existing earning rules and their status.
* Open earning rules to review their configuration and **Activate** or **Deactivate** them.
* Search earning rules with the search bar.
* Filter earning rules with **Add filter**.
* Create earning rules with **+ Create earning rule**.
* Edit, change status, or delete earning rules with the contextual actions menu (`⋮`).
## Create an earning rule
Earning rules are configured in a multi-step builder. Some settings depend on each other. If something is missing or incompatible, the builder displays an **Action required** status.
You can also use **Save draft** and complete the configuration later.
Go to **Loyalty hub** > **Earning rules** and use **+ Create earning rule**.
Enter the earning rule name in **Name earning rule**.
### Trigger
Define the event that activates the earning rule.
Configure:
* **Trigger event**: Selects the event that activates the rule.
* **Custom error message**: Optional message displayed when the earning rule cannot be applied.
Supported trigger events:
* **Order paid**: Triggers the earning rule after an order is successfully paid.
* **Custom event**: Triggers the earning rule when a selected custom event is sent to Voucherify.
* **Segment entered**: Triggers the earning rule when a customer enters a selected segment.
Additional configuration depends on the selected trigger event.
No additional configuration is required.
Select the event in **Custom event**.
Use the search field to find existing custom events or use the **+** icon to create a new one directly from the builder.
Select the segment in **Segment**.
Use the search field to find existing segments or use the **+** icon to create a new one directly from the builder.
### Earnings
Define the conditions and effects used to award points.
Use **+ Add earning** to create additional earning configurations within the same earning rule.
Earning configurations are evaluated in the order they appear in the builder. **Earning #1** has the highest priority.
If the customer does not match the first earning configuration, Voucherify checks the next one in order until an earning is fulfilled. If no earning is fulfilled, no points or benefits are awarded.
Each earning configuration consists of the following steps.
Enter the earning name.
Use the **Tier** section to select which loyalty tiers the earning configuration applies to (optional). Members who don't belong to a selected loyalty tier won't earn points as defined in this earning.
You can select one or more tiers from different tier structures.
Use the **When** section to define conditions for the earning configuration (optional).
Use **Add rule** to create conditions and **Add brackets** to group multiple conditions into logical expressions.
Conditions are grouped by category.
Audience rules define customer-based conditions.
* **Customer segment**: Checks whether the customer belongs to a selected segment.
Product rules define conditions related to items in the order.
* **Any order item**: Checks whether at least one order item matches the condition.
* **Every order item**: Checks whether all order items match the condition.
* **None of the order items**: Checks whether no order items match the condition.
* **Most expensive of the order items**: Checks the most expensive item in the order.
* **Cheapest of the order items**: Checks the cheapest item in the order.
Price and quantity rules define conditions related to order values and quantities.
* **Total amount before discounts**: Checks the order value before discounts are applied.
* **Total amount after discounts**: Checks the order value after discounts are applied.
* **Initial amount**: Checks the original order amount.
* **Items quantity**: Checks the number of items in the order.
* **Price of each item**: Checks the price of every item in the order.
* **Price of any item**: Checks the price of at least one item in the order.
Customer metadata rules define conditions based on customer metadata values.
Available metadata keys depend on the customer metadata schema configured in your project.
Use **Add to schema** to create a new metadata key directly from the builder.
Order metadata rules define conditions based on order metadata values.
Available metadata keys depend on the order metadata schema configured in your project.
Use **Add to schema** to create a new metadata key directly from the builder.
The following actions are available when configuring rules and brackets.
After adding a rule, use the three-dot menu next to the rule name to manage rule actions.
Available rule actions:
* **Error message**: Defines a custom validation message for the selected rule.
* **Edit rule**: Updates the selected rule configuration.
* **Duplicate rule**: Creates a copy of the selected rule.
* **Add next rule**: Adds another rule after the selected rule.
* **Add next brackets**: Adds a new bracket group after the selected rule.
* **Remove rule**: Removes the selected rule from the spending configuration.
* **Surround with brackets**: Groups the selected rule inside brackets.
Use the three-dot menu on the right side of the bracket group to manage bracket actions.
Available bracket actions:
* **Add rule**: Adds a new rule inside the selected bracket group.
* **Add next rule**: Adds a new rule after the selected bracket group.
* **Add brackets**: Adds a nested bracket group inside the selected bracket group.
* **Add next brackets**: Adds a new bracket group after the selected bracket group.
* **Remove brackets and rules inside**: Removes the selected bracket group together with all rules inside it.
Use the **Then** section to define the effects applied when the earning conditions are matched.
Each earning can contain multiple effects. Use **+ Add effect** to create additional effects within the same earning.
Choose one of the following effect types:
* **Fixed points**
* **Proportional points**
* **Incentive**
Award a fixed number of points to the selected wallet.
Configure the following fields:
* **Point wallet**: Selects the point wallet that receives the points.
* **Points**: Number of points awarded when the earning rule is triggered.
You can create a new wallet directly from the builder using the **+** icon.
Award points proportionally based on order values, quantities, or metadata values.
Configure the following fields:
* **Calculation type**: Defines how the proportional points are calculated.
* **Point wallet**: Selects the point wallet that receives the points.
* **Points**: Number of points awarded.
Calculation methods are grouped by type.
Use order amount calculations to award points based on total order values:
* **Pre-discount order amount**: Uses the total order amount before discounts are applied. Configure **Amount**.
* **Post-discount order amount**: Uses the total order amount after discounts are applied. Configure **Amount**.
Use order item calculations to award points based on selected order items:
* **Pre-discount order items amount**: Uses selected order item values before discounts are applied. Configure **Amount** and **Applicable to**.
* **Post-discount order items amount**: Uses selected order item values after discounts are applied. Configure **Amount** and **Applicable to**.
* **Order items quantity**: Uses the quantity of selected order items. Configure **Quantity** and **Applicable to**.
Use **Applicable to** to select products or product collections included in the calculation. You can select multiple products or collections.
Use metadata calculations to award points based on metadata values:
* **Customer metadata value**: Uses a selected customer metadata property. Configure **Value** and **Metadata property**.
* **Order metadata value**: Uses a selected order metadata property. Configure **Value** and **Metadata property**.
You can create a new metadata property directly from the builder using the **+** icon.
You can create a new wallet directly from the builder using the **+** icon.
Award incentives instead of loyalty points.
Configure the following field:
* **Incentive**: selects the incentive awarded when the earning rule is triggered.
You can create a new incentive directly from the builder using the **+** icon.
Use the **Expiration** section in the **Effect** to define the point expiration settings for the earning configuration:
* **Inherit from wallet**: The point expiration is inherited from the point wallet configuration.
* **Override expiration**: Set custom point expiration for this tier. If the point wallet expiration is set to **No expiration**, the tier point expiration can be set to any setting (**Immediate expiration**, **Rolling expiration**, **Calendar expiration**, **Sliding expiration**). The points that members earn while in this tier will expire as set. However, if the point wallet expiration setting is not set to **No expiration**, the tier point expiration has to match the point wallet expiration setting or it has to be set to **No expiration**. It can have different details, like different duration or dates, though.
### Trigger limits
Define cooldown and frequency limits for triggering the earning rule.
#### Cooldown
Control how often the earning rule can be triggered for the same customer.
Available options:
* **No cooldown**: The earning rule can be triggered at any time.
* **Fixed cooldown**: Limits how often the earning rule can be triggered for the same customer.
When **Fixed cooldown** is selected, configure the following fields:
* **Period**: Cooldown duration value.
* **Period unit**: Cooldown duration unit.
Supported period units:
* **Hour**
* **Day**
* **Week**
* **Month**
* **Year**
Maximum values depend on the selected period unit.
#### Frequency
Limit how many times the earning rule can be triggered within a selected time period.
Available options:
* **No limit**: No restriction on how often the earning rule can be triggered.
* **Limited**: Limits the number of eligible triggers within a selected time period.
When **Limited** is selected, configure the following fields:
* **Max triggers**: Maximum number of allowed triggers. The maximum supported value is `10,000`.
* **Period**: Time period used for the frequency limit.
Supported period units:
* **Day**
* **Week**
* **Month**
* **Quarter**
* **Year**
### Timeframe
Define when the earning rule becomes active and when it expires.
Time-related settings in timeframe configuration use the time zone configured in project settings.
#### Starts on
Define when the earning rule becomes active.
Available options:
* **Creation**: The earning rule becomes active immediately after it is created.
* **Specific date**: The earning rule becomes active at a selected date and time.
When **Specific date** is selected, configure:
* **Date**: Activation date.
* **Time**: Activation time.
#### Expiration
Define when the earning rule expires.
Available options:
* **Never**: The earning rule does not expire.
* **On specific date**: The earning rule expires at a selected date and time.
When **On specific date** is selected, configure:
* **Date**: Expiration date.
* **Time**: Expiration time.
#### Valid hours per day
Limit when the earning rule can be triggered during the week.
By default, the earning rule is applicable all days of the week, all day long.
Use **+ Add valid hours per day** to limit when the earning rule can be triggered during the week.
When configuring valid hours, define:
* **Start time**: Beginning of the valid time range.
* **Expiration time**: End of the valid time range.
* **Days of the week**: Days when the earning rule is active within the selected time range.
Available days:
* Sunday
* Monday
* Tuesday
* Wednesday
* Thursday
* Friday
* Saturday
You can configure multiple valid hour ranges can be configured.
Happy hours
You can use the **Days of the week** setting to set up a "happy hours" scenario, when members can earn more points.
### Metadata
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
### Summary
Review the earning rule configuration before saving.
The summary page displays all configured sections:
* Trigger
* Earnings
* Trigger limits
* Timeframe
* Metadata
Use **Go to step** to return to a selected section and make changes before saving the earning rule.
After reviewing the configuration:
* Use **Save draft** to save the earning rule without activating it
* Use **Save** to create and activate the earning rule immediately
## Manage earning rules in the loyalty designer
Earning rules can be assigned and managed directly from the loyalty program designer.
The **Earning rules** section displays all earning rules currently assigned to the program and all earning rules to the added point wallets.
Earning rules award points to point wallets selected in the **Point wallet** field.
You can assign only the earning rules that are either assigned to the point wallets used in the loyalty program or that award benefits (meaning earning rules that do not give points).
To assign an earning rule from the loyalty designer:
1. In the **Earning rules** section, select:
* The **+** button in the **Building blocks**,
* Or the **No earning rules assigned** field.
2. In the assignment dialog:
* Select an existing earning rule from the list,
* Or select **+ Create new** to open the simplified earning rule builder.
The simplified earning rule builder supports:
* Defining the earning rule name
* Selecting the trigger event
* Configuring earning effects
* Assigning point wallets
* Multiple earning effects
Select **Advanced options** to open the full earning rule builder with additional configuration options, including earning conditions and trigger limits.
You can also assign earning rules from the **Building blocks** panel.
Earning rules can be assigned regardless of their current status. Assigning or unassigning earning rules does not change whether the earning rule is active or inactive.
Assigned earning rules can later be:
* Edited from the loyalty designer workspace.
* Unassigned from the loyalty program.
* Deleted from the **Building blocks** panel once the earning rule is unassigned from the loyalty program.
Deleting an earning rule removes it from all loyalty programs where it is currently assigned.
Selecting the edit icon from the loyalty designer opens the full earning rule builder.
## Related features
Earning rules can be used together with the following features to build more advanced loyalty program flows.
You can use [custom events](/prepare/custom-events) to trigger Voucherify logic based on events defined in your integration.
Custom events can be used for segmentation, validation rules, distributions, loyalty automation, and selected event-based configurations.
# Create gift cards
Source: https://docs.voucherify.io/build/create-gift-cards
Set up and manage gift card campaigns in Voucherify
Gift cards act as digital wallets that store customer credits and can be used for purchases. You can create a new gift card campaign using the **Campaign Manager** in the Voucherify dashboard.
Go to **Campaign hub** > **Campaigns** to **Create campaign** and select **Gift vouchers**.
Campaign draft
If you can't configure the whole campaign in one go, don't worry.
You can **Save draft** of the campaign. Draft campaigns are inactive until their configuration is finished and saved.
If you **Cancel** the campaign builder, you can return to the builder of that campaign by going to **Create campaign** > **Continue work**. However, if in the meantime you've started creating a new campaign, you won't be able to return to the previous one.
That's why it's best to save campaigns as drafts if you need to stop your work on campaign configuration.
## Campaign details
Start by defining the core identity of your campaign:
1. Enter unique **Campaign name**.
2. Optionally, select a **Category** to group this campaign.
3) Check **Customers can join campaign only once** if customers can receive only one code from this campaign. Customers can't receive more codes through publication.
4) Optionally, provide a **Description** for internal reference.
Next, select the **Campaign size**:
* Select **Bulk codes** to generate codes for individual customers:
* Set **Initial codes count** to generate a given number of codes when the campaign is created.
* Toggle **Auto-increase voucher count** if you want the system to generate more codes automatically during publication.
* Select **Generic code** to create a single code for public use.
* Set **Redemption limit** to define how many times an incentive can be redeemed by all customers.
- **Code generation settings** can only be defined for **Bulk codes**. For gift cards, it's best to use **Bulk codes** for security, as they represent stored monetary value.
- **Redemption limit** is set to **Unlimited** by default.
## Time frame
You can add the following optional time limitations:
* **Starts on** and **Expires** dates
* **Duration and interval time frame** (for example, every 2 days for 3 hours)
* **Valid days of the week** (for example, only Wednesdays)
* **Valid hours per day** (for example, happy hours between 16:00 and 22:00 every Friday and Saturday)
- **Keep valid for a specific amount of time after publishing** to ensure that gift cards expire in a defined time after they were assigned to a customer.
## Gift credits value
Configure the monetary value and how the gift card will be applied to the customer's purchase:
1. **Initial amount**: Define the initial monetary value loaded onto each card.
2. **Apply credits to**: Determine how the gift card will be applied.
* **Whole cart**: The credits can lower the price of the whole order.
* **Items**: Select products or collections that can be covered with the gift credits. You can also select **Excluded products** that won't be covered by the credits.
For **Items**, you can additionally configure:
* **Application rules**: Defines how the discount is spread across applicable order lines.
* **Capped by**: Limits the number of items to which the discount can be applied.
For detailed descriptions of **Application rules** and **Capped by**, refer to the Complete Discounts Guide.
You can set additional conditions using **Validation rules** to limit the gift card's behavior (for example, only allow redemption for orders above \$100).
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
## Metadata (optional)
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
By default, the campaign uses **Voucher metadata schema**. This will set metadata for the campaign and its vouchers. If you're editing the campaign, changes made to the metadata will apply only to the vouchers that haven't been redeemed yet and haven't been published to any customers.
Uncheck **Use the voucher's metadata schema** to use campaign metadata schemas. The metadata will apply only to the campaign and not to its vouchers.
## Access settings
Check areas, stores, and all stores to limit the access to the campaign by restricted users and API keys.
Enterprise feature
This step is available for Enterprise clients who have the Areas and stores feature enabled.
Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).
Read [Areas and stores](/orchestrate/areas-and-stores) to learn more about access settings.
## Summary
Review your configuration if everything's correct. If you see something that needs editing, go back to a given step.
If the setup is correct, click **Save** to launch your campaign.
Editing campaign settings (for example time frame or expiration settings) affects only vouchers that *have not been published or redeemed yet*.
Vouchers that are already *published or redeemed keep their existing settings*.
To change their settings, update the voucher directly.
Campaign calendar
Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
## Related features
Experiment with other features to improve your campaign results.
You can turn your discount campaign into a campaign template.
In the campaign detail view, click the **Create template** button in the top right bar.
You can reuse the template to quickly recreate the campaign in the same project or create it in another project.
Moving to production environments
Campaign templates are especially useful when you want to migrate a campaign you've tested in a Sandbox environment to your production project.
Read [Campaign templates](/build/campaign-templates) to learn more.
Once your campaign is live, you can track its progress in the dashboard. This way you can quickly react when it underperforms and tweak its settings or experiment with your setup.
Dev tools
Devs can use the following tools for campaign tracking:
* [Voucherify Core MCP](/guides/voucherify-core-mcp)
* [Campaign summary API](/api-reference/campaigns/get-campaign-summary)
Once you've created the campaign, you can set up a distribution to notify your customers about new promotions, discounts, and other offers, or assign vouchers to them.
These articles can help you with further fine-tuning:
* [Distribution guidebook](/integrations/distributions-overview) explains how distributions work in Voucherify
* [Create distribution](/integrations/create-distribution) will help you with setting up a distribution message
Even best campaigns can be a target of fraud or exploited by customers who spot weak spots in the promotion setup.
You can stop that from happing by using fraud prevention and tracking tools built in Voucherify.
Learn more about stopping incentive fraud in:
* [Interactive tour](https://www.voucherify.io/product-tours/stop-incentive-fraud).
* [Fraud prevention and tracking](/optimize/fraud-prevention-best-practices) article.
Voucherify gift cards are issued as digital gift card codes. You can export or print codes if you need to distribute them on physical materials.
# Create loyalty campaign
Source: https://docs.voucherify.io/build/create-loyalty-campaign
Learn how to create a loyalty campaign in the Campaign builder
Legacy loyalty
This page describes the legacy loyalty program model.
Legacy loyalty is in maintenance mode. Voucherify is not actively developing new features for this model, but your existing programs remain supported and critical issues will continue to receive fixes.
The legacy loyalty program will be eventually sunset. If you have questions about what this means for your program, migration, or timelines, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
The loyalty campaign builder guides you through the following steps to launch your program.
Go to **Campaign hub** > **Campaigns** to **Create campaign** and select **Loyalty program**.
Campaign draft
If you can't configure the whole campaign in one go, don't worry.
You can **Save draft** of the campaign. Draft campaigns are inactive until their configuration is finished and saved.
If you **Cancel** the campaign builder, you can return to the builder of that campaign by going to **Create campaign** > **Continue work**. However, if in the meantime you've started creating a new campaign, you won't be able to return to the previous one.
That's why it's best to save campaigns as drafts if you need to stop your work on campaign configuration.
## Campaign details
Start by defining the core identity of your campaign:
1. Enter unique **Campaign name**.
2. Optionally, select a **Category** to group this campaign.
3) Optionally, provide a **Description** for internal reference.
4) Optionally, set **New customers will auto-join campaign once any earning rule is fulfilled** for allowing customers to join the loyalty program when they meet the condition of an earning rule.
The **Customers can join campaign only once** checkbox is ticked by default. Customers can have only one loyalty card in a given loyalty campaign.
You can add the following optional time limitations:
* **Starts on** and **Expires** dates
* **Duration and interval time frame** (for example, every 2 days for 3 hours)
* **Valid days of the week** (for example, only Wednesdays)
* **Valid hours per day** (for example, happy hours between 16:00 and 22:00 every Friday and Saturday)
- Set **Keep valid for a specific amount of time after publishing** to ensure that vouchers expire in a defined time after they were assigned to a customer.
- Set **Loyalty card count** to generate a given number of loyalty cards when the campaign is created.
Set **Code generation settings**:
* Define the pattern, format, charset, and other details for your codes.
## Point expiration and earning rules
Set expiration rules for points to determine if customers have a limited time to use their points. Also, set earning rules to define when and under what conditions customers get loyalty points.
### Point expiration rules
Point expiration can be set globally at the campaign level – all points earned through earning rules will follow the same expiration rule.
You can set the following point expiration rules:
* **No expiration**: Points never expire. Customers have unlimited time to redeem points for rewards.
* **Months after earning activity**: Points expire after a defined number of months. You can further round up the expiration to a selected period.
* **Expiration day and month**: Points expire at a specific day of a selected month.
### Earning rules
Read [Earning rules](/build/earning-rules) to learn how specific earning rules work.
**Create earning rule** to define how customers receive loyalty points.
Start by defining overall earning rule settings:
1. Select earning rule type:
* **Order has been paid**
* **Custom event**
* **Entered segment**
* **Tier events**
2. **Name** your earning rule.
3. Set up start and expiration date (when customers will be able to earn points and until what date) and other time limitations. These settings work the same as for campaign **Time frame**.
4. Define settings specific for the earning rule type:
* **Custom event**: Select or create **Custom event**.
* **Entered segment**: Select or create **Customer segment**.
* **Tier events**: Select loyalty tier event and define if these events should trigger for any tier or a specific tier. The loyalty tier can belong to another loyalty program.
Define how many points are earned for a given earning rule type.
Set the following:
1. Select:
* **Fixed**: Defines a specific number of points customers will earn for a completed order.
* **Proportional**: Defines the rules that will scale the number of earned points with a given condition.
2. **Enable pending points**: Defines the number of days after the completed order when the customers will receive their points.
Set the following:
* **Fixed**: Defines a specific number of points customers will earn when the custom event occurs.
* **Proportional**: Defines the rules that will scale the number of earned points with a given metadata condition.
Set the following:
* **Fixed**: Defines a specific number of points customers will earn when the customer enters the segment.
* **Proportional**: Defines the rules that will scale the number of earned points with a given metadata condition.
Set the **Fixed** number of points customers will earn when the selected loyalty tier event occurs.
Additionally, you can set up:
* **Dynamic formula** to assign a dynamic point value that's calculated with mathematical and logical operators.
* **Expiration rules** for individual earning rules. These rule-level settings override the campaign-level expiration.
Optionally, select a validation rule to define additional limits for your customers that will be checked before triggering points.
You can:
* Select an existing rule.
* Edit an existing rule.
* Clone and edit an existing rule.
* Create a new rule.
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
Optionally, add metadata to the earning rule.
You can:
* Add value to a key from an existing metadata schema.
* **Add unknown property**: Add a custom attribute that's not defined in the metadata schema.
* **Add to schema**: Define a new custom attribute and add it to the metadata schema. You can then add value to that metadata.
For each metadata, you can set **Value type** as:
* **Undefined**: No value is set and the metadata isn't added to the earning rule.
* **Null**: The value is set to `null`, for example `"test_metadata": null`.
* **Value**: Add value according to the metadata type (string, date, boolean, and so on).
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
You can set up many earning rules for one campaign.
A project can have up to 100 loyalty earning rules. This limit can be increased if you have a single-tenant setup. Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).
## Reward catalog
Customers can spend their loyalty points to earn rewards. In this step, you can add to or create rewards in the **Reward catalog**.
**Add reward** to the catalog and:
You can select an existing reward from the **Reward** list. Alternatively, you can **Create new** reward.
You can select from the following reward types:
Digital reward
Customers can spend their points to receive a discount coupon.
Create **Discount coupon** reward as follows:
1. **Name reward**.
2. Select **Campaign** which will be the source of coupons.
3. Alternatively, **Create new** to select a specific discount type and open the [discount campaign builder](/build/create-discount-coupons). This builder has fewer steps than the builder in the campaign manager. If you want to configure more details, edit that campaign afterwards.
4. Optionally, add **Metadata**.
Digital reward
Customers can spend their points to receive credits on a gift card.
Create **Credits on gift card** reward as follows:
1. **Name reward**.
2. Define **Gift amount** that will be added to the customer's gift card.
3. Select **Campaign** which will be the source of gift cards.
4. Alternatively, **Create new** to open the [gift card campaign builder](/build/create-gift-cards). This builder has fewer steps than the builder in the campaign manager. If you want to configure more details, edit that campaign afterwards.
5. Optionally, add **Metadata**.
Digital reward
Customers can spend their points to receive points on a loyalty card in another loyalty campaign.
Create **Points on loyalty card** reward as follows:
1. **Name reward**.
2. Define **Loyalty points** that will be added to the customer's loyalty card.
3. Select **Campaign** which will be the source of loyalty cards.
4. Optionally, add **Metadata**.
Material reward
Customers can spend their points to receive a product.
Create **Material reward** as follows:
1. **Name reward**.
2. Select an existing product or SKU. Alternatively, **Create new** to add a new product.
3. Optionally, define **Quantity/Stock** of available product units to be exchanged as rewards.
4. Optionally, enter **Reward description**.
5. Optionally, add **Metadata**.
Pay with points reward
Customers can spend their points to pay for their orders.
Create **Pay with points** reward as follows:
1. **Name reward**.
2. Define the exchange rate between **Loyalty points** and **Cash value**.
3. Optionally, add **Metadata**.
This step is available only for the **Digital** and **Material** rewards.
With **Auto-redeem**, you can set one reward in the loyalty program to be automatically redeemed once customers reach or exceed the required points threshold.
This step is available only for the **Digital** and **Material** rewards.
Define cost of the reward in points.
This step is available only for the **Pay with points** reward.
Optionally, select a validation rule to define additional limits for your customers that will be checked before paying with points.
You can:
* Select an existing rule.
* Edit an existing rule.
* Clone and edit an existing rule.
* Create a new rule.
Check the configuration of your reward.
When everything is correct, **Add reward**.
You can add many rewards to **Reward catalog**.
## Tiers (optional)
Read [Loyalty tiers](/build/loyalty-tiers) to learn more about how tiers work.
Tiers are optional membership levels of your loyalty campaign. Define loyalty tiers as follows.
There are two ways for customers to qualify for a tier.
Customers qualify for the tier **immediately** if their point balance is in the point range of the tier. This means that they enter the tier if they reach the lower value or drop out of a higher tier and have a value lower than the upper limit. Customers drop out of a tier if their point balance is outside of the range, either if their point balance is lower or higher than the defined limits.
Customers can drop out of a tier as follows:
* **Immediately**: Set this to move customers to a lower tier when their point balance is below the lower limit.
* **Custom**: Set **Value** in months to allow customers to have grace period when they're still in the higher tier. Additionally, you can round up the expiration date.
Customers qualify for the tier if they collect enough points in a given period.
Define:
1. **Tier qualification period**: Time when customers need to collect points (for example, calendar month).
2. **Tier start date**:
* **Immediately**: When the tier threshold is reached, the customer is immediately upgraded to the tier.
* **Next qualification period**: When the tier threshold is reached, the customer is upgraded to the tier from the subsequent qualification period start date.
3. **Tier expiration date**:
* **End of the qualification period**: The tier will be valid till the end of the qualification period in which the tier was granted.
* **End of the next qualification period**: The tier will be valid till the end of the next qualification period in which the tier was granted.
4. Optionally, **Extend expiration date** by a set value of months or days.
**Create tier** to define a loyalty tier:
1. Enter **Tier name**.
2. Set **Min. points** to define the lower threshold.
3. Optionally, set **Max. points** to define the upper threshold for multi-tier loyalty programs.
4. Optionally, add **Metadata**.
Optionally, you can change the way points are assigned in a specific tier in relation to an earning rule. The point assignments defined with mapping will be made only for members in the particular tier.
**Add mapping** and:
1. Select **Tier**.
2. Set **Multiply** and define the **Multiplier**.
3. Alternatively, set **Custom** to replace the default point value set by the earning rule.
4. **Save** to add mapping.
You can map many tiers to an earning rule.
Optionally, you can change the price in points for a reward when customers belong to a specific tier.
**Add mapping** and:
1. Select **Tier**.
2. Set **Multiply** and define the **Multiplier**.
3. Alternatively, set **Custom** to replace the default point value set for the reward.
4. Alternatively, set **Not available** to turn off a reward for a particular tier.
5. **Save** to add mapping.
You can map many tiers to a reward.
## Distributions (optional)
Set up automatic messages that are sent when certain loyalty events happen. These messages can go to customers or external systems using channels like text messages, emails, webhooks, or one of the built-in integrations.
The distribution builder in this step is preconfigured for the selected event. The only step to configure is **Channels**.
Read [Distribution overview](/integrations/distributions-overview) to learn more.
**Add distribution** and select the event that will send the messages:
* **Reward redeemed**: The message is sent when a customer redeems a reward.
* **Successfully published**: The message is sent when a voucher is successfully published (assigned) to a customer.
* **Customer rewarded loyalty points**: The message is sent when a customer earns points in the loyalty program.
In the distribution builder, **Name** the distribution.
Go to **Channels** and **Add channel** that will distribute the messages.
The available channels differ depending on the selected distribution event.
You can set up many channels for one distribution.
In **Summary**, check if the distribution configuration is correct.
**Save** to add the distribution to the loyalty campaign.
You can add many distributions to a loyalty program.
## Metadata (optional)
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
By default, the campaign uses **Voucher metadata schema**. This will set metadata for the campaign and its vouchers. If you're editing the campaign, changes made to the metadata will apply only to the vouchers that haven't been redeemed yet and haven't been published to any customers.
Uncheck **Use the voucher's metadata schema** to use campaign metadata schemas. The metadata will apply only to the campaign and not to its vouchers.
## Access settings
Check areas, stores, and all stores to limit the access to the campaign by restricted users and API keys.
Enterprise feature
This step is available for Enterprise clients who have the Areas and stores feature enabled.
Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).
Read [Areas and stores](/orchestrate/areas-and-stores) to learn more about access settings.
## Summary
Review your configuration if everything's correct. If you see something that needs editing, go back to a given step.
If the setup is correct, click **Save** to launch your campaign.
Editing campaign settings (for example time frame or expiration settings) affects only vouchers that *have not been published or redeemed yet*.
Vouchers that are already *published or redeemed keep their existing settings*.
To change their settings, update the voucher directly.
Campaign calendar
Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
## Related features
Experiment with other features to improve your campaign results.
Once your campaign is live, you can track its progress in the dashboard. This way you can quickly react when it underperforms and tweak its settings or experiment with your setup.
Dev tools
Devs can use the following tools for campaign tracking:
* [Voucherify Core MCP](/guides/voucherify-core-mcp)
* [Campaign summary API](/api-reference/campaigns/get-campaign-summary)
Even best campaigns can be a target of fraud or exploited by customers who spot weak spots in the promotion setup.
You can stop that from happing by using fraud prevention and tracking tools built in Voucherify.
Learn more about stopping incentive fraud in:
* [Interactive tour](https://www.voucherify.io/product-tours/stop-incentive-fraud).
* [Fraud prevention and tracking](/optimize/fraud-prevention-best-practices) article.
# Tutorial – Create a basic loyalty program
Source: https://docs.voucherify.io/build/create-loyalty-program
Learn how to create a loyalty program with a point wallet and an earning rule
Recommended reading
See [an interactive demo](https://app.demoboost.com/playback/bFOPIzGc?step=2 "Voucherify loyalty program designer demo") of the loyalty program designer.
Read [Key concepts](/build/loyalty-key-concepts) first to learn more about loyalty program components and how they work together.
Create a basic loyalty program that awards points to customers after they pay for their orders. The program includes a point wallet, which defines how points behave, and an earning rule, which sets the conditions for awarding points. Once the program is ready, you can activate it and start enrolling customers as program members. Optionally, you can create a reward that customers can redeem for their earned points.
To create your first loyalty program, go to **Loyalty hub** on the left sidebar and click **Programs**. This opens the **Programs** page which lists all your programs. There, you can create a new program by clicking **+ Create program**.
## Create the loyalty program
A basic loyalty program requires at least one point wallet and one earning rule. Once they're added, the program is ready to be activated.
Once you've clicked **+ Create program**, name your program and save the program draft.
You'll be taken to the designer view where you can add your first building block.
Create a point wallet that sets rules for how points will behave on loyalty cards assigned to program members.
Create a point wallet as follows:
1. In the **Point wallets** section, click the **+** button to create a new point wallet or add an existing one to the program. Optionally, click the **+** button in the **Building blocks** panel on the right.
2. Click **Create new**.
3. Enter a name in **Point wallet name**.
4. Click **Save draft** to create the point wallet in a draft state.
The point wallet is added to the program, but it's not active yet.
In this scenario, it's not necessary to configure any additional settings, such as **Points expiration**, **Pending points**, **Earning limits**, or **Spending limits**.
Learn more about point wallets
Learn what point wallets are and how they work in the [Key concepts](/build/loyalty-key-concepts#point-wallet) page.
Go to the [Create point wallets](/build/create-point-wallets) page to learn more about how to configure point wallets and the advanced settings available.
Create an earning rule that awards points for paid orders.
Create an earning rule as follows:
1. In the **Earning rules** section, click the **+** button to create a new earning rule or add an existing one to the program. Optionally, click the **+** button in the **Building blocks** panel on the right.
2. Click **Create new**.
3. Enter a name in **Earning rule name**.
4. Select **Order paid** in **Trigger event**.
5. In **Effect #1**, leave **Fixed points** and the pre-selected point wallet you've created in the earlier step.
6. Set **Points** to a desired number of points to award for each paid order. Default is **1** point.
7. Click **Save draft** to create the earning rule in a draft state.
The earning rule is added to the program, but it's not active yet.
In this scenario, it's not necessary to configure any additional settings, such as secondary earnings, **Trigger limits**, or **Time frames**.
Learn more about earning rules
Learn what earning rules are and how they work in the [Key concepts](/build/loyalty-key-concepts#earning-rule) page.
Go to the [Create earning rules](/build/create-earning-rules) page to learn more about how to configure earning rules and the advanced settings available.
Activate the loyalty program to enroll program members who can start earning points:
1. Click **Review and launch** at the top of the screen.
2. Review the activation recommendations. You will see 1 point wallet and 1 earning rule to activate.
3. Select **Activate** next to the point wallet and earning rule.
4. Click **Launch** to activate the program.
Once activated, you won't be able to add more point wallets or assign tier structures. However, you can still add new earning rules or rewards.
The activation checklist shows recommended loyalty program components, such as wallets, earning rules, and rewards. Not all components are required to activate the program.
Your loyalty program is now active. You can start enrolling program members and they can earn points through paid orders.
## Enroll program members
Once the program is active, go to **Details** at the top of the screen to **Create member**. The create member window opens:
1. Select an existing Voucherify customer to be enrolled as a program member. You can also [create a new customer](/prepare/customers#create-a-customer-profile) by clicking the **+** button.
2. Click **Save** to add the customer to the program.
You can add new members only from existing Voucherify customers.
Repeat the process to enroll more program members.
Once a customer is enrolled, they:
* Become a program member with a unique loyalty member ID.
* Receive a loyalty card with a unique loyalty card ID.
* Can start earning points by making paid orders.
Click the member ID to view the member details. The member details page shows the member's loyalty card, point balance, and other relevant information.
Click the loyalty card ID to view the loyalty card details. The loyalty card details page shows the loyalty card's status, lifetime point breakdown, and other relevant information.
You can also view all **Loyalty memberships** of the customer in the customer details page.
Learn more about program members
Learn what program members are and how they work in the [Key concepts](/build/loyalty-key-concepts#loyalty-member) page.
## Award points to program members
To simulate how points are earned through paid orders, you can create a new order and assign it to the customer who is a program member.
In the left sidebar, go to **Campaign hub** > **Orders** to **Create order**. The create order builder opens.
In the **Details** step, set the **Status** to **Paid**.
If you select any other status or leave it blank, the customer will not earn points.
In the **Items** step, enter any number in the **Total order amount** field.
Since the program awards points for each paid order, the specific order amount does not affect the points earned.
In the **Customer** step, select a customer who is an active program member.
Skip the **Referrer (optional)** and **Metadata (optional)** steps and go to the **Summary** step.
Save the order.
Go to **Loyalty hub** > **Programs** and click your program. Go to **Details**, click the member ID and you will see the points earned.
Click the loyalty card ID to view the loyalty card details. In the **Card transactions** tab, you can see the details of the particular transaction.
## Optional: Create rewards
You can also create rewards that customers can redeem with their earned points. Rewards cover digital rewards (like discount coupons, gift cards, or points on a loyalty card) and material rewards (products). In this tutorial, you will create a physical reward.
Create a reward as follows:
1. In the **Rewards** section, click the **+** button to create a new reward or add an existing one to the program. Optionally, click the **+** button in the **Building blocks** panel on the right.
2. Click **Create new**.
3. Enter a name in **Reward name**.
4. Select **Material reward**.
5. Select a product or SKU from the list. If your Voucherify account doesn't have products, click the **+** button to create a new product or SKU.
6. In **Spending**, set the number of points required to redeem the reward in the **Point cost** field.
7. Leave other fields as is and click **Save draft** to create the reward in a draft state.
The reward is added to the program, but it's not active yet. You can activate the reward by clicking the **▶** button next to the reward name. You won't be able to edit its details like type, but you can still change its cost.
In this scenario, it's not necessary to configure any additional settings, such as tier and other conditions, or time frames.
Learn more about rewards
Learn what rewards are and how they work in the [Key concepts](/build/loyalty-key-concepts#rewards) page.
Go to the [Create loyalty rewards](/build/create-loyalty-rewards) page to learn more about how to configure rewards and the advanced settings available.
# Create loyalty rewards
Source: https://docs.voucherify.io/build/create-loyalty-rewards
Configure digital and material rewards for loyalty programs, define spendings, and manage rewards in the Loyalty hub
This page describes how to create rewards in the **Loyalty hub**. These rewards can be used only in loyalty programs. To create rewards for legacy loyalty campaigns and referral campaigns, read the [Create rewards](/optimize/create-rewards) page.
Rewards are items that loyalty members redeem by spending points. You can offer discount coupons, gift cards, or physical products.
Go to **Loyalty hub** > **Rewards** and click **Create reward**.
## Rewards list
The **Loyalty rewards** section lists all rewards created in your project. Each reward appears as a row with the following columns:
* **Status**: Shows whether the reward is **Active**, **Inactive**, or **Draft**.
* **Name**: The name of the reward.
* **Type**: The reward type: **Digital** or **Material**.
* **Reward**: The name of the resource connected to this reward, such as a campaign or product.
* **Refundable**: Shows whether points spent on this reward can be returned after a refund: **Refundable** or **Non-refundable**.
* **Created**: The date and time the reward was created.
Use the search bar to find a reward by name. Use **Add filter** to narrow the list by **Loyalty reward attributes**.
* **Name**: Filter by reward name.
* **Type**: Filter by reward type.
* **Creation date**: Filter by when the reward was created.
## Create a reward
Prerequisite: Sources of rewards
Before creating a reward, prepare the resources required for the selected reward type.
Depending on the reward type, you may need:
* A discount campaign for discount coupon rewards.
* A gift cards campaign for gift card rewards.
* A point wallet for points on loyalty card rewards.
* A product or SKU for material rewards.
Start by entering a name in the **Name reward** field. If a required field is missing or settings are incompatible, you will see an **Action required** message. You can also **Save draft** and finish the setup later.
### Details
Choose the reward type and configure the reward.
Digital rewards issue a discount coupon or gift card to the member.
Select the **Digital reward type**.
Issues a discount coupon from an existing discount campaign. In **Discount campaign**, select the campaign to issue coupons from.
Optionally, you can create a new discount campaign by clicking the **+** button and selecting a discount type. This opens a simplified builder where you can configure the campaign name, discount, conditions, and other details.
Issues a gift card from an existing gift card campaign.
* **Gift card campaign**: Select the campaign to issue gift cards from.
* **Gift card balance**: Set the balance added to the initial amount of the gift card when issued.
Optionally, you can create a new gift card campaign by clicking the **+** button. This opens a simplified builder where you can configure the campaign name, gift credits, conditions, and other details.
Set **Gift card balance** to `0` if you don't want to top up the card beyond its initial amount.
For example, if the members can buy a gift card as a reward from a campaign which generates cards with \$100 credits, it's better to use `0`. If you set here `10`, the member will get a gift card reward with a \$110 credit.
If you want to create a reward that only tops up the current gift card balance, set the desired value. For example, if you set `10` and the member has a gift card with \$46 balance currently, they can use the reward to buy additional credits with loyalty points and top the card up to \$56.
Grants points directly to a loyalty card in a selected point wallet.
* **Target point wallet**: Select the point wallet where points will be added.
* **Points to grant**: Set how many points to add.
This reward type works only with new loyalty programs. You can't set this reward for legacy loyalty campaigns.
Material rewards represent a physical product or SKU that members can redeem.
Use **Product or SKU** to search for an existing product by typing at least 3 characters.
If the product doesn't exist yet, use **+** to **Add product**:
* **Product name**: the name of the product (required).
* **Source ID**: an optional external identifier for the product.
* **Price**: the price of the product.
* **Attributes**: optional product attributes.
Select **Refundable** to allow points spent on this reward to be returned after a refund.
### Spendings
**Spending** defines how much a reward will cost in points, which point wallet will be used, as well as it determines other conditions. Spendings are evaluated top to bottom. If a member doesn't match the first spending configuration, Voucherify checks the next one in order until a spending is fulfilled. If no spending is fulfilled, the reward can't be redeemed.
If a member's wallet doesn't have enough points, Voucherify doesn't automatically try another point wallet. Add another spending to cover that case.
Use **+ Add spending** to create additional spending configurations. Drag spendings to change their priority. You can add up to 10 spendings.
Each spending configuration consists of the following steps.
Enter an internal name to identify the spending configuration.
Use the **Tier** section to select which loyalty tiers the spending applies to (optional).
Leave the **Tiers** field blank to apply the spending to all loyalty members.
Use the **When** section to define conditions for the spending configuration (optional).
Use **Add rule** to create conditions and **Add brackets** to group multiple conditions into logical expressions.
Conditions are grouped by category.
Audience rules define member-based conditions:
* **Customer segment**: Checks whether the customer belongs to a selected segment.
Customer metadata rules define conditions based on customer metadata values.
Available metadata keys depend on the customer metadata schema configured in your project.
Use **Add to schema** to create a new metadata key directly from the builder.
Member metadata rules define conditions based on member metadata values.
Available metadata keys depend on the member metadata schema configured in your project.
Use **Add to schema** to create a new metadata key directly from the builder.
The following actions are available when configuring rules and brackets.
After adding a rule, use the three-dot menu next to the rule name to manage rule actions.
Available rule actions:
* **Error message**: Defines a custom validation message for the selected rule.
* **Edit rule**: Updates the selected rule configuration.
* **Duplicate rule**: Creates a copy of the selected rule.
* **Add next rule**: Adds another rule after the selected rule.
* **Add next brackets**: Adds a new bracket group after the selected rule.
* **Remove rule**: Removes the selected rule from the spending configuration.
* **Surround with brackets**: Groups the selected rule inside brackets.
Use the three-dot menu on the right side of the bracket group to manage bracket actions.
Available bracket actions:
* **Add rule**: Adds a new rule inside the selected bracket group.
* **Add next rule**: Adds a new rule after the selected bracket group.
* **Add brackets**: Adds a nested bracket group inside the selected bracket group.
* **Add next brackets**: Adds a new bracket group after the selected bracket group.
* **Remove brackets and rules inside**: Removes the selected bracket group together with all rules inside it.
Use the **Then redeem from** section to define which point wallet is used and how many points the redemption costs.
Configure the following fields:
* **Point wallet**: Selects the point wallet from which points are deducted when the reward is redeemed.
* **Points cost**: The number of points required to redeem this reward.
If you want the reward to be redeemed with different point values from various point wallets in one loyalty program, add another spending.
A reward can be redeemed from point wallets that belong to one loyalty program. If you configure point wallets that belong to different loyalty programs, you won't be able to assign the reward to a program.
Also, if you assign the reward to a loyalty program, you won't be able to configure spendings with point wallets from other programs.
### Timeframe
Define when the reward can be redeemed and when it is no longer available.
Time-related settings in timeframe configuration use the time zone configured in [Project settings](/manage/project-settings).
#### Starts on
Define when the reward becomes active.
Available options:
* **Creation**: The reward becomes active immediately after it is created.
* **Specific date**: The reward becomes active at a selected date and time.
When **Specific date** is selected, configure:
* **Date**: Activation date.
* **Time**: Activation time.
#### Expires
Define when the reward stops being active, so it becomes unavailable for redemption.
Available options:
* **Never**: The reward doesn't expire and it's always available.
* **On specific date**: The reward expires at a selected date and time. It is no longer available after this date.
When **On specific date** is selected, configure:
* **Date**: Expiration date.
* **Time**: Expiration time.
#### Valid hours per day
By default the reward is available for redemption throughout all days of the week, all day long.
Use **+ Add valid hours per day** to limit when the reward can be redeemed during the week.
When configuring valid hours, define:
* **Start time**: Beginning of the valid time range.
* **Expiration time**: End of the valid time range.
* **Days of the week**: Days when the reward is active within the selected time range.
Available days:
* Sunday
* Monday
* Tuesday
* Wednesday
* Thursday
* Friday
* Saturday
You can configure multiple valid hour ranges.
Happy hours
You can use the **Days of the week** setting to set up a "happy hours" scenario, when members can redeem the reward for a lower point price.
### Metadata
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
### Summary
Review the reward configuration before saving.
The summary page displays all configured sections:
* Details
* Spendings
* Timeframe
* Metadata
Use **Go to step** to return to a selected section and make changes before saving the reward.
After reviewing the configuration:
* Use **Save draft** to save the reward without activating it.
* Use **Save and activate** to create and activate the reward.
Once saved, the reward is created. It is listed in the **Rewards** section in **Loyalty hub** in the **Draft** or **Active** state.
## Rewards in the loyalty designer
You can create, assign, and manage rewards directly from the loyalty program designer.
### Rewards section
The **Rewards** section in the designer displays all rewards currently assigned to the program.
Each reward card shows:
* Reward name and status
* Reward type and configuration
* Refundable status
* Stock (starting number of available items)
* Connected point wallet and point cost
Use the edit icon to open the reward configuration. Use the unassign icon to remove the reward from the program.
Use the search icon to find rewards by name within the assigned rewards.
Use **+** in the **Rewards** section header to assign an existing reward or create a new one. Creating a new reward opens a simplified builder where you can configure:
* Reward name
* Reward type and digital reward type
* Connected campaign
* Refundable status
* Spending: point wallet and point cost
* Stock
Select **Advanced options** to open the full reward builder with all configuration options, including spendings with conditions, time frame, and metadata.
### Building blocks panel
The **Building blocks** panel lists all rewards available in the loyalty program. The available rewards are the rewards that have spendings that use the point wallets assigned to the program.
In the **Rewards** section of the panel, you can:
* Browse all rewards and their status.
* Search rewards by name using the search field.
* Filter rewards by assignment status using the **All**, **Not assigned**, and **Assigned** tabs.
* Assign or unassign a reward using the link icon.
* Create a new reward using the **+** icon.
* Edit a reward using the edit icon.
* Delete a reward using the delete icon.
Creating a new reward using **+** opens the same simplified builder available in the **Rewards** section. Select **Advanced options** to open the full reward builder.
### Reward assignment
Use the **Quick assign** button to assign the reward to the loyalty program.
The reward builder window will open, where you can edit the reward.
Define the stock limit, which determines:
* **Unlimited stock** (default): There is an unlimited number of rewards that members can redeem.
* **Stock limit**: Members can redeem the defined number of rewards. Once depleted, members can't redeem more rewards.
## Loyalty reward maintenance
In the **Loyalty rewards** list view, use the **three-dot menu** (⋮) on any reward to:
* **Activate** or **Deactivate** the reward: The available action depends on the current status.
* **Assign to program**: Connect the reward to a loyalty program.
* **Edit**: Open the reward configuration.
* **Delete**: Remove the reward permanently.
Select a reward to open its detail view. The detail view contains four tabs:
* **Dashboard**: Shows the reward configuration details and the loyalty programs the reward is assigned to, along with their stock.
* **Spendings**: Shows the spendings configured for the reward.
* **Activity**: Shows a log of events related to the reward, including event name, event ID, group ID, description, and timestamp.
* **Metadata**: Shows the metadata configured for the reward.
Use the edit icon or **Activate**/**Deactivate** button in the detail view header to edit or change the status of the reward.
## Related features
Loyalty rewards can be used together with the following features to build more advanced loyalty program flows.
Learn how to [create and manage customer segments](/prepare/customer-segments) to define groups of customers who share a selected attribute or behavior.
Customer segments can be used to create tier-based loyalty programs, limit earnings to specific segments, or create segment-based rewards.
# Create point wallets
Source: https://docs.voucherify.io/build/create-point-wallets
Configure and manage point wallets
Point wallets control how points are earned, stored, spent, and expire. Point wallets work like a card definition or a set of rules for loyalty cards that are generated and then assigned to loyalty program members.
Go to **Loyalty hub** > **Point wallets** to **Create point wallet**.
You can also create a point wallet in the loyalty program **Designer** when creating a new loyalty program.
## Create a point wallet
Some settings depend on each other. If something is incompatible, you will see an Action required message.
You can also **Save draft** and finish the point wallet setup later.
### General settings
Define the basic behavior of the point wallet:
* **Type**:
* **Individual**: Points are assigned to individual members.
* **Team** (feature not released yet): Points are assigned to one card that's shared by several members.
* **Allow card balance to go below zero**: Members' point balance can go below zero.
This setting affects refunds and points expiration. Some options, such as revoking points below zero or expiration rules, depend on it.
### Code config
Define how point wallet-related codes are generated:
* **Charset**: Choose a predefined set, for example alphanumeric, or define your own.
* **Code length**: Defines how many random characters the code contains.
* **Pattern**: Create a custom structure using placeholders.
* **#**: Replace with a random character from the selected charset. Overrides the code length.
* **Prefix** and **Postfix**: Optional values added at the beginning or end of the code.
**Code preview** shows an example of a generated code.
The number of possible unique codes depends on the selected charset and code length.
### Points expiration
Define when points expire – they stop being available for use.
Points never expire. No additional setup is required.
Points expire after a defined period from when they are earned.
* **Expiration period**: How long points stay valid after earning.
* **Period unit**: Day (max 90), month (max 12), year (max 5).
* **Expiration rounding**: Round the expiration to the nearest period. Possible settings – **No rounding**, **End of month**, **End of quarter**, **End of half-year**, **End of year**, **End of particular month**.
Points expire on selected dates each year.
Select **Month** and **Day of the month** to **Add date**.
Add at least one date. You can define up to 20 expiration dates.
Points expire after a period of inactivity.
* **Inactivity period**: How long points remain valid without activity.
* **Period unit**: Day (max 90), month (max 12), year (max 1).
Activity types:
* **Earning activity**: Resets the inactivity timer when customers earn points.
* **Spending activity**: Resets the inactivity timer when customers spend points.
* **Custom activity**: Resets the inactivity timer based on selected custom events. You can add up to 20 custom events.
Select at least one activity type. Only the selected activities reset the inactivity timer.
Points expiration is available only when **Allow card balance to go below zero** is disabled. If negative balance is enabled, only **No expiration – points never expire** is available.
Time-related settings in point wallet configuration use the time zone configured in **Project settings**.
### Pending points
Define when earned points become available.
Pending points can't be spent until they're activated. Activation moves points from pending to the active balance.
Points activate immediately after earning.
If pending points are set to **Immediate**, you cannot use **From pending** in **Refunds → Earned points refunds**, because points are activated right away. Choose a different pending points type if you need to revoke points before activation.
Points activate after a defined time from when they are earned.
* **Waiting period**: How long points remain pending before activation.
* **Period unit**: Day (max 90), month (max 12), year (max 1).
Points activate on selected calendar dates.
Select **Month** and **Day of the month** to **Add date**.
Add at least one date. You can define up to 20 activation dates.
Points remain pending after selected events occur and activate after the defined cancellation period passes.
* **Cancellation period**: Defines how long points remain pending before the points are cancelled if the custom event hasn't been triggered.
* **Period unit**: Day (max 90), month (max 12), year (max 1).
Select **Custom event** and use **Add activity** to define which custom events trigger point activation.
Add at least one custom event. You can define up to 20 custom events.
### Earning limits
Control how customers earn points.
Both **Global earning limit** and **Transactions earning limit** can apply at the same time. Global limits can reduce (cap) the points awarded. If a transaction points limit is exceeded, the earn is rejected in full.
Defines the overall limit on points a member can earn.
* **No limit**: Members can earn an unlimited number of points.
* **Limited**: Members can earn points only within the configured limits.
When **Limited** is selected, configure the limit type:
* **Balance-based**: Limits the maximum point balance a member can hold. This is not a lifetime earn total – after points are spent, members can earn again up to the max.
**Max balance**: Defines the maximum balance a member can reach. For immediate pending points, this is the active balance. When pending points are delayed, pending points also count toward the max. Once the max is reached, further earns are reduced or blocked. After the balance drops (for example, after spending), members can earn again.
* **Time-based**: Limits how many points a member can earn within a selected time period. Earns that would exceed the remaining capacity are reduced to what is left in the period.
**Period unit**: Defines the earning period (day, week, month, quarter, year). Periods are calendar periods in the project timezone. For **week**, the period is Monday through Sunday (ISO week).
**Max points per period**: Defines the maximum number of points a member can earn during the selected period. Once reached, the member won't be able to earn more points during that period.
Defines how many points can be earned in a transaction.
* **No limit**: Members can earn an unlimited number of points in one transaction.
* **Limited**: Members can't earn more than the configured transaction limits.
When **Limited** is selected, configure:
* **Max points earned per transaction**: Defines the maximum number of points allowed in a single earn. If the calculated points for that earn exceed this value, the earn is rejected in full (points are not partially awarded up to the max).
* **Min amount spent per transaction**: Defines the minimum transaction amount required to earn points (not supported yet).
### Spending limits
Control how customers spend points (reward purchases and pay with points).
Both **Global spending limit** and **Transactions spending limit** can apply at the same time. For pay with points, the stricter remaining capacity caps how many points can be spent. For reward purchases, exceeding either limit rejects the spend.
Defines the overall limit on how many points a member can spend.
* **No limit**: Members can spend an unlimited number of points.
* **Limited**: Members can spend points only within the configured limits.
When **Limited** is selected, configure the limit type:
* **Spending-based**: Limits the total number of points a member can spend across all transactions.
**Max lifetime spending**: Defines the maximum total number of points a member can spend. Once reached, the member won't be able to spend more points.
* **Time-based**: Limits how many points a member can spend within a selected time period.
**Period unit**: Defines the spending period (day, week, month, quarter, year). Periods are calendar periods in the project timezone. For **week**, the period is Monday through Sunday (ISO week).
**Max points per period**: Defines the maximum number of points a member can spend during the selected period. Once reached, the member won't be able to spend more points during that period.
Defines how many points can be spent in a single transaction.
* **No limit**: Members can spend an unlimited number of points in a single transaction.
* **Limited**: Members can spend points only within the configured transaction limit.
When **Limited** is selected, configure:
* **Max points to spend per transaction**: Defines the maximum number of points a member can spend in a single transaction.
### Pay with points
Configure how customers can use points to pay for orders.
**Enable pay with points** to allow payments using points.
When enabled, define the conversion formula:
* **Amount unit**: Fixed base unit (1 minor currency unit, for example 1 cent). This value cannot be edited.
* **Points needed**: Formula for how many points are required to pay for that unit. Enter a number or a formula.
The formula result defines how many points are needed to pay for 1 amount unit.
For example, `111` means 111 points pay for 1 unit (for example, 1 cent in USD).
You can:
* Enter a formula manually in **Points needed**
* Use **Build formula** to create or edit it in the formula builder (**Formula builder** or **Expression output** tabs)
Use numeric values or functions such as `ORDER_METADATA("property")` to create dynamic conversion rules.
### Return policy
Control how refunds affect points.
**Point refunds** and **Point deduction** are applied separately.
Defines whether points used in a transaction are returned after a refund.
* **Non-refundable**: Spent points are not returned.
* **Refundable**: Spent points can be returned after a refund.
When **Refundable** is selected, configure the refund type:
* **Refund all**: Returns all spent points.
* **Refund by item**: Returns points related only to refunded items (not supported yet).
* **Refund by amount**: Returns points proportionally to the refunded amount (not supported yet).
Defines whether points earned from a transaction are kept or revoked after a refund.
* **Keep points**: Earned points remain unchanged after the refund.
* **Deduct points**: Earned points are removed after the refund.
When **Deduct points** is selected, configure the deduction source:
* **Active balance**: Revokes points from the active balance.
* **Pending points**: Revokes points only from pending points.
When **Active balance** is selected, configure the deduction limit:
* **Prevent negative**: Points are revoked until the balance reaches zero.
* **Allow negative**: Points are revoked even if the balance becomes negative.
Allowing negative balance requires enabling **Allow card balance to go below zero**. If this setting is disabled, **Allow negative** is not available. Revoking from pending requires **Pending points** not set to **Immediate**.
### Metadata
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
### Summary
Review your configuration before saving.
If everything is valid, **Save** becomes available.
If something is incompatible, you will see **Action required**. **Go to step** to return to any section and make changes.
You can also **Save draft** of the point wallet and return to the configuration later.
Once saved, the point wallet is created in an active state and can be used in loyalty programs.
Save and activate point wallet
Saving a point wallet makes it ready to use. However, you won't be able to edit the point wallet configuration with the exception of metadata and pay with points.
If you use **Save draft**, the point wallet is saved in draft status and can be completed later.
## Point wallets in loyalty programs
You can create and manage point wallets directly while working on a loyalty program in the **Designer**.
### Create a point wallet in a loyalty program
Prerequisite: Loyalty program draft
You can create or add point wallets only to a loyalty program that's in a draft state.
In the **Programs**, open a loyalty program. In the **Building blocks** panel, use **+** next to **Point wallets**.
This opens the same point wallet builder used in the **Point wallets** section.
The point wallet is created while you are working inside a program. You can assign it to the program immediately. The point wallet is still saved globally and can be reused.
### Use point wallets in a program
In the program **Designer**, you can assign and manage point wallets directly in the program view.
In the **Building blocks** panel, you can:
* View all available point wallets and their status
* Assign a point wallet to the program
* Create a new point wallet using **+**
* Open a point wallet to view its full configuration and manage its status
In the **Point wallets** section, you can:
* View point wallets assigned to the program
* Edit or unassign a point wallet
* Assign an existing point wallet or create a new one
* Assign a tier structure to a point wallet
Point wallets are global objects, so assigning them to a program does not create a copy. Changes to a point wallet apply everywhere it is used. Unassigning a point wallet removes it from the program but does not delete it.
## Managing point wallets
Go to **Loyalty hub** > **Point wallets**.
After you create a point wallet, it appears in the **Point wallets** section.
Use the **three-dot menu (⋮)** to:
* Activate or deactivate a point wallet
* Edit the point wallet
* Delete the point wallet
Active point wallets can be used in loyalty programs.
Deactivated point wallets remain available but cannot be used until reactivated.
Click on a point wallet to check its configuration details.
## Related features
Point wallets can be combined with the following features to build more advanced loyalty program flows.
You can use [custom events](/prepare/custom-events) to trigger Voucherify logic based on events defined in your integration.
Custom events can be used for segmentation, validation rules, distributions, loyalty automation, and selected event-based configurations.
# Create referral campaign
Source: https://docs.voucherify.io/build/create-referral-campaign
Learn how to create a referral campaign in the Campaign builder
The referral campaign builder guides you through the following steps to launch your program.
Go to **Campaign hub** > **Campaigns** to **Create campaign** and select **Referral codes**.
Campaign draft
If you can't configure the whole campaign in one go, don't worry.
You can **Save draft** of the campaign. Draft campaigns are inactive until their configuration is finished and saved.
If you **Cancel** the campaign builder, you can return to the builder of that campaign by going to **Create campaign** > **Continue work**. However, if in the meantime you've started creating a new campaign, you won't be able to return to the previous one.
That's why it's best to save campaigns as drafts if you need to stop your work on campaign configuration.
## Program size
Start by defining the core identity of your campaign:
1. Enter unique **Campaign name**.
2. Optionally, select a **Category** to group this campaign.
3) Optionally, provide a **Description** for internal reference.
4) Optionally, enable **Customers can join campaign only once** to ensure each customer can own only one referral code in this campaign.
Next, define campaign size:
* Set **Code count** to define how many referral codes are generated when the campaign is created.
* Enable **Auto-increase voucher count** to automatically generate new referral codes when the initial pool is exhausted.
Set **Code generation settings**:
* Define the pattern, format, charset, and other details for your codes.
## Timeframe
You can add the following optional time limitations:
* **Starts on** and **Expires** dates
* **Duration and interval time frame** (for example, every 2 days for 3 hours)
* **Valid days of the week** (for example, only Wednesdays)
* **Valid hours per day** (for example, happy hours between 16:00 and 22:00 every Friday and Saturday)
- Set **Keep valid for a specific amount of time after publishing** to ensure referral codes expire after a defined time once assigned to customers.
## Incentive workflow
Select the conversion event and define if the referral program is single-sided (referrer is rewarded) or double-sided (both referrer and referee are rewarded).
Select the event that marks a referral as successful.
You can select one of the following:
* **Code redemption**\
The referee redeems the referral code (for example, during checkout).
A successful redemption means a successful referral.
* **Custom event**
Prerequisite: Developer setup
Tracking custom events in your system requires sending them to Voucherify through [POST Track custom events](/api-reference/events/track-custom-event) API endpoint.
The referral is confirmed by an API custom event (for example, `subscription_paid`, `social_media_sign_up`).
Select a custom event or create a new one.
Voucherify records a successful referral when it receives the event together with a referral code.
Decide how incentives are distributed in your referral program:
* **Referrer** (single-sided)\
Only the referrer receives a reward.
* **Referrer and referee** (double-sided)\
Both the referrer and the invited customer receive rewards.
If you select **Referrer and referee**, the referee-specific steps will be available later in the builder.
## Referee eligibility
This step includes **Referee reward** panel only when you selected **Referrer and referee** in the **Incentive workflow** step.
If you selected **Referrer**, you can also add a **Validation rule**.
Define how the **referee is rewarded** after a successful referral conversion.
If **Referrer and referee** is selected in the **Incentive workflow** step, select what the invited customer receives:
* **Discount coupon** – apply a discount to the referee’s order.
* **Credits on gift card** – add a balance to the referee’s gift card in an existing gift card campaign.
* **Points on loyalty card** – add loyalty points to the referee's loyalty card in an existing loyalty campaign.
Configure the selected reward type:
* **Discount coupon**
* Define discount type, value, and conditions (validation rule).
* Control when and how the discount is applied to orders.
* **Credits on gift card**
* Define the gift amount.
* Select the target gift card campaign.
* **Points on loyalty card**
* Define the number of loyalty points.
* Select the target loyalty campaign.
The **Validation rule** step is available only for **Credits on gift card** and **Points on loyalty card**. For **Discount coupon**, add a **Validation rule** in the **Conditions** step in the discount builder.
You can also add a **Validation rule** when only the **Referrer** is rewarded.
Optionally, add or create a validation rule to restrict when the referee reward can be granted (for example, new customers only or order value conditions).
For single-sided referral campaigns, it's recommended to set the **Redemptions per customer in a campaign** rule to **less than or equal to 1**. This way, each referee can use a referral code from this campaign only once. Referees won't be able to redeem one code twice or use referral codes from several referrers.
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
## Referrer rewards
**Create tier** to configure rewards for referrers with **referral tiers**.
Select how referrers qualify for rewards:
* **Each unique referee redemption** – reward the referrer for every successful referral.
* **Minimum unique referee redemptions** – reward the referrer after reaching a defined number of successful referrals. You can **Add filter** to create a customer segment that a referrer must be part of to receive a reward.
Add a **Digital** (a discount coupon, credits on a gift card, points on a loyalty card) or **Material** (a product) reward. Optionally, create a new reward.
Add distribution channels that trigger notifications when all reward criteria are met and a reward is assigned to the referrer.
You can configure multiple referral tiers within one campaign.
## Distributions (optional)
Set up automatic messages sent when referral events occur. Messages can be sent to customers or external systems using channels such as email, SMS, webhooks, or integrations.
The distribution builder is preconfigured for the selected event. The only step to configure is **Channels**.
**Add distribution** and select the event:
* **Successfully published** – used when a voucher is successfully published to a customer.
* **Customer was referred** – used when a new customer joins through a referral.
In the distribution builder, **Name distribution**.
Go to **Channels** to **Add channels**. You can add one or more distribution channels.
In **Summary**, review the configuration and **Save** the distribution.
You can add many distributions to a referral program.
## Metadata (optional)
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
By default, the campaign uses **Voucher metadata schema**. This will set metadata for the campaign and its vouchers. If you're editing the campaign, changes made to the metadata will apply only to the vouchers that haven't been redeemed yet and haven't been published to any customers.
Uncheck **Use the voucher's metadata schema** to use campaign metadata schemas. The metadata will apply only to the campaign and not to its vouchers.
## Access settings
Check areas, stores, and all stores to limit the access to the campaign by restricted users and API keys.
Enterprise feature
This step is available for Enterprise clients who have the Areas and stores feature enabled.
Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support).
Read [Areas and stores](/orchestrate/areas-and-stores) to learn more about access settings.
## Summary
Review your configuration if everything's correct. If you see something that needs editing, go back to a given step.
If the setup is correct, click **Save** to launch your campaign.
Editing campaign settings (for example time frame or expiration settings) affects only vouchers that *have not been published or redeemed yet*.
Vouchers that are already *published or redeemed keep their existing settings*.
To change their settings, update the voucher directly.
Campaign calendar
Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
## Related features
Explore additional features to improve referral performance.
Each referral code needs to be published to a referrer before referees can use it. Publication means that a referral code is assigned to a particular customer (referrer).
Learn how you can [publish referral codes](/orchestrate/code-publication).
If you want to build your referral program around a custom event, read the [Custom events](/prepare/custom-events) article first.
Once your campaign is live, you can track its progress in the dashboard. This way you can quickly react when it underperforms and tweak its settings or experiment with your setup.
Dev tools
Devs can use the following tools for campaign tracking:
* [Voucherify Core MCP](/guides/voucherify-core-mcp)
* [Campaign summary API](/api-reference/campaigns/get-campaign-summary)
Even best campaigns can be a target of fraud or exploited by customers who spot weak spots in the promotion setup.
You can stop that from happing by using fraud prevention and tracking tools built in Voucherify.
Learn more about stopping incentive fraud in:
* [Interactive tour](https://www.voucherify.io/product-tours/stop-incentive-fraud).
* [Fraud prevention and tracking](/optimize/fraud-prevention-best-practices) article.
# Create tier structures
Source: https://docs.voucherify.io/build/create-tier-structures
Set up rules that group customers based on their loyalty activity
Tier structures control how you assign customers to tiers and how their tier status changes over time.
## Create a tier structure
Go to **Loyalty hub** > **Tier structures** and select **Create tier structure**.
The tier structure builder informs which steps require your action.
### General settings
Set the basic behavior of the tier structure.
**Name tier structure**: enter a name for the structure.
Uses the customer's current point balance on their loyalty card to determine tier assignment.
Uses the total points earned over a tracking period to determine tier assignment.
When to apply tier change:
* **Immediately**: Updates when the threshold is reached.
* **Next tracking period**: Updates at the start of the next cycle.
**Tracking period value**: Length of the tracking period.
**Period unit**: Day(s), Week(s), Month(s), Year(s). The units are defined by the Project settings (time zone and locale).
**Point wallet**: Select the point wallet used to calculate tiers.
Tying a tier structure to a point wallet that is already active makes the tier structure take effect immediately.
A loyalty program can only have one tier structure assigned to it.
Complete all required fields. If something is missing or invalid, you will see **Action required**.
### Tier levels point-base
Configure tier levels based on the point balance.
This tier level path is optional. Set it up only if you want tiers based purely on point balance. At least one tier must exist across the two tier-level paths (point-based or segment-based) before you can proceed. Any path you configure must cover points without overlaps. However, gaps between tiers are allowed and a final tier with a maximum value instead of unlimited.
Tier levels are shared with the segment-based path. Both count toward the same 100-tier limit. Each tier you create only appears in the path it was created under. A tier added here won't appear in **Tier levels segment-base**, and vice versa.
Use **+ Add tier levels** to add a tier.
For each tier, define:
* **Tier name**: Label of the tier (for example Bronze, Silver, Gold).
* **Minimum value (points)**: Points required to reach this tier. When you add a new tier, this is automatically set to one point higher than the previous tier's **Maximum value (points)**. You can adjust it manually, though.
* **Maximum value (points)**: Upper limit of points for this tier. Leave this field empty to make the tier **Unlimited**. This is only allowed for the highest tier; leaving it empty on any other tier triggers the **Action required** mentioned above.
* **Allow tier downgrade for this level**: Enabled by default. Uncheck to create a VIP tier where members keep their level forever.
* **Point expiration**: Select the point expiration settings for this tier.
* **Inherit from wallet**: The point expiration is inherited from the point wallet configuration.
* **Override expiration**: Set custom point expiration for this tier. If the point wallet expiration is set to **No expiration**, the tier point expiration can be set to any setting (**Immediate expiration**, **Rolling expiration**, **Calendar expiration**, **Sliding expiration**). The points that members earn while in this tier will expire as set. However, if the point wallet expiration setting is not set to **No expiration**, the tier point expiration has to match the point wallet expiration setting or it has to be set to **No expiration**. It can have different details, like different duration or dates, though.
The tier's point range is calculated automatically from its Minimum and Maximum values and shown in the tier's header.
Each tier also has its own **Metadata** section, where you can define custom key/type/value properties, either by adding an unknown property directly or by adding it to the schema.
### Tier levels segment-base
Configure tier levels that also require a [customer segment](/prepare/customer-segments), a group of customers who share a selected attribute or behavior.
This path is optional. Set it up only if you want segment-gated tiers. At least one tier must exist across the two tier-level paths (point-based or segment-based) before you can proceed. Any path you configure must cover points without overlaps. However, gaps between tiers are allowed and a final tier with a maximum value instead of unlimited.
Tier levels are shared with the point-based path. Both count toward the same 10-tier limit, and each tier you create only appears in the path it was created under. A tier added here won't appear in **Tier levels point-base**, and vice versa.
Use **+ Add tier levels** to add a tier.
For each tier, define:
* **Tier name**: Label of the tier (for example Bronze, Silver, Gold)
* **Minimum value (points)**: Points required to reach this tier. When you add a new tier, this is automatically set to one point higher than the previous tier's **Maximum value (points)**. You can adjust it manually, though.
* **Maximum value (points)**: Upper limit of points for this tier. Leave this field empty to make the tier **Unlimited**. This is only allowed for the highest tier; leaving it empty on any other tier triggers the **Action required** mentioned above.
* **Customer segment**: Required for every tier in this path. The customer must meet both the point range and belong to the selected segment. You can select different segments for each tier.
* **Allow tier downgrade for this level**: Enabled by default. Uncheck to create a VIP tier where members keep their level forever.
* **Point expiration**: Select the point expiration settings for this tier.
* **Inherit from wallet**: The point expiration is inherited from the point wallet configuration.
* **Override expiration**: Set custom point expiration for this tier. If the point wallet expiration is set to **No expiration**, the tier point expiration can be set to any setting (**Immediate expiration**, **Rolling expiration**, **Calendar expiration**, **Sliding expiration**). The points that members earn while in this tier will expire as set. However, if the point wallet expiration setting is not set to **No expiration**, the tier point expiration has to match the point wallet expiration setting or it has to be set to **No expiration**. It can have different details, like different duration or dates, though.
The tier's point range is calculated automatically from its Minimum and Maximum values and shown in the tier's header.
Each tier also has its own **Metadata** section, where you can define custom key/type/value properties, either by adding an unknown property directly or by adding it to the schema.
### Tier expiration
Choose how a tier expires.
Tier ends instantly when member criteria changes.
Tier is valid for a set number of days from entry:
* **Duration**: Number of periods the tier stays valid.
* **Period unit**: Day(s), Month(s), Year(s).
The **Fixed duration** is set to 30 days in a **Point balance**-based tier structure. A member earns 150 points and reaches the Silver tier on 20 July. On 25 July, the member then spends their points and falls to the Bronze tier. Then, the **Fixed duration** setting starts counting 30 days from 20 July (the day when the member reached the Silver tier) and the tier will expire on right on midnight 00:00 of the 20 August.
Tier expires on a set date each year:
* **Expiry date (MM-DD)**: Pick a day and month from the calendar. This field is required. You can pick up to 20 expiry dates.
Currently unsupported.
Follow [Voucherify release notes](/changelog/changelog) for latest updates.
Expires the tier if no qualifying action occurs within a set number of days.
### Tier downgrade configuration
Choose how tier levels are reassessed when a member no longer qualifies.
Members keep their current tier when expiration triggers or they no longer qualify for the current tier. This means that members never move to a lower tier.
Customer is moved to the highest eligible tier based on their current performance.
When you select **Multi-level downgrade**, you can enable **Grace period before downgrade**, a waiting period after disqualification before the downgrade is enforced. When enabled, set:
* **Grace period**: Length of the delay.
* **Unit**: Day(s), Month(s), Year(s).
* **Round up grace period**: Rounds the delay to the end of the selected unit (unchecked by default).
The **Multi-level downgrade** is set in a **Point balance**-based tier structure. A member earns 250 points and reaches the Gold tier on 20 July. On 25 July, the member spends 200 points, so their balance is 50 points, which is in the range of the Bronze tier. The member will be downgraded to the Bronze tier immediately.
However, if there's a grace period of one month, the member will not be downgraded to the Bronze tier until for one month after the expiration date (19 August, 23:59:59). If the grace period is rounded up to the end of the month, the member will not be downgraded to the Bronze tier until 31 August, 23:59:59.
A customer can only be downgraded one tier at a time during each evaluation.
When you select **Single-level downgrade**, you can enable **Grace period before downgrade**, a waiting period after disqualification before the downgrade is enforced. When enabled, set:
* **Grace period**: Length of the delay.
* **Unit**: Day(s), Month(s), Year(s).
* **Round up grace period**: Rounds the delay to the end of the selected unit (unchecked by default).
Expiration and downgrade are configured independently. Expiration controls when tier levels are re-evaluated. Downgrade controls how members move to a lower tier after expiration.
### Metadata
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
### Summary
Review your configuration before saving.
The summary lists a card for each step, showing condensed details of your configuration. Use **Go to step** on any card to return to that section and make changes.
**Save draft** and **Save and activate** both become available only once there's no outstanding **Action required** anywhere in the configuration. **Save draft** saves the structure without activating it. **Save and activate** saves it and activates it immediately. Once activated, you can't edit the tier structure and its tiers with the exception of name and metadata.
The tier structure is now created and can be used in a loyalty program.
## Tier structures view
The **Tier structures** view lists all configurations created in your project.
Each structure appears with its status and key settings.
### Overview
This list shows key details of each tier structure.
* **Status**: **Draft** (not yet activated) or **Active**.
* **Name**: Name of the tier structure.
* **Type**: The tier type configured in **General settings**.
* **Point wallet**: The wallet the structure is linked to.
* **Expiration**: The expiration model configured in **Tier expiration**, shown as a short label (for example **Calendar** for Calendar Expiry), or a dash if none is set.
* **Downgrade**: The downgrade behavior configured in **Tier downgrade configuration**, or a dash if none is set.
* **Tier levels**: Number of defined tiers, or a dash if none are configured.
* **Loyalty programs**: Programs where the structure is assigned, or a dash if none.
Use **Edit** or **Delete** from the ⋮ menu on any row to manage a structure.
### Structure details
Select a structure name to open its details panel.
The panel header shows the structure's ID, creation date, and status, along with **Edit** and close controls. If the structure is in **Draft** status, an **Activate** button also appears; activating it makes it available to be assigned to a point wallet, and if that point wallet is already active, tier assignments can start applying immediately.
Once a structure is **Active**, it cannot be deactivated in the UI or through the API.
The panel has three tabs:
* **Dashboard**: Summary cards for **General settings**, **Tier levels**, and **Tier expiration** (which also includes the downgrade configuration).
* **Activity**: A log of events for the structure, such as its creation and tier creation events.
* **Metadata**: The structure's metadata, shown as raw JSON.
Dashboard cards shown: General settings, Tier levels, Tier expiration (includes downgrade).
## Using tier structures in programs
Assign a tier structure to a point wallet from within the program Designer.
### Adding a tier structure
Each point wallet card shows a **No tier structure assigned** placeholder if none is set. Selecting it opens a search field where you can pick an existing tier structure or select **+ Create new** to create one on the spot.
You can assign only one tier structure per program. If another point wallet in the same program already has one assigned, you'll see a message telling you to unassign it there first.
### How it appears in the program
Once assigned, the point wallet card shows the structure's name, status, a condensed summary (type, expiration, downgrade, and tier level count), and its configured tiers.
### Removing a tier structure
Select **Unassign from program** next to the assigned structure on the wallet card. This only removes the assignment; to delete the tier structure itself, go to the **Tier structures** overview list.
Once a tier structure is assigned to an active point wallet in an active loyalty program, it cannot be unassigned.
## Related features
Tier structures can be used together with the following features to build more advanced loyalty program flows.
Learn how to [create and manage customer segments](/prepare/customer-segments) to define groups of customers who share a selected attribute or behavior.
Customer segments can be used to create tier-based loyalty programs, limit earnings to specific segments, or create segment-based rewards.
# Discount code import
Source: https://docs.voucherify.io/build/discount-code-import
Learn how to import codes to Voucherify
If you need to share codes from other sources with Voucherify, you can handle this scenario using the **Import CSV** tool in the Dashboard. The tool enables you to import:
* Generic coupons
* New unique coupons to a campaign.
* Existing coupons to update them.
When importing codes to a campaign, the system applies two simultaneous limits for the import file:
* **Code count limit**: Up to **100,000** codes.
* **File size limit**: Up to **10 MB** CSV file size.
The import will stop when **whichever limit hits first**.
Note that **100,000 codes** is the overall campaign code limit. If the campaign already contains codes (e.g., 50,000 codes), only the remaining capacity (e.g., 50,000 codes) will be imported to maintain the 100,000 total code limit.
Important
* The start and expiration dates in the CSV file should be provided in compliance with the **ISO 8601** standard, for example, `2020-03-11T09:00:00.000Z`.
* CSV columns mapped to custom attributes will be added as code metadata. The number of custom attributes you can import as metadata is unlimited.
* You cannot import two identical codes to a single Voucherify project.
* When importing existing incentives (discount coupons, referral codes, loyalty cards, or gift cards) into a campaign, only two fields can be updated: the **active** status (`true/false`) and the **category**. All other attributes remain unchanged.
## Preparing CSV file for generic coupons
Use these fields when importing **standalone (generic) discount coupons**. Generic coupons are not assigned to a campaign and work independently.
Use the CSV generic coupon file template.
### Required fields
* **Code**\
A unique discount coupon code.\
You cannot import two identical codes into a single Voucherify project.
* **Voucher Type**\
Defines the voucher type.\
For discount coupons, the value must be `DISCOUNT_VOUCHER`.
* **Value**\
The discount value.\
Must be provided as an integer number.
* **Discount Type**\
Defines how the discount value is interpreted.\
Supported values:
* `AMOUNT` – fixed amount discount
* `PERCENT` – percentage discount
* `FIXED` – fixed price
* `UNIT` – discount applied per item unit
### Optional fields
* **Discount effect**\
Defines how the discount is applied to the order.\
Supported values:
* `APPLY_TO_ORDER` – applies the discount to the entire order total
* `APPLY_TO_ITEMS` – applies the discount to selected items only
* `APPLY_TO_ITEMS_PROPORTIONALLY` – distributes the discount proportionally across item values
* `APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY` – distributes the discount proportionally based on item quantities
* `APPLY_TO_ITEMS_BY_QUANTITY` – applies the discount to a specific number of eligible items
For effects that contain `_ITEMS_`, a validation rule is required.\
Without a validation rule, the discount will not be applied to products.
* **Validation rule ID**\
The ID of a validation rule that governs how and when the coupon can be redeemed.\
The rule is automatically applied to the imported coupon.
* **Category**\
A custom tag assigned to the coupon.\
Categories help you filter and organize coupons in the Dashboard.
* **Active**\
Enables or disables the coupon.\
Accepted values: `TRUE` or `FALSE`.\
An inactive coupon cannot be redeemed, even if it is within its validity timeframe.
* **Start date**\
The date when the coupon becomes valid.\
It must follow the ISO 8601 format, for example: `2022-09-19T00:00:00.000Z`.
* **Expiration date**\
The date when the coupon expires.\
It must follow the ISO 8601 format, for example: `2022-11-30T00:00:00.000Z`.
* **Redeemed quantity**\
The number of times the coupon has already been redeemed.\
If omitted, the value defaults to `0`.
* **Redeemed amount**\
The total discount amount already redeemed using this coupon.
* **Redemption limit**\
The maximum number of redemptions allowed.\
If omitted, the redemption limit is set to unlimited.
* **Additional info**\
Any additional information you want to store with the coupon.\
This field is informational only.
* **Formula**\
A dynamic discount formula applied to the coupon.\
Provide the *Expression Output* of an existing formula.
* **Metadata (custom attributes)**
Metadata allows you to add custom information to Voucherify objects. There are two ways to handle it:
* **Metadata (Schema)**: These are fields you define in **Project settings** > **Metadata schema**. You choose the data type (like string or number) and if the field is mandatory. This ensures your metadata is consistent.
* **Metadata (Unknown)**: These are fields sent to Voucherify without being defined first (through the API, imports, or manual entry). They are always treated as simple text strings. They are useful for one-time metadata, but they do not support advanced filtering or strict validation.
Fields other than the ones listed above will not be imported. Even if you provide them, they will be skipped.
These codes will function as standalone discount coupons, independent of a campaign.
### Import generic coupons
Go to **Campaign hub** > **Campaigns** and **Import CSV**.
Webhook sendout prerequisite
While importing, you can additionally select the checkbox to **Create a webhook sendout for the vouchers created and updated during the import**. This triggers a [Voucher created](/api-reference/voucher/created) or [Voucher updated](/api-reference/voucher/updated) webhook when the coupons are processed.
To enable webhook sendout during the voucher import, first configure webhooks in **Project settings** > **Webhooks**. Select the `voucher.created` and `voucher.updated` events for the sendout to work.
Read [Project settings webhooks](/api-reference/project-settings-webhooks) to learn more about configuring webhooks.
Upload your prepared CSV file.
Once uploaded, you'll see an overview of first rows and columns of the file.
In **Map Fields**, select for each CSV column:
* **Do not map** to skip that column.
* **Voucherify fields** to **Select** Voucherify properties, like **Code**, **Voucher type**, and so on.
* **Metadata (Schema)** to map a given column to custom attributes that are defined for vouchers.
* **Metadata (Unknown)** to map to an undefined custom attribute key.
Once ready, **Import** and wait for notification when the import is complete.
For large imports, the process can take a significant amount of time.
## Preparing CSV file for campaign discount coupons
Import coupons to campaign prerequisite
If you don't have a campaign for your codes yet, [create a discount coupon campaign](/build/create-discount-coupons) first.
Use these fields when importing discount coupons **into an existing campaign**.\
Imported coupons inherit all campaign settings unless explicitly overridden.
Use the CSV discount coupon file template.
### Required fields
* **Code**\
A unique discount coupon code.
### Optional fields
* **Active**\
Enables or disables the coupon.\
Accepted values: `TRUE` or `FALSE`.
Import behavior:
* If the campaign is **Active** and the `active` field is omitted, imported coupons are set to `TRUE`.
* If the campaign is **Expired** and the `active` field is omitted, imported coupons are set to `FALSE`.
* **Category**\
A custom tag assigned to the coupon for filtering and organization.
* **Redeemed quantity**\
The number of times the coupon has already been redeemed.
* **Start date**\
The date when the coupon becomes valid.\
Must follow the ISO 8601 format.
* **Expiration date**\
The date when the coupon expires.\
Must follow the ISO 8601 format.
* **Metadata (custom attributes)**
Metadata allows you to add custom information to Voucherify objects. There are two ways to handle it:
* **Metadata (Schema)**: These are fields you define in **Project settings** > **Metadata schema**. You choose the data type (like string or number) and if the field is mandatory. This ensures your metadata is consistent.
* **Metadata (Unknown)**: These are fields sent to Voucherify without being defined first (through the API, imports, or manual entry). They are always treated as simple text strings. They are useful for one-time metadata, but they do not support advanced filtering or strict validation.
Metadata import behavior:
* If metadata columns are omitted, the coupon inherits the campaign’s metadata.
* If metadata columns are added and mapped, only those specific fields are overridden.
* Metadata that is not mapped remains unchanged.
Fields other than the ones listed above will not be imported. Even if you provide them, they will be skipped.
All unmapped attributes will inherit the campaign’s default settings as well as validation rules, time frame, redemption limits, and so on.
### Import discount coupons to a campaign
In **Campaign hub** > **Campaigns**, go to the discount campaign where you want to import the coupons. In the top right corner, use the three-dot menu to **Import CSV file**.
Upload your prepared CSV file.
Once uploaded, you'll see an overview of first rows and columns of the file.
In **Map Fields**, select for each CSV column:
* **Do not map** to skip that column.
* **Voucherify fields** to **Select** Voucherify properties, like **Code**, **Voucher type**, and so on.
* **Metadata (Schema)** to map a given column to custom attributes that are defined for vouchers.
* **Metadata (Unknown)** to map to an undefined custom attribute key.
Once ready, **Import** and wait for notification when the import is complete.
For large imports, the process can take a significant amount of time.
New discount coupons will be visible in the **Vouchers** tab in the detailed campaign view.
# Discount campaign overview
Source: https://docs.voucherify.io/build/discount-promotion-overview
Understand the core concepts and workflow of building discount programs in Voucherify
Discount campaigns allow customers to receive financial benefits, such as percentage discounts, fixed amounts off, or free shipping.
Voucherify manages these incentives through two primary mechanisms: **Discount coupons**, which require a code, and **Cart promotions**, which apply automatically based on cart contents.
Learn how discount campaigns work–from generating unique bulk codes to setting up automatic, tier-based promotions.
## Key discount concepts
The following concepts are key for understanding the discount engine.
A code that a customer must enter to receive a benefit. Coupons are best used when you want to track individual customer actions or limit the discount to a specific audience.
A discount applied automatically when a customer's cart meets specific criteria. No code is required from the customer.
A single, standalone code (for example, `SUMMER20`) shared by multiple customers. Everyone uses the same phrase to redeem the discount.
A set of unique, random codes (for example, `s9-RaNd0m`) generated in a batch. Each code is unique to a specific customer or interaction, allowing for precise tracking.
The conditions that must be met for a discount to be valid. These can include order volume, customer segments, specific products, or time frames.
Levels of benefits within a single cart promotion campaign. For example, you can set up a rule where spending \$50 grants 5% off, while spending \$100 grants 10% off.
The successful application of a discount to an order. This process records the usage in the dashboard and updates the campaign budget or code usage limits.
The mechanism for delivering coupon codes to end customers via email, SMS, or web widgets. This is required for coupon campaigns but skipped for cart promotions.
Assigning a discount coupon to a given customer.
## Discount workflow
Voucherify supports every step of the discount campaign lifecycle.
Build your campaign mechanics, define **Validation rules**, and set the discount value in the **Dashboard**.
Assign (publish) coupon codes to customers. You can send them directly or expose them via your frontend. **Cart promotions** are active immediately and don't require distribution.
When a customer enters a code or updates their cart, Voucherify validates the request against your rules. If valid, the discount is applied (redeemed) to the order total. Depending on your settings, a coupon will be used up here.
Track the performance of your discount campaigns using real-time reports to understand which codes or rules drive the most sales.
# Discount types and effects
Source: https://docs.voucherify.io/build/discount-types-and-effects
Learn about various discount types and effects
Use the Voucherify discount builder to set up discount coupons or discount promotion tiers in discount campaigns. The discount configurator also helps you configure discounts by showing examples of how particular discount effects apply to a cart.
## Glossary
Review these coupon-related definitions before creating coupon campaigns in the Voucherify dashboard.
Validation rules define limits and conditions for incentives. Voucherify checks these rules during redemption to confirm the interaction is valid.
The discount category determines the scope and target of the promotion. Voucherify supports **Order discount**, **Products discount**, **Rewards**, and **Free shipping** categories.
The discount value represents the quantitative monetary amount, percentage, or unit count that the system deducts from a customer's order during a single redemption.
The discount type determines the logic for applying the deduction to a customer's cart. The available discount types vary depending on the selected **Discount category**.
## Discount configurator
With the discount configurator, you can set discounts in various Voucherify campaigns.
In the first screen of the discount configurator, you can select a discount category:
1. [Order discount](#order-discount-effects)
2. [Product discounts](#product-discount-effects)
3. [Rewards](#reward-effects)
4. [Free shipping](#free-shipping)
When you select a discount category, the configurator of a particular discount category opens and it includes the following sections; different discount categories will have different sections:
1. Discount step – configure the discount type and other details.
2. [Conditions](#conditions-and-validation-rules) step – configure validation rules (optional).
3. [Discount types](#discount-types) – different in particular discount categories.
4. [Discount value](#dynamic-discount-values) – static or dynamic; build formula to create a dynamic discount.
5. Discount maximum limit – available in some discount types; limits how much discount can be applied.
6. Additional discount configuration – in this case, configuration of a product discount, which covers products or collections, application rules, caps, and excluded products.
## Discount types
Campaign Manager supports order discount, products discount, rewards, and free shipping.
* **Order discount**
* **Amount discount**: Apply to whole cart
* **Percent discount**: Apply to whole cart
* **New price**: Apply to whole cart
* **Products discount**
* **Amount discount**: Apply the discount to item subtotal
* **Amount discount**: Apply the full discount to each item unit
* **Amount discount**: Split the discount proportionally to amount
* **Amount discount**: Split the discount proportionally to quantity
* **Percent discount**: Apply the discount to item subtotal
* **New price**: Apply the discount to item subtotal
* **Rewards**
* **Free products**: Add missing order items to match total discount units count
* **Free products**: Always add new units items
* **Free products**: Add many order items
* **Upgrade bonus**: Replace order items
* **Free shipping**
* **Free products**: Add missing order items to match total discount units count
### Amount discount
This discount defines an amount in any currency that will be subtracted from the whole cart or product, for example, \$20 or €10 off. You can set the currency in the [Project Settings](/manage/project-settings).
The amount can be modified with additional discount limits.
Discount currency
The project currency controls how discount amounts are displayed in the dashboard. Voucherify’s API is currency-agnostic, so changing the project currency does not change how discounts are calculated.
For multi-currency scenarios, use metadata, such as order or customer currency, together with a dynamic discount formula to calculate the discount value at redemption time.
### Percent discount
This discount defines a percentage that will be subtracted from the whole cart or the product, for example, 10% or 50% off. The total discount amount is calculated during the validation, and it is a difference between the initial price and the amount calculated based on the percent value.
The following additional discount limits can be applied to secure the campaign budget:
* **Maximum discount amount**
* **Maximum discount amount combined for all order lines**
### New price
This discount defines a fixed amount for:
* **The whole cart** – the discount value is calculated during the validation as a difference between the total amount of the customer's order and the new price.
* **Particular products** – the discount is applied to item subtotal. The total discount amount is calculated during the validation and it is a difference between the initial item price and the new item price
### Free products
Free products enable you to offer items from your inventory for free. First, you need to decide on the discount effect.
Then, you need to decide which product you want to add for free and in what quantity.
Please note that this type of discount is based on the products added to the Products section in your dashboard. If you haven't synced your inventory yet, please follow the [Manage products](/prepare/products) guide first.
### Free shipping
You can also offer your customers free shipping. The discount is based on the Free products: Add missing order items to match the total discount units count discount type, and it cannot be edited.
### Dynamic discount values
For percent, amount, new price, and free products, you can set a fixed discount value or use a formula builder to create a dynamic discount expression. Formulas with mathematical and logical operators assign a dynamic discount value. Discount value will be calculated during redemption based on the provided formula and metadata values. Read more in the [Dynamic discount value formula builder](/optimize/dynamic-formula-builder) section.
## Order discount effects
These discounts are applied to the whole cart, which means the sum of all products in the order (total order amount). Three discount types can be applied:
* [Amount](#amount-discount)
* [Percent](#percent-discount)
* [New price](#new-price)
## Product discount effects
Product discounts determine how discounts are, or are not, applied to individual [products or collections](/prepare/products). You can also choose [discounted products and their effects](#choosing-discounted-products) and, in some cases, [additional caps or limitations](#discounted-product-limits-–-capped-by).
These product limits are applied as [validation rules](#validation-rules-and-product-discounts), which can be reused in the future. In the Conditions step, use the Configured Options Only option to use only the product limits. To add more validation rules, click With Rules to search for an existing validation rule or create a new one with the plus button. If you are going to reuse an existing rule, Voucherify will clone the rule, so its original configuration will not be overwritten.
Check this sample order below. It will be used in the examples of different effects below:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 |
| Adventure Poster | \$15 | 3 | \$45 |
| Adventure T-shirt | \$20 | 3 | \$60 |
| Star Thermal Bottle | \$25 | 2 | \$50 |
| Order amount before discounts | | | \$175 |
| Total discount | | | \$0 |
| Total amount | | | \$175 |
### Amount discount: Apply the discount to item subtotal
This effect applies the discount to the product order lines.
This effect can be combined with an additional discount limit – **Maximum amount combined for all order lines**.
Unroll a sample order with a \$10 discount coupon applicable to Adventure-branded items:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 -\$10 |
| Adventure Poster | \$15 | 3 | \$45 -\$10 |
| Adventure T-shirt | \$20 | 3 | \$60 -\$10 |
| Star Thermal Bottle | \$25 | 2 | \$50 -\$0 |
| Order amount before discounts | | | \$175 |
| Total discount | | | -\$30 |
| Total amount | | | \$145 |
### Amount discount: Apply the full discount to each item unit
This effect applies the discount to each product unit.
If you select individual products or collections for a discount, you can further define [additional cap limits](#discounted-product-limits-–-capped-by).
This effect can be combined with an additional discount limit – **Maximum amount combined for all order lines**.
Unroll a sample order with a \$10 discount coupon applicable to Adventure-branded items:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 -\$20 |
| Adventure Poster | \$15 | 3 | \$45 -\$30 |
| Adventure T-shirt | \$20 | 3 | \$60 -\$30 |
| Star Thermal Bottle | \$25 | 2 | \$50 -\$0 |
| Order amount before discounts | | | \$175 |
| Total discount | | | -\$80 |
| Total amount | | | \$95 |
### Amount discount: Split the discount proportionally to amount
This effect splits and applies the discount to the chosen items proportionally to their share in the total discounted items amount.
Unroll a sample order with a \$10 discount coupon applicable to Adventure-branded items:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 -\$1.6 |
| Adventure Poster | \$15 | 3 | \$45 -\$3.6 |
| Adventure T-shirt | \$20 | 3 | \$60 -\$4.8 |
| Star Thermal Bottle | \$25 | 2 | \$50 -\$0 |
| Order amount before discounts | | | \$175 |
| Total discount | | | -\$10 |
| Total amount | | | \$165 |
#### How to calculate the discount per item?
This effect splits the discount proportionally among the discounted products per line item. Each product is counted as an individual line item, whether there is one or multiple units of the product. In the example above:
* The order contains 4 order lines: mug, poster, t-shirt, and thermal bottle.
* The mug, poster, and t-shirt are discounted.
* The discount applied to the mug (\$1.6):
* *10 discount value* × (*20 total amount for the mugs* / (*20 total amount for the mugs* + *45 total amount for the posters* + *60 total amount for the t-shirts*)).
* The discount applied to the posters (\$3.6):
* *10 discount value* × (*45 total amount for the posters* / (*20 total amount for the mug* + *45 total amount for the poster* + *60 total amount for the t-shirts*)).
* The discount applied to the t-shirts (\$4.8):
* *10 discount value* × (*60 total amount for the t-shirts* / (*20 total amount for the mugs* + *45 total amount for the posters* + *60 total amount for the t-shirts*)).
### Amount discount: Split the discount proportionally to quantity
This effect splits and applies the discount to the chosen items proportionally to their share in the total discounted items quantity per line item. Each product unit will be counted as an individual line item. In the case of multiple product units in the line item, the quantity will be higher, and therefore, the proportional discount by quantity will also be higher.
Unroll a sample order with a \$10 discount coupon applicable to Adventure-branded items:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 -\$2.5 |
| Adventure Poster | \$15 | 3 | \$45 -\$3.75 |
| Adventure T-shirt | \$20 | 3 | \$60 -\$3.75 |
| Star Thermal Bottle | \$25 | 2 | \$50 -\$0 |
| Order amount before discounts | | | \$175 |
| Total discount | | | -\$10 |
| Total amount | | | \$165 |
#### How to calculate the discount per item?
This effect splits the discount proportionally among the discounted product units per line item. Each product will be counted as an individual line item, whether there is one or multiple units of the product. In the example above:
* The order contains 4 order lines: mug, poster, beanie, and thermal bottle.
* The mugs, posters, and t-shirts are discounted.
* The discount applied to the mugs (\$2.5):
-\$10 discount value × (2 as the total quantity of mugs / (2 as the total quantity of mugs + 3 as the total quantity of posters + 3 as the total quantity of t-shirts)).
* The discount applied to the posters (\$3.75):
-\$10 discount value × (3 as the total quantity of posters / (2 as the total quantity of mugs + 3 as the total quantity of posters + 3 as the total quantity of t-shirts)).
* The discount applied to the t-shirts (\$3.75):
-\$10 discount value × (3 as the total quantity of t-shirts / (2 as the total quantity of mugs + 3 as the total quantity of posters + 3 as the total quantity of t-shirts)).
### Percent discount: Apply the discount to item subtotal
This effect applies the discount to the product order lines.
This effect can be combined with additional discount limits – **Maximum discount amount** and **Maximum amount combined for all order lines**. For selected products or collections, you can further define additional cap limits.
Unroll a sample order with a 10% discount coupon applicable to Adventure-branded items:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 -\$2 |
| Adventure Poster | \$15 | 3 | \$45 -\$4.5 |
| Adventure T-shirt | \$20 | 3 | \$60 -\$6 |
| Star Thermal Bottle | \$25 | 2 | \$50 -\$0 |
| Order amount before discounts | | | \$175 |
| Total discount | | | -\$12.5 |
| Total amount | | | \$162.5 |
### New price discount: Apply the discount to item subtotal
This effect applies a new price to products or product collections.
Define which products or collections will have new prices when redeeming the discount. The total discount amount is calculated during the validation, and it is a difference between the initial item price and the item price set in the discount settings.
This effect can be combined with additional discount limits – **Max units per order item** and **Max units combined for all matched order lines**.
Unroll a sample order with a new price set to \$10 applicable to Adventure-branded items:
| Product | Unit price | Quantity | Price and discount |
| ----------------------------- | ---------- | -------- | ------------------ |
| Adventure Mug | \$10 | 2 | \$20 -\$0 |
| Adventure Poster | \$15 | 3 | \$45 -\$15 |
| Adventure T-shirt | \$20 | 3 | \$60 -\$30 |
| Star Thermal Bottle | \$25 | 2 | \$50 -\$0 |
| Order amount before discounts | | | \$175 |
| Total discount | | | -\$45 |
| Total amount | | | \$130 |
### Choosing discounted products
In the product discounts, you can choose the products covered by the discounts:
* Each product – apply the discount to all products, except for the products or collections added in the excluded products section.
* Selected products – add products or collections that are covered by the discount, except for the products or collections added in the excluded products section.
* Excluded products – add products or collections that are NOT covered by the discount. The discount will not be applied to the selected items even if the item is included in a discounted collection.
You can further define how discounts are applied and limited with:
* [Application rules](#application-rules)
* [Caps](#discounted-product-limits-–-capped-by)
* [Conditions (validation rules)](#validation-rules-and-product-discounts)
The defined selected and excluded products are included in validation rules which can be reused in the future.
Product SKUs
If the chosen product has SKUs defined, the new price will be set for the product and all product SKUs that are passed in a redemption request.
## Reward effects
Prerequisite
This type of discount is based on the items added to the Products section in the Voucherify Dashboard. If you have not uploaded your inventory yet, follow the [Products and Product Collections](/prepare/products) guide first.
The reward category adds a defined quantity of free items from the product inventory to the customer’s cart for free.
### Add missing order items to match total discount units count
This effect adds items to the cart only if a customer has fewer free items than offered by the code (the number of the items in the cart is lower than the unit value).
For example, the code gives two free t-shirts:
* If the customer does not have the t-shirt in the cart, then free t-shirts will be added to the order and they will be discounted full-price.
* If the customer has one t-shirt in the cart, then one t-shirt will be added to the order and both t-shirts will be discounted full-price.
* If a customer already has two t-shirts in their cart, then the number of t-shirts already matches the unit value. After applying the code, no extra t-shirts will be added but both t-shirts will be discounted full-price.
### Always add new units items
This effect adds items to the cart in the number defined by the unit quantity.
For example, the code adds two free t-shirts:
* If the customer does not have the t-shirt in the cart, then two t-shirts will be added to the order and they will be discounted full-price.
* If the customer has any number of t-shirts in the cart, then two t-shirts will be added to the order but only those two t-shirts will be discounted full-price.
### Add many order items
This effect adds multiple items to the cart, each with a custom effect: either [Add missing order items to match total discount units count](#add-missing-order-items-to-match-total-discount-units-count) or [Always add new units items](#always-add-new-units-items).
### Upgrade Bonus: Replace order items
This effect replaces one order item or an order item from a selected collection with another order item in the defined quantity per replaced unit.
For example, the code can replace a medium-sized coffee with a large coffee.
You can further define [additional cap limits](#discounted-product-limits-–-capped-by):
* **Max units per order item** – the minimum value must be 1.
* **Max units combined for all matched order lines** – the minimum value must be 1.
You can also add [Application Rules](#application-rules).
Unroll a sample order with a replaced one Adventure T-shirt (cheaper product) with one Adventure T-shirt, Limited Edition (more expensive product):
| Product | Unit price | Quantity | Price and discount |
| ---------------------------------- | ---------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------- |
| Adventure T-shirt | \$20 | 3 items in the cart
−1 replaced item
–
2 total quantity | \$60
-\$20
–
\$40 |
| Adventure T-shirt, Limited Edition | \$25 | 0 items in the cart
+1 bonus item
–
1 total quantity | \$0
+\$25
–
\$25 -\$20 = \$5 discount amount
\$20 |
| **Order amount before discounts** | | | **\$60** |
| **Total discount** | | | **\$5 bonus** |
| **Total amount** | | | **\$60** |
The discount is calculated as the difference between the amount of the added order items and the amount of the replaced order items. This makes the discount shown as a bonus while the total amount stays the same.
Unroll a sample order with a replaced one Star Thermal Bottle (more expensive product) with one Adventure Mug (cheaper product):
| Product | Unit price | Quantity | Price and discount |
| --------------------------------- | ---------- | ---------------------------------------------------------------------- | -------------------------------- |
| Star Thermal Bottle | \$25 | 3 items in the cart
−1 replaced item
–
2 total quantity | \$75
-\$25
–
\$50 |
| Adventure Mug | \$10 | 0 items in the cart
+1 bonus item
–
1 total quantity | \$0
+\$10
–
\$10 |
| **Order amount before discounts** | | | **\$75** |
| **Total discount** | | | **\$0** |
| **Total amount** | | | **\$60** |
Because the price of the Adventure Mug is lower than the price of the Star Thermal Bottle, no discount is calculated. However, the total amount is lower than the order amount before discounts, because the price of the replacement item – Adventure Mug – is lower than the price of the replaced item – Star Thermal Bottle.
Unroll a sample order with a replaced one Star Thermal Bottle (more expensive product) with three Adventure Mugs (cheaper products whose price in total is higher than the price of the replaced item):
| Product | Unit price | Quantity | Price and discount |
| --------------------------------- | ---------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------- |
| Star Thermal Bottle | \$25 | 3 items in the cart
−1 replaced item
–
2 total quantity | \$75
-\$25
–
\$50 |
| Adventure Mug | \$10 | 0 items in the cart
+3 bonus items
–
3 total quantity | \$0
+\$30
–
\$30 -\$25 = \$5 discount amount
\$25 |
| **Order amount before discounts** | | | **\$75** |
| **Total discount** | | | **\$5 bonus** |
| **Total amount** | | | **\$75** |
The discount is calculated as the difference between the amount of the added order items (three items with a price of 30 in total) and the amount of the replaced order items (one item with a price of 25). This makes the discount shown as a bonus while the total amount stays the same.
## Free shipping
This discount category adds a free shipping discount.
## Bundle
Bundles let you combine multiple products into a single discount offer. You can define how discounts apply to the products in the bundle or to the entire order.
You can add a bundle discount when configuring the Discount value step in a campaign or promotion.
Click **+ Add discount** > **Bundles**, and choose one of the available bundle types.
**Read the [detailed guide](/build/product-bundles) about bundles in Voucherify.**
### General rules
* Bundles can be created only within Discount Campaigns, Referrals, or Promotions.
* Bundles can be edited within a campaign or promotion tier.
* The bundle configuration dialog includes three steps:
* Bundled items: Set up the bundle products or product collections and the minimum quantity of products that must be in a customer’s cart.
* Discount: Set up the maximum number of eligible bundles, bundle scaling behavior, and other discount details, including dynamic formula.
* Conditions: Optionally set up a validation rule.
* Once you add a bundle discount of a given type, you cannot add another. Delete the existing one to add a new discount.
### Bundle scaling
Bundle scaling determines whether the discount is applied once or multiplied by the number of eligible bundles in the cart.
* **Multiply discount by each bundle added**: The discount value and limits scale automatically with the number of eligible bundles. For example, a \$5 discount per bundle results in a \$10 discount when two bundles are applied.
* **Don't multiply – use fixed discount**: The discount is applied once. Use this option if your formula already includes bundle quantity (e.g. `order.bundle.quantity`) to avoid double multiplication.
### Bundle types
The following bundle types are available:
* **Buy X, Get Y for Free (Free products)**
* **Discount Whole Order (Order discount)**
* **Discount Bundle Items by Fixed Amount (Amount product discount)**
* **Discount Percentage Off Bundle Items (Percentage product discount)**
* **Set Price for Bundle Items (New unit price discount)**
* **Split Discount Between Bundle Items (Split product discount)**
## Discount value and additional limits
The discount value field specifies the amount or the percent of the discount. The discount value can be static or dynamic.
Static discounts are applied without any additional conditions. Discounts are static by default.
Dynamic formulas change the discount value based on defined conditions. All discount values (except for the shipping discount) can be dynamic. Click **Build formula** to open the dynamic discount formula builder.
### Additional discount limits
Some discount categories, types, and effects have additional discount limits:
* **Maximum discount amount** – in percent discounts, it sets the maximum amount of the applied discount for the whole order (order discounts) or a given order line (product discounts).
* **Maximum amount combined for all order lines** – in product discounts, it sets the maximum amount of the applied discount to the whole order. This limit is available for:
* [Amount discount: Apply the discount to item subtotal](#amount-discount%3A-apply-the-discount-to-item-subtotal)
* [Amount discount: Apply the full discount to each item unit](#amount-discount:-apply-the-full-discount-to-each-item-unit)
* [Percent discount: Apply the discount to item subtotal](#percent-discount%3A-apply-the-discount-to-item-subtotal)
* [Discount limits for selected products – caps](#discounted-product-limits-–-capped-by):
* **Maximum discount amount per order line**
* **Maximum discount amount per order**
* **Max units per order item**
* **Max units combined for all matched order lines**
#### Discounted product limits – Capped by
The following discount types can be further modified with additional caps to secure the campaign budget:
* [Amount discount: Apply the full discount to each item unit](#amount-discount%3A-apply-the-full-discount-to-each-item-unit)
* [Percent discount: Apply the discount to item subtotal](#percent-discount%3A-apply-the-discount-to-item-subtotal)
* [New price: Apply the discount to item subtotal](#new-price-discount%3A-apply-the-discount-to-item-subtotal)
The limits listed here also work together with [additional discount limits](#additional-discount-limits): Maximum discount amount per order line and Maximum discount amount per order. The discount is always calculated in such a way as to apply the lowest possible discount, whether from the product limit caps, or other limits.
#### Maximum discount amount per order line
This limits the amount of the discount for one order line or item subtotal.
If set to \$25: The customer orders five discounted product units in three order lines. A maximum of \$25 discount will be applied to each applicable order line.
#### Maximum discount amount per order
This limits the discount amount for the whole cart.
If set to \$100: The customer orders five discounted product units in three order lines. The maximum discount for all order lines will reach \$100.
#### Maximum units per order item
This limits the number of item units that can be discounted in one order line or item subtotal.
If set to 3: The customer orders five units of a discounted product. However, only three units will be discounted.
#### Maximum units combined for all matched order lines
This limits the number of item units covered by the discount across all matching order lines or item subtotals.
If set to 5: The customer orders two product units in one order line, and four product units in another order line, making six product units in total. The discount applies to all order lines. Only five units are discounted and the remaining unit has a full price.
#### Maximum units per campaign
This and the following limits are available on demand. Contact [Voucherify support](https://www.voucherify.io/contact-support) to enable them for your organization.
This limits the number of discounted item units (product, SKU, collection) that all customers can receive in a given campaign.
If a product is selected, the limit covers all discounts across all SKUs belonging to that product. If a product collection is selected, the limit covers all products/SKUs within the collection. It's recommended to use this limit with **Maximum units per customer in campaign**, so one customer doesn’t use up all discounted items. The limit can be combined with a dynamic formula.
If set to 10, it applies to all customers:
* Customer Alex buys 5 item units and receives a discount on 5 units
* Then, customer Bobby buys 4 item units and receives a discount on 4 units
* Then, customer Clarence buys 3 item units, but receives a discount only on 1 unit, as the limit is reached in this order. 2 item units are not discounted.
#### Maximum units per customer in campaign
This limits the number of discounted item units (product, SKU, collection) that one customer can receive in a given campaign.
It's recommended to use this limit with **Maximum units per campaign**, so that many customers will not exceed the total number of item units available for discount. The limit can be combined with a dynamic formula.
If set to 5: The customer can buy a maximum of 5 item units with a discount. If they buy a 6th item or more, these items will not be discounted. This limit can be split between orders, so if the customer buys 3 item units in one order, and 3 item units in the second order, 5 item units will be discounted and 1 item unit from the second order will have its full price.
#### Maximum units per campaign for a product in a collection
This limits the number of discounted item units of a given product in a collection that all customers can receive in a given campaign.
It is recommended to combine this limit with **Maximum units per customer for a product in a collection**, so one customer doesn’t use up all discounted items. The limit can be combined with a dynamic formula.
If set to 5 for an *Adventure brand* collection consisting of T-shirts, beanies, and posters, a maximum of 5 Adventure T-shirts, 5 Adventure beanies, and 5 Adventure posters will be discounted. The limit isn't split between all products; each product has its own limit of 5 item units. The limit of 5 item units is for all customers:
* Customer Alex buys 5 Adventure T-shirts (limit reached), 1 Adventure beanie, and 4 Adventure posters and receives a discount on all item units
* Then, customer Bobby buys 3 Adventure T-shirts, 3 Adventure beanies, and 2 Adventure posters. Bobby will not receive a discount on Adventure T-shirts (limit reached by Alex), 3 Adventure beanies (limit not reached yet), and 1 Adventure poster (limit reached).
* Then, customer Clarence buys 1 Adventure T-shirt, 3 Adventure beanies, and 3 Adventure posters. Clarence will not receive a discount on the Adventure T-shirt (limit reached by Alex), will receive a discount on 1 Adventure beanie (limit reached), and again will not receive a discount on the Adventure poster (limit reached by Bobby).
#### Maximum units per customer for a product in a collection
This limits the number of discounted item units of a given product in a collection that one customer can receive.
It's recommended to use this limit with **Maximum units per campaign for a product in a collection**, so that many customers will not exceed the total number of item units available for discount. The limit can be combined with a dynamic formula.
If set to 5 for an *Adventure brand* collection consisting of T-shirts, beanies, and posters: A customer can buy a maximum of 5 Adventure T-shirts, 5 Adventure beanies, and 5 Adventure posters with a discount. If the customer buys a 6th item or more of a given collection product, these items will not be discounted. This limit can be split between orders, so if the customer buys 3 item units in one order, and 3 item units in the second order, 5 item units will be discounted and 1 item unit from the second order will have its full price.
#### Maximum units per promotion tier
This limits the number of discounted item units that all customers can receive in a promotion tier.
It's recommended to use this limit with **Maximum units per customer in promotion tier** or **Maximum units per customer in campaign**, so one customer doesn’t use up all discounted items. The **Maximum units per campaign** limit applies only to that promotion tier – it doesn’t affect other promotion tiers in the same campaign. The limit can be combined with a dynamic formula.
If set to 10, it applies to all customers:
* Customer Alex buys 5 item units and receives a discount on 5 units
* Then, customer Bobby buys 4 item units and receives a discount on 4 units
* Then, customer Clarence buys 3 item units, but receives a discount only on 1 unit, as the limit is reached in this order. 2 item units are not discounted.
#### Maximum units per customer in promotion tier
This limits the number of discounted item units that one customer can receive in a given promotion tier.
It's recommended to use this limit with **Maximum units per promotion tier** or **Maximum units per campaign**, so that many customers will not exceed the total number of item units available for discount. The limit can be combined with a dynamic formula.
**Example –** If set to 5: The customer can buy a maximum of 5 item units with a discount in a given promotion tier. If they buy a 6th item or more, these items will not be discounted. This limit can be split between orders, so if the customer buys 3 item units in one order, and 3 item units in the second order, 5 item units will be discounted and 1 item unit from the second order will have its full price.
#### Maximum units per promotion tier for a product in a collection
This limits the number of discounted item units of a given product in a collection that all customers can receive in a given promotion tier.
It is recommended to combine this limit with **Maximum units per customer in promotion tier**, **Maximum units per customer in promotion tier for a product in a collection**, or **Maximum units per customer for a product in a collection**, so one customer doesn’t use up all discounted items. The limit can be combined with a dynamic formula.
If set to 5 for an *Adventure brand* collection consisting of T-shirts, beanies, and posters:
* Customer Alex buys 5 Adventure T-shirts (limit reached), 1 Adventure beanie, and 4 Adventure posters and receives a discount on all item units
* Then, customer Bobby buys 3 Adventure T-shirts, 3 Adventure beanies, and 2 Adventure posters. Bobby will not receive a discount on Adventure T-shirts (limit reached by Alex), 3 Adventure beanies (limit not reached yet), and 1 Adventure poster (limit reached).
* Then, customer Clarence buys 1 Adventure T-shirt, 3 Adventure beanies, and 3 Adventure posters. Clarence will not receive a discount on the Adventure T-shirt (limit reached by Alex), will receive a discount on 1 Adventure beanie (limit reached), and again will not receive a discount on the Adventure poster (limit reached by Bobby).
#### Maximum units per customer in promotion tier for a product in a collection
This limits the number of discounted item units of a given product in a collection that one customer can receive in a promotion tier.
It's recommended to use this limit with **Maximum units per promotion tier** or **Maximum units per campaign for a product in a collection**, so that many customers will not exceed the total number of item units available for discount. The limit can be combined with a dynamic formula.
If set to 5 for an *Adventure brand* collection consisting of T-shirts, beanies, and posters: A customer can buy a maximum of 5 Adventure T-shirts, 5 Adventure beanies, and 5 Adventure posters with a discount. If the customer buys a 6th item or more of a given collection product, these items will not be discounted. This limit can be split between orders, so if the customer buys 3 item units in one order, and 3 item units in the second order, 5 item units will be discounted and 1 item unit from the second order will have its full price.
## Application rules
With the application rules, you can set the discount effect for the cheapest, most expensive, or all products or product units. Additionally, you can configure the target of the discount, when the discount will be applied (e.g. for every other order line), or if some of the discounts will be skipped.
The application rules can be set for:
* [All product discounts](#product-discount-effects),
* [Upgrade Bonus: Replace order items](#upgrade-bonus%3A-replace-order-items) in the Rewards discount effects,
* Items covered by a gift card in a [gift card campaign](/build/create-gift-cards).
### Effects
The application rules have the following effects:
* **For every** – the discount will be applied to every resource as defined in the target, application, and skip settings. The discounts are applied as determined by order set in the request.
* **For the cheapest** – the discount will be applied only to the cheapest resource.
* **Starting from the cheapest** – the discount will be applied to the cheapest resource and to any other resources as defined in the target, application, and skip settings.
* **For the most expensive** – the discount will be applied only to the most expensive resource.
* **Starting from the most expensive** – the discount will be applied to the cheapest resource and to any other resources as defined in the target, application, and skip settings.
### Target
The application rules can target the following:
* **Order line** – The discount will be applied to whole order lines, i.e. products or SKUs sent in the order, but not to the units. For example, if a customer orders 3 Adventure Mugs for \$10 each and 2 Adventure T-shirts for \$20 each, the discount will be applied to the total amount of \$30 and the total amount of \$20, not to mug or T-shirt units.
* **Unit** – The discount will be applied to units within order lines. For example, if a customer orders 3 Adventure Mugs for \$10 each and 2 Adventure t-shirts for \$20 each, the discount will be calculated on the basis of the ordered mug and t-shirt units. In combination with the every and skip rules as well as amount, proportional, and percentage discounts, the discounts are calculated and applied to applicable units.
### Apply the discount to
The application rules can apply the discount as follows:
* **All** – the discount will be applied to all resources.
* **Every** – the discount will be applied to a number of resources as determined in the Repeat field. For example, Repeat 3 means that every third resource will be covered by the discount.
### Skipping
The application rules can skip items as follows:
* **None** – the discount will be applied to the first resource and then to any other resource as defined in the Apply discount to setting.
* **First** – the discount will not be applied to a number of items defined in the Skip field. For example, Skip 3 means that the discount will be applied to the fourth resource.
The application rules can be combined with [the Capped by settings](#discounted-product-limits-–-capped-by) to limit the maximum discount amount or the number of resources covered by the discount.
### Application rules - examples
Check the following examples to see how application rules can be used.
| Product | Unit price | Quantity | Price and discount |
| --------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Adventure T-shirt | \$20 | 3 | \$60
–
The most expensive order line from the Adventure brand. It is skipped, as this is the first order line covered by the discount configuration |
| Adventure Poster | \$15 | 5 | \$75
-\$5
–
The second most expensive order line from the Adventure brand and the first order line to which the discount is applied |
| Adventure Mug | \$10 | 2 | \$20
–
The third most expensive order line from the Adventure brand. It is skipped as the discount is repeated every two order lines |
| Adventure Socks | \$5 | 4 | \$20
-\$5
–
The fourth most expensive order line from the Adventure brand. It is covered by the discount, because the discount is repeated |
| Star Thermal Bottle | \$25 | 2 | \$50
–
Not covered by the discount, because it is from the Star brand |
| **Order amount before discounts** | | | **\$225** |
| **Total discount** | | | **\$10** |
| **Total amount** | | | **\$215** |
| Product | Unit price | Quantity | Price and discount |
| --------------------------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Adventure T-shirt | \$20 | 3 | \$60
-\$5
–
The most expensive unit from the Adventure brand from which the skip and repeat settings are calculated is in this order line.
The first unit is skipped, the second unit is discounted, and the third unit is again skipped, because the discount is repeated every two units. |
| Adventure Poster | \$15 | 5 | \$75
-\$15
–
The second most expensive order line units from the Adventure brand. The counting of discounted units moves to this order line. The first, third, and fifth units are discounted, because the discount is repeated every two units. |
| Adventure Mug | \$10 | 2 | \$20
-\$5
–
Third most expensive order line units from the Adventure brand. The discount is skipped for the first unit and applied to the second unit. |
| Adventure Socks | \$5 | 4 | \$20
-\$10
–
The fourth most expensive order line from the Adventure brand. The discount is skipped for the first and third units and applied to the second and fourth units. |
| Star Thermal Bottle | \$25 | 2 | \$50
–
Not covered by the discount, because it is from the Star brand. |
| **Order amount before discounts** | | | **\$225** |
| **Total discount** | | | **\$35** |
| **Total amount** | | | **\$190** |
## Conditions and validation rules
Optionally, discounts can have conditions defined with [validation rules](/optimize/validation-rules-reference), which limit discount application. The validation rules must be met for the discount to be applied.
Use the search field to find and reuse existing validation rules.
To create a new rule, click the plus button to open the [validation rule builder](/optimize/create-validation-rules) in the Campaign Manager. You can also create validation rules in the **Validation Rules** section in the dashboard for future use.
### Validation rules and product discounts
For product discounts, Voucherify creates a validation rule that includes all discounted products. If you want to include the products only, in the **Conditions** step, check **Configured options** only. If you want to add further conditions, click With rules and the plus button. If you want to reuse an existing validation rule, select the rule from the search field.
The new or cloned rule is assigned to the campaign but you will not be able to remove it in the campaign manager nor in the campaign details. However, you can freely edit the rule to add new or remove old conditions.
# Earning rules
Source: https://docs.voucherify.io/build/earning-rules
Learn about earning rules, their types, limits, and configuration parameters in Voucherify
Legacy loyalty
This page describes the legacy loyalty program model.
Legacy loyalty is in maintenance mode. Voucherify is not actively developing new features for this model, but your existing programs remain supported and critical issues will continue to receive fixes.
The legacy loyalty program will be eventually sunset. If you have questions about what this means for your program, migration, or timelines, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
## Earning rule configuration steps in detail
You configure an earning rule in four steps. Each step defines key and optional settings that specify how a rule works and its scope.
### Details (required)
This step defines the rule's identification and lifecycle management.
* **Name**: The unique name of the earning rule, used for management and reporting.
* Earning rule type: Defines what customers need to do to earn points. There are four main earning rule types:
* Order has been paid
* Custom event
* Entered segment
* Tier events
* **Time frame** (optional): Defines the period when the rule is active and customers can earn points through this rule.
* **Inheritance**: If a time frame is not defined, the rule inherits the settings from the parent loyalty campaign.
* **Time frame options**:
* Start date and time
* End date and time (expiration)
* Valid in this timeframe only (recurring)
* Valid on particular days only
### Points (required)
This step defines the reward value, timing, and expiration rules for the points earned.
* **Point value**: Determines how many loyalty points the customer will receive.
* It can be a **fixed** value (for example, 50 points) or a **dynamic value** calculated using the **points formula builder**.
* It can be a **proportional** value (for example, 10 points for every \$10 spent) that scales with a selected condition. **Proportional** values are unavailable in **Tier events** rules.
* **Pending points**: You can set a delay time before customers can actually use the earned points.
* You can set a specific pending period in days.
* Points are added to the customer's account immediately but remain in a pending state. Once the set number of days has passed, the points are automatically made available to the customer.
* **Expiration rules**: Configuration defining when the points acquired through this specific earning rule will expire. If an earning rule doesn't have its own expiration rule, the campaign-level point expiration will be used instead.
### Validation rules (optional)
[Validation rules](/optimize/validation-rules-reference) are additional conditions that the customer needs to meet to gain points with the earning rule.
Validation rules in earning rules
Validation rules can additionally define the following conditions:
* Cart structure and volume, like minimum order value.
* Customer data, like only for customers in a given country
* Qualified customer segments, like only for the "Premium customers" segment
### Metadata (optional)
The **Metadata** step allows you to attach custom attributes to the earning rule by defining key/value pairs. Use metadata for internal tracking, organization, or in more advanced logic.
## Earning rules by types
Learn how points are calculated and awarded for each rule type, focusing on **proportional earning** and required **metadata schema**.
Earning rules based on metadata must have a **Number** type and be defined in the **Metadata Schema**.
### Order has been paid
**Order has been paid** rule adds points to the customer's loyalty card when a new order changes its status to **PAID**.
There are two earning methods for the **Order has been paid** earning rule.
* **Fixed**: Awards a fixed number of points for paying for an order.
* **Proportional**, awards a defined number of points (*X*) for every predefined value (*Y*) in the selected metric, like amount spent. The following **Proportional** methods are available:
* **Pre-discount order amount**: Awards X points for every \$Y spent, excluding discounts (order total amount counted *before* discounts were applied).
* **Total order amount**: Awards X points for every \$Y spent including discounts (order total amount counted *after* discounts were applied).
* **Pre-discount amount spent on items**: Awards X points for every \$Y spent on specific items or collections, excluding discounts.
* **Amount spent on items**: Awards X points for every \$Y spent on specific items or collections, including discounts.
* **Quantity of items in the cart**: Awards X points for every Y items, excluding free items.
* **Order metadata**: Awards X points proportionally to the value of a metadata attribute defined in the **Order** schema.
* **Customer metadata**: Awards X points proportionally to the value of a metadata attribute defined in the **Customer** schema.
When selecting multiple products or collections for proportional earning, if the same item belongs to multiple selected collections, points will be calculated based on eligible items only once.
### Custom event
Prerequisite
A custom event must be first defined in **Project Settings** > **Event Schema**.
Sending custom events to Voucherify requires developer implementation and use of the [POST Track custom event](/api-reference/events/track-custom-event) endpoint.
Custom events are actions taken by your customers that are tracked in your application or website and passed to Voucherify using the API.
When a custom event earning rule is used with a **Validation rule**, the moment the event is received, Voucherify checks if the customer linked to the event matches the conditions defined in the **Validation rule**, like segment rules, customer metadata, or custom event metadata.
There are two earning methods for **Custom event** earning rule:
* **Fixed**: Awards a fixed number of points when the **Custom event** occurs.
* **Proportional**: Awards a defined number of points (*X*) for every predefined value (*Y*) in the selected metric. The following **Proportional** methods are available:
* **Customer metadata**: Value comes from a metadata attribute defined in the **Customer schema**.
* **Custom event metadata**: Value comes from a metadata attribute defined as a property of the chosen event in the **Event schema**.
### Entered segment
Segments group customers based on defined filter criteria. The **Entered segment** earning rule awards points only when the customer meets all segment conditions.
The **Entered segment** earning rule adds points to the customers who enter the selected segment when the earning rule is active. Customers who have already entered the segment won't receive points.
There are two earning methods for the **Entered segment** earning rule:
* **Fixed**: Awards a fixed number of points when the customer enters the segment.
* **Proportional**: Awards a defined number of points (*X*) for every predefined value (*Y*) in the **Customer** metadata.
### Tier events
Prerequisite
The **Tier events** earning rule uses the loyalty tiers created in the **Tiers (optional)** step in the loyalty campaign builder.
**Loyalty tiers** are different membership levels in a loyalty program, defined by a minimum and, optionally, maximum point range. Points are added when a specific tier-related change occurs, provided that all related conditions are met.
There are the following **Tier events**:
* **Joined tier structure**: Customer earns points when they join the tier structure for the first time.
* **Left tier structure**: Customer earns points when they leave the tier structure.
* **Tier upgraded**: Customer earns points when they reach a higher loyalty tier.
* **Tier downgraded**: Customer earns points when they fall to a lower loyalty tier.
* **Tier prolonged**: Customer earns points when their current tier level is extended.
By default, the **Tier events** apply to **Any** loyalty tier. Optionally, you can define a **Specific tier** that will trigger the **Tier event**.
There are two earning methods for the **Tier events** earning rule:
* **Fixed**: Awards a fixed number of points when the tier event occurs.
* **Proportional**: Awards a defined number of points (*X*) for every predefined value (*Y*) in the **Customer** metadata.
# Gift card import
Source: https://docs.voucherify.io/build/gift-card-import
Learn how to import gift cards to Voucherify
If you need to share codes from other sources with Voucherify, you can handle this scenario using the Import CSV tool in the Dashboard. The tool enables you to import:
* Generic gift cards.
* New unique gift cards to a campaign.
* Existing gift cards to update them.
When importing codes to a campaign, the system applies two simultaneous limits for the import file:
* **Code count limit**: Up to **100,000** codes.
* **File size limit**: Up to **10 MB** CSV file size.
The import will stop when **whichever limit hits first**.
Note that **100,000 codes** is the overall campaign code limit. If the campaign already contains codes (e.g., 50,000 codes), only the remaining capacity (e.g., 50,000 codes) will be imported to maintain the 100,000 total code limit.
Important
* The start and expiration dates in the CSV file should be provided in compliance with the **ISO 8601** standard, for example, `2020-03-11T09:00:00.000Z`.
* CSV columns mapped to custom attributes will be added as code metadata. The number of custom attributes you can import as metadata is unlimited.
* You cannot import two identical codes to a single Voucherify project.
* When importing existing incentives (discount coupons, referral codes, loyalty cards, or gift cards) into a campaign, only two fields can be updated: the **active** status (`true/false`) and the **category**. All other attributes remain unchanged.
## Preparing CSV file for generic gift cards
Use these fields when importing **standalone (generic) gift cards**. Generic gift cards are not assigned to a campaign and work independently.
Use the CSV generic gift card file template.
### Required fields
* **Voucher Type**\
Defines the voucher type.\
For gift cards, the value must be `GIFT_VOUCHER`.
* **Code**\
A unique gift card code.\
You cannot import two identical codes into a single Voucherify project.
* **Value**\
The initial gift card balance.
### Optional fields
* **Active**\
Enables or disables the gift card.\
Accepted values: `TRUE` or `FALSE`.\
An inactive gift card cannot be redeemed, even if it is within its validity timeframe.
* **Start date**\
The date when the gift card becomes valid.\
It must follow the ISO 8601 format, for example: `2022-09-19T00:00:00.000Z`.
* **Expiration date**\
The date when the gift card expires.\
It must follow the ISO 8601 format, for example: `2022-11-30T00:00:00.000Z`.
* **Category**\
A custom tag assigned to the gift card.\
Categories help you filter and organize codes in the Dashboard.
* **Redemption limit**\
The maximum number of times the gift card can be redeemed.\
If omitted, the redemption limit is set to unlimited.
* **Redeemed quantity**\
The number of times the gift card has already been redeemed.\
If omitted, the value defaults to `0`.
* **Additional Info**\
Any additional information you want to store with the gift card.\
This field is informational only.
* **Metadata (custom attributes)**
Metadata allows you to add custom information to Voucherify objects. There are two ways to handle it:
* **Metadata (Schema)**: These are fields you define in **Project settings** > **Metadata schema**. You choose the data type (like string or number) and if the field is mandatory. This ensures your metadata is consistent.
* **Metadata (Unknown)**: These are fields sent to Voucherify without being defined first (through the API, imports, or manual entry). They are always treated as simple text strings. They are useful for one-time metadata, but they do not support advanced filtering or strict validation.
Fields other than the ones listed above will not be imported. Even if you provide them, they will be skipped.
These codes will function as standalone gift cards, independent of a campaign.
### Import generic gift cards
Go to **Campaign hub** > **Campaigns** and **Import CSV**.
Webhook sendout prerequisite
While importing, you can additionally select the checkbox to **Create a webhook sendout for the vouchers created and updated during the import**. This triggers a [Voucher created](/api-reference/voucher/created) or [Voucher updated](/api-reference/voucher/updated) webhook when the coupons are processed.
To enable webhook sendout during the voucher import, first configure webhooks in **Project settings** > **Webhooks**. Select the `voucher.created` and `voucher.updated` events for the sendout to work.
Read [Project settings webhooks](/api-reference/project-settings-webhooks) to learn more about configuring webhooks.
Upload your prepared CSV file.
Once uploaded, you'll see an overview of first rows and columns of the file.
In **Map Fields**, select for each CSV column:
* **Do not map** to skip that column.
* **Voucherify fields** to **Select** Voucherify properties, like **Code**, **Voucher type**, and so on.
* **Metadata (Schema)** to map a given column to custom attributes that are defined for vouchers.
* **Metadata (Unknown)** to map to an undefined custom attribute key.
Once ready, **Import** and wait for notification when the import is complete.
For large imports, the process can take a significant amount of time.
## Preparing CSV file for campaign gift cards
Import gift cards to campaign prerequisite
If you don't have a campaign for your codes yet, [create a gift card campaign](/build/create-gift-cards) first.
Use these fields when importing gift cards **into an existing gift card campaign**.\
Imported gift cards inherit all campaign settings unless explicitly overridden.
Use the CSV gift card file template.
### Required fields
* **Code**\
A unique gift card code.
### Optional fields
* **Active**\
Enables or disables the gift card.\
Accepted values: `TRUE` or `FALSE`.
Import behavior:
* If the campaign is **Active** and the `active` field is omitted, imported gift cards are set to `TRUE`.
* If the campaign is **Expired** and the `active` field is omitted, imported gift cards are set to `FALSE`.
* **Category**\
A custom tag assigned to the gift card for filtering and organization.
* **Gift amount**\
The initial gift card balance.\
If omitted, the campaign default balance is applied.
* **Start date**
The date and time when the gift card becomes active.
Accepted format: ISO 8601 (e.g., `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm:ssZ`). If omitted, the gift card is active immediately upon creation.
* **Expiration date**
The date and time when the gift card is no longer valid for redemption.
Accepted format: ISO 8601. Once this date passes, the gift card status automatically changes to `Expired`.
* **Redeemed quantity**\
The number of times the gift card has already been redeemed.
* **Redeemed amount**\
The amount already redeemed from the available gift card balance.
* **Metadata (custom attributes)**
Metadata allows you to add custom information to Voucherify objects. There are two ways to handle it:
* **Metadata (Schema)**: These are fields you define in **Project settings** > **Metadata schema**. You choose the data type (like string or number) and if the field is mandatory. This ensures your metadata is consistent.
* **Metadata (Unknown)**: These are fields sent to Voucherify without being defined first (through the API, imports, or manual entry). They are always treated as simple text strings. They are useful for one-time metadata, but they do not support advanced filtering or strict validation.
Metadata import behavior:
* If metadata columns are omitted, the gift card inherits the campaign's metadata.
* If metadata columns are added and mapped, only those specific fields are overridden.
* Metadata that is not mapped remains unchanged.
Fields other than the ones listed above will not be imported. Even if you provide them, they will be skipped.
All unmapped attributes will inherit the campaign’s default settings as well as validation rules, time frame, redemption limits, and so on.
### Import gift cards to a campaign
In **Campaign hub** > **Campaigns**, go to the gift card campaign where you want to import the cards. In the top right corner, use the three-dot menu to **Import CSV file**.
Upload your prepared CSV file.
Once uploaded, you'll see an overview of first rows and columns of the file.
In **Map Fields**, select for each CSV column:
* **Do not map** to skip that column.
* **Voucherify fields** to **Select** Voucherify properties, like **Code**, **Voucher type**, and so on.
* **Metadata (Schema)** to map a given column to custom attributes that are defined for vouchers.
* **Metadata (Unknown)** to map to an undefined custom attribute key.
Once ready, **Import** and wait for notification when the import is complete.
For large imports, the process can take a significant amount of time.
New gift cards will be visible in the **Vouchers** tab in the detailed campaign view.
# Gift card campaign overview
Source: https://docs.voucherify.io/build/gift-card-overview
Understand the mechanics and configuration of gift card campaigns in Voucherify
## Gift card campaigns
A gift card campaign in Voucherify can create a pool of unique, prepaid digital cards that customers can redeem for purchases. They are a powerful tool for driving sales and encouraging customer loyalty.
The **Build** section is where you define the core mechanics of your gift card program. Every setting you configure, from the initial value to the redemption rules, maps directly to how Voucherify stores and processes the card data and, ultimately, impacts the customer experience.
Gift cards function as a form of currency within your system. Unlike one-time use coupons, a single gift card can be redeemed multiple times until its **balance** is depleted.
## Key gift card concepts
Gift cards operate on three key concepts. Understanding these is essential for effective campaign design.
Gift cards are loaded with an **Initial amount** (value) that customers spend. This amount can be reduced (redeemed) or increased (topped up).
Each card within the campaign is assigned a **Unique code** that is tracked individually for security and reporting.
**Validation rules** can restrict *where* and *when* a customer can use the card (for example, minimum cart value, specific products, metadata).
## Gift card configuration in the Build section
When creating a new gift card campaign, you will configure these key areas. For detailed, step-by-step instructions, refer to the [Create gift cards](/build/create-gift-cards) guide.
* **Campaign type:** Select **Gift vouchers** to create prepaid, balance-holding codes.
* **Code settings:** Configure the **Code pattern** and quantity of unique cards to be generated.
* **Value:** Set the **Initial amount** loaded onto each card.
* **Validation rules:** Define the **Validation rules** that govern *where* and *when* the card can be used.
## Gift card workflow
Voucherify supports every step of the gift card lifecycle.
Build your program conditions, set up rewards, and automate notifications in the **Dashboard**.
Assign (publish) gift cards to customers through Voucherify or your integrated tech stack.
When a customer wants to pay for their order with a gift card, Voucherify validates the request and processes the redemption in your store. Also, Voucherify updates the balance in real-time.
You can set up topping-up mechanisms to gift cards or combine them with loyalty program rewards. For example, customers can spend their loyalty points to add balance to their gift cards.
Track the performance of your gift card campaigns using real-time reports to understand what drives customer engagement.
# Loyalty campaign overview
Source: https://docs.voucherify.io/build/loyalty-campaign-overview
Understand the core concepts and workflow of building loyalty programs in Voucherify
Legacy loyalty
This page describes the legacy loyalty program model.
Legacy loyalty is in maintenance mode. Voucherify is not actively developing new features for this model, but your existing programs remain supported and critical issues will continue to receive fixes.
The legacy loyalty program will be eventually sunset. If you have questions about what this means for your program, migration, or timelines, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
Loyalty programs allow customers to store points on digital cards. Customers accumulate these points by meeting specific program earning rules.
Beyond managing loyalty cards and earning rules, Voucherify provides a rewards catalog and an omnichannel notifications system to provide a fully gamified experience.
In this guide, you will learn how loyalty programs work–from simple collect-and-spend schemes to advanced campaigns with tiers, expiration logic, and automatic redemption.
## Key loyalty concepts
The following concepts are key for understanding the loyalty engine.
A digital card with a unique code that acts as a digital wallet for a customer's points.
Defines the action(s) that assign a specific number of loyalty points to a customer's card. Each earning rule has a specific timeframe determining when it is active.
Levels of membership within your program. A tier is defined by a minimum and maximum point range on a customer's card. You can map different rewards and earning rules to specific tiers.
A digital or material incentive customers receive in exchange for points. Customers can also spend points to pay for orders directly.
The mechanism for sending messages from Voucherify to end customers or third-party applications. This is used to deliver loyalty cards and notify customers about collected points or redeemed rewards.
The exchange of points for a reward. This process deducts points and updates the balance on the loyalty card.
The assignment of a unique card to a specific customer. Cards must be published before customers can start collecting points.
Points can expire within a pre-defined timeframe. Expiration rules can be set at the campaign level or the earning rule level. If no rule is defined, points do not expire.
An optional mode where customers are automatically assigned a loyalty card when they meet an earning rule, provided they don't already have one.
The default setting for loyalty programs. It ensures a customer can hold only one card per campaign. Once set, this cannot be toggled off in the **Dashboard**.
An optional mode where the application automatically generates new loyalty codes when the initial batch runs out.
## Loyalty workflow
Voucherify supports every step of the loyalty program lifecycle.
Build your program conditions, set up rewards, and automate notifications in the **Dashboard**.
Assign (publish) loyalty card codes to customers. As customers interact with your brand, they collect points based on your earning rules. Voucherify monitors behavior and updates loyalty scores in real-time.
When a customer wants to use a reward (such as a discount, gift card, or pay-with-points), Voucherify validates the request and processes the redemption in your store.
Track the performance of your loyalty campaigns using real-time reports to understand what drives customer engagement.
# Loyalty card import
Source: https://docs.voucherify.io/build/loyalty-card-import
Learn how to import loyalty cards to Voucherify
Legacy loyalty
This page describes the legacy loyalty program model.
Legacy loyalty is in maintenance mode. Voucherify is not actively developing new features for this model, but your existing programs remain supported and critical issues will continue to receive fixes.
The legacy loyalty program will be eventually sunset. If you have questions about what this means for your program, migration, or timelines, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
If you need to migrate loyalty cards from another system, you can use the **Import CSV tool** in the Dashboard.
The tool enables you to:
* Import new loyalty cards to a campaign.
* Update selected attributes of existing loyalty cards.
When importing codes to a campaign, the system applies two simultaneous limits for the import file:
* **Code count limit**: Up to **100,000** codes.
* **File size limit**: Up to **10 MB** CSV file size.
The import will stop when **whichever limit hits first**.
Note that **100,000 codes** is the overall campaign code limit. If the campaign already contains codes (e.g., 50,000 codes), only the remaining capacity (e.g., 50,000 codes) will be imported to maintain the 100,000 total code limit.
Important
* The start and expiration dates in the CSV file should be provided in compliance with the **ISO 8601** standard, for example, `2020-03-11T09:00:00.000Z`.
* CSV columns mapped to custom attributes will be added as code metadata. The number of custom attributes you can import as metadata is unlimited.
* You cannot import two identical codes to a single Voucherify project.
* When importing existing incentives (discount coupons, referral codes, loyalty cards, or gift cards) into a campaign, only two fields can be updated: the **active** status (`true/false`) and the **category**. All other attributes remain unchanged.
## Preparing CSV file for loyalty cards
Import loyalty cards: Prerequisite
Before importing loyalty cards, create a [loyalty program](/build/create-loyalty-campaign).
Loyalty cards must be imported into an existing loyalty campaign.
Imported cards inherit campaign settings unless explicitly set up in the CSV file.
Use the CSV loyalty card file template for faster preparation.
### Required fields
* **Code**\
A unique loyalty card code.\
You can't import two identical codes into a single Voucherify project.
### Optional fields
* **Category**\
A custom tag assigned to the loyalty card for filtering and organization.
* **Active**\
Enables or disables the loyalty card.\
Accepted values: `TRUE` or `FALSE`.
Import behavior:
* If the campaign is **Active** and the `active` field is omitted, imported cards are set to `TRUE`.
* If the campaign is **Expired** and the `active` field is omitted, imported cards are set to `FALSE`.
* **Loyalty points**\
The initial number of points assigned to the card.
Important:
* Points are applied only to newly imported cards.
* Points of existing cards can't be updated through CSV import.
* **Start date**\
The date when the loyalty card becomes valid.\
It must follow the ISO 8601 format, for example: `2022-09-19T00:00:00.000Z`.
* **Expiration date**\
The date when the loyalty card expires.\
It must follow the ISO 8601 format, for example: `2022-11-30T00:00:00.000Z`.
* **Metadata (custom attributes)**
Metadata allows you to add custom information to Voucherify objects. There are two ways to handle it:
* **Metadata (Schema)**: These are fields you define in **Project settings** > **Metadata schema**. You choose the data type (like string or number) and if the field is mandatory. This ensures your metadata is consistent.
* **Metadata (Unknown)**: These are fields sent to Voucherify without being defined first (through the API, imports, or manual entry). They are always treated as simple text strings. They are useful for one-time metadata, but they do not support advanced filtering or strict validation.
Metadata import behavior:
* If metadata columns are omitted, the loyalty card inherits campaign metadata.
* If metadata columns are added and mapped, only those specific fields are overridden.
* Metadata that is not mapped remains unchanged.
Fields other than the ones listed above will not be imported. Even if you provide them, they will be skipped.
All unmapped attributes inherit the campaign’s default settings, including validation rules, earning rules, expiration policy, and other campaign-level configurations.
## Import loyalty cards to a campaign
In **Campaign hub** > **Campaigns**, open your loyalty program.
In the top right corner, use the three-dot menu to **Import CSV file**.
Upload your prepared CSV file.
Once uploaded, you'll see an overview of first rows and columns of the file.
In **Map Fields**, select for each CSV column:
* **Do not map** to skip that column.
* **Voucherify fields** to **Select** Voucherify properties, like **Code**, **Voucher type**, and so on.
* **Metadata (Schema)** to map a given column to custom attributes that are defined for vouchers.
* **Metadata (Unknown)** to map to an undefined custom attribute key.
Once ready, **Import** and wait for notification when the import is complete.
For large imports, the process can take a significant amount of time.
New loyalty codes will be visible in the **Loyalty cards** tab in the detailed campaign view.
# Loyalty key concepts
Source: https://docs.voucherify.io/build/loyalty-key-concepts
Standard terms and relationships used across Loyalty Hub documentation
This article explains how the main loyalty concepts work together.
Use these concepts to define:
* What customer actions you reward
* How points are stored and managed
* What customers can receive or redeem
For a high-level introduction to the new loyalty program model, its rollout roadmap, and how it differs from existing loyalty campaigns, see [Loyalty program overview](/build/loyalty-overview).
For API orientation and the member journey, see [Loyalty v2 developer overview](/guides/loyalty-v2-overview). For the `/v2/loyalties` API map, see [Loyalty v2: Overview](/api-reference/loyalty-v2-api-overview).
## Loyalty Hub
**Loyalty hub** is the module where you build and manage loyalty programs.
Use **Loyalty hub** to:
* Create loyalty programs
* Configure how customers earn points
* Define how points behave
* Connect point wallets, earning rules, rewards, tiers, and benefits
## Loyalty program
A loyalty program is a configured loyalty setup.
To run a points-based loyalty program, you need:
* Point wallet
* Earning rules
A loyalty program can also include:
* Rewards
* Tier structures
* Benefits
A single loyalty program can include multiple point wallets.
## Loyalty member
A loyalty member is a Voucherify customer enrolled in a loyalty program.
Loyalty membership is program-specific. The same customer can be a member of multiple loyalty programs.
## Designer
The Designer is where you configure and connect the building blocks of a loyalty program.
You use the Designer to combine:
* Earning rules
* Point wallets
* Tier structures
* Rewards
* Benefits
## Program building blocks
The main building blocks define how customers earn, store, spend, and redeem points.
### Point wallet
A point wallet manages how points work on member loyalty cards.
It controls how points are stored, activated, expired, earned, spent, refunded, and used for order payments or reward redemption.
A loyalty program can include up to 10 point wallets, which lets you run different point balances or point currencies inside one program.
Currently, point wallets support only an individual membership model.
We plan to support different two additional membership models:
* Household wallets: Support private point pooling by several members.
* Team wallets: Support public group participation.
For household and team wallets, earning and spending limits will be tracked at the member level.
Pending points define when earned points become available to a loyalty member.
Points can be available immediately, after a defined period, on fixed activation dates, or after a selected activation event.
Point expiration defines how long points remain valid.
You can configure no expiration, expiration after a rolling period, expiration on specific calendar dates, or expiration after inactivity.
Earning limits control how many points a loyalty member can collect.
You can define global limits for a period of time or per-transaction limits for a single transaction.
Spending limits control how many points a loyalty member can use.
You can define global limits for a period of time or per-transaction limits for a single transaction.
Refunds define what happens to points when an order is refunded or canceled.
Refund settings can remove points earned from a refunded transaction or return points spent on a refunded transaction. Partial refund handling by item or amount is not supported yet and is listed on the Loyalty v2 roadmap.
Pay with points lets loyalty members use points to pay for orders.
When enabled, members can pay with points based on an exchange ratio formula.
### Earning rule
An earning rule defines when customers receive points or another configured result for their actions.
Each earning rule includes a trigger, optional conditions, and one or more effects. An earning rule can include multiple earnings applied sequentially – Voucherify applies the first matching earning configuration.
A trigger defines when an earning rule runs:
* **Order paid** – triggers the earning rule after an order is successfully paid.
* **Custom event** – triggers the earning rule when a selected custom event is sent to Voucherify.
* **Segment entered** – triggers the earning rule when a member enters a selected segment.
The "Tier" condition defines that an earning rule applies when the member belongs to a specific loyalty tier.
For example, the earning will trigger if the member belongs to the gold tier.
The "when" condition defines when an earning rule applies.
For example, a rule can apply only when an order meets specific criteria.
Effects define what happens when an earning rule runs.
For example, an effect can add points to a point wallet or issue a benefit.
Earnings define the conditions and effects for earning points.
For example, an earning can grant fixed points, proportional points, or a benefit.
Earning frequency controls how often an earning rule can run through cooldown and frequency settings.
You can configure the rule to run every time the trigger occurs or only within defined limits or time periods.
Earnings can override the point expiration settings of the point wallet. Point expiration defines how long points earned with this earning remain valid.
You can configure no expiration, expiration after a rolling period, expiration on specific calendar dates, or expiration after inactivity.
### Tier structure
A tier structure groups loyalty members into levels within a point wallet.
You can base tiers on criteria such as current point balance or total points earned. Tier structures can control qualification rules, expiration, grace periods, downgrade behavior, and tier-specific behavior.
Currently, a loyalty program can include one tier structure. Tier mappings let you adjust selected program rules for members in a specific tier.
Tier structures are optional.
A tier is a level in a loyalty program, for example Bronze, Silver, or Gold.
Tier expiration defines how long a loyalty member keeps a tier.
Tier downgrade happens when a loyalty member no longer meets tier requirements.
Tiers can override the point expiration settings of the point wallet. Point expiration defines how long points earned while the member is in this tier remain valid.
You can configure no expiration, expiration after a rolling period, expiration on specific calendar dates, or expiration after inactivity.
### Benefits
A benefit is value granted automatically when the defined conditions of an earning rule are met. For example, instead of earning points on a loyalty card, members can receive gift credits, discount coupons, or products.
Members do not need to redeem benefits manually; they receive a benefit once they fulfill the earning rule conditions.
Benefits are optional.
### Rewards
A reward is what loyalty members redeem using points.
Reward types include digital rewards and material rewards. Digital rewards can issue discount coupons or gift cards, while material rewards represent physical products or SKUs.
Rewards use spendings, which define when members can redeem the reward, which point wallet is used, and how many points the reward costs. One reward can be connected to multiple point wallets with different prices.
Rewards are optional.
## How it works
A simplified loyalty flow looks as follows.
```mermaid theme={null}
flowchart TD
A[Customer action] --> B{Trigger}
B -->|Order paid| C[Earning rule runs]
B -->|Custom event| C
B -->|Segment entered| C
C --> D{Check earnings in order}
D -->|No match| E[No points or benefits]
D -->|First matching earning| F[Apply effects]
F --> G[Add points to loyalty card governed by point wallet]
F --> H[Issue benefit]
G --> I[Loyalty card]
I --> J[Pending points, expiration, limits, refunds]
J --> K{Member outcomes}
K --> L[Qualify for tiers]
K --> M[Redeem rewards]
K --> N[Pay for order with points]
```
# Loyalty program overview
Source: https://docs.voucherify.io/build/loyalty-overview
Understand the new loyalty program model and how its components work together.
The new loyalty program model defines how members earn, keep, and spend points through modular components. This new model introduces also the completely new `v2/loyalties` API. In the dashboard, you manage the loyalty model in a new section called **Loyalty hub**.
For definitions of the individual components – point wallets, earning rules, tier structures, benefits, and rewards – see [Loyalty key concepts](/build/loyalty-key-concepts).
For developers and system integrators, see the [Loyalty v2 developer overview](/guides/loyalty-v2-overview), then [Integrate loyalty v2](/guides/loyalty-v2-integrate). For the `/v2/loyalties` API map, see [Loyalty v2: Overview](/api-reference/loyalty-v2-api-overview).
## New loyalty: Roadmap
The new loyalty program model – loyalty v2 – is rolled out over several phases.
You're here!
Loyalty v2 is enabled for everyone. New organizations and the existing organizations which don't use the legacy loyalty can use only the new loyalty solution.
The Loyalty v2 API is available for production integrations during the initial phase. Voucherify avoids breaking changes to published contracts whenever possible. Some endpoint pages may still be marked as "work in progress documentation". Voucherify may still improve the API and the **Loyalty hub** UI. Follow the [release notes](/changelog/changelog) and contact your Technical Account Manager for change notifications that affect your integration.
If you use or used the legacy loyalty, you can still continue to do so. However, Voucherify team will contact you with the details regarding future migration to the new solution.
Legacy loyalty maintenance
The legacy loyalty will be eventually sunset. As a result, it's not going to be further developed. Only critical issues will be fixed.
We continue to add new features and API endpoints to the new loyalty solution. Also, the developers improve the overall loyalty v2 and fix the issues found.
Planned features:
* Additional customization for each tier level and guardrails.
* Partial refund handling.
* Support for household cards.
* Advanced analytics.
The roadmap is not final and is subject to change.
If you use the legacy loyalty, you'll have to prepare for the migration to the new loyalty solution. You'll need to recreate your integration of the loyalty system to use the new API.
Migration from existing loyalty campaigns is not currently automated.
Members, points, rewards, and campaign configuration from existing loyalty campaigns cannot currently be moved automatically to new loyalty programs. Voucherify is investigating migration support, but organizations should expect integration changes.
Once everyone migrates to the new loyalty solution, the legacy loyalty is turned off.
The new loyalty solution becomes the only loyalty system in Voucherify.
Visit [Voucherify roadmap](https://voucherify.atlassian.net/jira/discovery/share/views/4fe91d57-02f9-4cbf-a10d-baa28417ee9c "Voucherify roadmap") to see the latest updates and planned features for the new loyalty solution.
## What changes in loyalty
The greatest change in the new loyalty program model is structural. It separates program setup into reusable components, headed by the support of multiple point wallets.
In existing loyalty campaigns, most settings belong to one campaign. This makes each campaign more isolated. If you need a similar setup in another campaign, you often need to configure it again. Also, the members can earn points only on one card that's governed by the campaign settings.
In the new model, you connect components inside a loyalty program. This helps you reuse configuration, manage more complex setups, and create programs with many point wallets. Your loyalty program members can earn points on different loyalty cards whose behavior is defined by separate point wallets.
## How components work together
A loyalty program connects all components – point wallets, earning rules, rewards, tier structures, and benefits – into one customer experience. For definitions of each component, see [Loyalty key concepts](/build/loyalty-key-concepts).
A simplified structure looks like this:
* The loyalty program contains the full setup.
* Point wallets store and manage points the members earn on their loyalty cards.
* Earning rules decide when members earn points or benefits.
* Rewards define what members can redeem.
* Tier structures group members into levels.
* Benefits grant points, material objects, or digital incentives automatically.
This structure makes loyalty programs more flexible. Instead of building every rule directly inside one campaign, you create components and connect them where they are needed.
For example, one program can use multiple point wallets. One reward can have different prices in different wallets. One tier can change earning limits or reward prices for members who qualify for it.
For the simplified end-to-end flow of how points move through a program, see [How it works](/build/loyalty-key-concepts#how-it-works) in Loyalty key concepts.
## Differences from existing loyalty campaigns
The new loyalty program model expands what marketers can build compared with existing loyalty campaigns.
Existing loyalty campaigns are more isolated. They use one point balance and keep most configuration inside one campaign. New loyalty programs use reusable components, multiple point wallets, wallet-specific reward prices, and more advanced tier behavior.
Additionally, the new loyalty program model improves security and fraud prevention. For example, it offers guardrails like point spending and earning limits, earning rule trigger limits, reward purchase limits, and more.
| Area | Existing loyalty campaigns | New loyalty programs |
| -------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Program structure | Most configuration belongs to one campaign | Configuration is separated into reusable components |
| Point wallets | One point balance per campaign | Multiple point wallets in one program |
| Earning logic | Multiple earning rules but each with one earning configuration | Multiple earning rules with multiple earning configurations, with the first matching configuration applied |
| Rewards | One reward price | One reward can be connected to multiple point wallets with different prices |
| Tiers | One tier structure in one campaign | One tier structure in one program for one point wallet, with tier mappings for selected rules |
| Households and teams | Not supported | Household and team wallets are planned to support shared earning models |
Detailed configuration options are covered in the dedicated feature articles.
The legacy loyalty features, like rewards, are incompatible with the new loyalty program model. Also, features from the new loyalty program model (point wallets, rewards, earning rules, tier structures, and benefits) can't be used with the legacy loyalty.
## Program limits
Program limits define how large one loyalty program can be.
Current limits:
* Up to 10 point wallets in one loyalty program
* Up to 100 rewards in one loyalty program
* Up to 100 earning rules in one loyalty program
* One tier structure in one loyalty program
* Up to 100 tier levels in one tier structure
* Up to 100,000 members in one loyalty program
These limits help you decide when to keep configuration in one program and when a separate program may be needed.
## Why use the new loyalty program model
The new model is useful when a program needs more flexibility than one point balance and one isolated campaign setup:
* Reusable configuration: Create components once and connect them where they are needed.
* Multiple point wallets: Manage different point balances or point currencies in one program.
* More control over points: Configure pending periods, expiration, earning limits, spending limits, refunds, and pay with points.
* Tier-specific behavior: Use tier mappings to adjust selected rules for different member levels.
* Larger program structures: Build complex loyalty setups without creating separate isolated campaigns for every variation.
* Improved experience: The new loyalty program model will be developed, while the legacy loyalty will be eventually sunset and only critical issues will be fixed.
## Support and feedback
We are continuously developing the new loyalty solution.
If you need additional support, you miss a feature, or you want to share your feedback, please reach out! Contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
# Loyalty points
Source: https://docs.voucherify.io/build/loyalty-points
Comprehensive guide to loyalty points mechanics
Legacy loyalty
This page describes the legacy loyalty program model.
Legacy loyalty is in maintenance mode. Voucherify is not actively developing new features for this model, but your existing programs remain supported and critical issues will continue to receive fixes.
The legacy loyalty program will be eventually sunset. If you have questions about what this means for your program, migration, or timelines, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
Loyalty points work like a currency in your loyalty program. Customers earn points on their dedicated loyalty card. Points are awarded based on predefined **earning rules** and can be redeemed for **rewards** defined by **redemption rules**.
## Loyalty point expiration rules
Loyalty point expiration rules define the duration of point validity to ensure that customers actively participate in a loyalty program. Point expiration is always based on the activity date, for example order date. The point expiration date is the last date customers can spend their points.
You configure expiration rules globally or for an individual earning rule. Earning rules without an expiration rule use the default campaign expiration rule.
Points expire after a set number of months.
Examples:
* If set to 1 month, points earned on 25th January are available until the end of 25th February. On midnight of 25th February, points will expire and will be unavailable.
* If set to 0 months, points will expire on midnight of the day they are earned. For example, points earned on 1st January will be available until the end of that day and they will expire on 00:00 of 2nd January.
Point expiration date nuances
Because months have different numbers of days, Voucherify handles these cases by rounding down the expiration date to the last day of the month in which the points are available.
For points earned on the 29th, 30th, or 31st day of a month, the expiration date is rounded down to the end of the month. For example, points earned on 31st January with one month expiration period will expire at the end of 28th February.
For **Months after earning activity**, you can additionally set a period that will round up the expiration till the end of a set period, so your customers can have a longer time to spend their points.
You can set round up expiration period till:
* **Each half-year**: at the end of June and December.
* **Each month**: at the end of each month.
* **Each quarter**: at the end of March, June, September, and December.
* **Each year**: at the end of the calendar year (end of December).
* **Particular month**: at the end of a selected month, for example, end of February.
For example, if **Months after earning activity** is set to 1 month and rounded up till the end of each month, points earned in January will expire at the end of 28th February.
Points expire each year at the end of a given day of a selected month. For example, points will expire on the end of 1st January, each year.
## Loyalty point operations
Loyalty points can be:
* Redeemed
* Adjusted
* Transferred
### Loyalty point redemption
Loyalty points can be redeemed for a **Material** or **Digital** reward or used to pay for an order. Redemptions use the points that have the shortest expiration date.
### Manual loyalty point adjustment
You can adjust loyalty card balance by adding or removing loyalty points. You can do this only for published loyalty cards, meaning those that have been assigned to customers. Unpublished or unassigned cards must be published before point adjustments can be made.
To change the balance, go to a loyalty card's view and select the add points icon. You can also set an expiration date when adding points.
### Loyalty point transfer
Developer setup
Loyalty points can be transferred only through the [POST Transfer Loyalty Points](/api-reference/loyalties/transfer-loyalty-points) endpoint.
You can transfer loyalty points between loyalty cards, including between loyalty cards in different loyalty programs.
When you transfer points from one card to another, the expiration date is reset for the transferred points on the transfer day. For example, if the transfer occurs on 25th January and the expiration is set to 1 month, the points will expire on 25th February after the transfer.
However, you can't transfer expired or pending points.
## Pending points
Pending points are points that have been earned by a customer, but are not yet available for redemption. This status is used to create a mandatory waiting period for points to ensure validity, account for potential returns, or synchronize with external systems.
You can set the pending period between 1 and 90 days. Points are instantly applied to the customer's loyalty card, but remain *pending*. When the pending period ends, they are automatically activated and become available for redemption. You can also activate the pending points manually.
For pending points, point expiration starts when the points become active.
Pending points can be also adjusted (added or subtracted) or deleted (canceled).
You can check pending points in:
* Customer's **Wallet**.
* Loyalty card details.
* Loyalty card details > **Pending points** tab.
* Loyalty campaign details > **Pending points** tab.
Explore [a pending point demo](https://app.demoboost.com/playback/me6nsub0?step=1) to learn more about the feature.
Pending points can also be used to trigger [distributions](/integrations/distributions-overview). This means you can send messages to customers when their pending points are updated. The following triggers are available:
* Loyalty pending points added
* Loyalty pending points updated
* Loyalty pending points activated
* Loyalty pending points canceled
Developer setup: track pending points with webhooks
You can track pending point events with the following webhooks:
* [Pending Points Added](/api-reference/voucher/loyalty-card-pending-points-added)
* [Pending Points Activated](/api-reference/voucher/loyalty-card-pending-points-activated)
* [Pending Points Canceled](/api-reference/voucher/loyalty-card-pending-points-canceled)
* [Pending Points Updated](/api-reference/voucher/loyalty-card-pending-points-updated)
## Auto-redeem
With the **Auto-redeem** feature, you can set one reward (**Digital** or **Material**) per loyalty program to be automatically redeemed once customers reach the defined point threshold. When their point balance meets or exceeds the reward cost, the points are deducted, and the reward is automatically issued.
A single customer can perform up to 10 redemptions with the auto-redeem logic per day. Each redemption (transaction) can hold up to 25 rewards, which, daily, gives a maximum of 250 rewards.
Auto-redeem and loyalty tiers
**Auto-redeem** applies before loyalty tier checks are performed. This means that if you have a configuration like Auto-Redeem at 100 points and Tier X threshold of 100 point balance, a customer will never reach that tier. This happens because the points will be automatically spent with **Auto-Redeem** before the balance is checked for tier qualification.
However, for loyalty tiers based on points collected within a defined period, **Auto-Redeem** doesn't interfere. Since these tiers are based on the total points earned rather than the current balance, the fact that points are automatically redeemed doesn't impact the number of points collected during a given period.
If a customer were to trigger auto-redeem more than 10 times on a single day, Voucherify will block auto-redeem for that reward as an anti-fraud mechanism. Usually, this may be caused by a faulty loyalty program configuration.
Contact [Voucherify support](https://www.voucherify.io/contact-support) to unlock auto-redeem if this happens.
## Loyalty point balance types
In loyalty card details, you can find the following information about loyalty points.
| Type | Description | Availability for redemption |
| :------------------------ | :------------------------------------------------------------------------------------------ | :----------------------------- |
| **Balance** | Points that have cleared the pending period, haven't expired yet, and are ready to be used. | **Yes** |
| **Pending point balance** | Points earned, but currently held during the set pending period. | **No** |
| **Expired points** | Points that have passed their set expiration date or period. | **No** |
| **Subtracted points** | Points that have been manually subtracted from the loyalty card. | **No** (for tracking purposes) |
| **Lifetime points** | The sum of all points ever earned by the customer (active + pending + redeemed + expired). | **No** (for tracking purposes) |
## Point and tier calculation on a new day
Loyalty points and tiers are recalculated at midnight of each new day according to an internal Voucherify mechanism. This occurs every day at midnight in the timezone set in **Project settings**.
The mechanism works as follows:
1. **Pending point activation**\
At a pending point bucket level, the activation date is set by specifying when the points are going to be activated.\
For example, an activation date of `2026-01-01` means that points will be activated on `2026-01-01 00:00`.
2. **Auto-redeem**\
After the pending points have been activated, the system checks whether the points should be automatically spent on a reward, so no other effect occurs (like a tier upgrade).
3. **Loyalty tier recalculation**\
Based on tier settings, the following actions are performed:
1. **Recalculation of expiring tiers**\
An expiration date is set by specifying when the tier will expire.\
For example, an expiration date of `2025-12-31` means that the tier will expire on `2026-01-01 00:00` (this is the same date and time as pending point buckets).\
As a result, the customer can upgrade, downgrade, leave, or prolong their tier.
2. **Recalculation of tiers when a new calculation period starts**
4. **Loyalty point expiration**\
At an expiration bucket level, the expiration date is set by specifying when the points are going to be deducted.\
For example, an expiration date of `2025-12-31` means that points will be deducted on `2026-01-01 00:00` (this is the same date and time as pending point buckets).
5. **Loyalty tier recalculation based on the point balance after point expiration**\
Once the points are deducted, the balance changes so that balance-based tiers are updated accordingly.
# Loyalty tiers
Source: https://docs.voucherify.io/build/loyalty-tiers
Learn how loyalty tiers work in Voucherify
Legacy loyalty
This page describes the legacy loyalty program model.
Legacy loyalty is in maintenance mode. Voucherify is not actively developing new features for this model, but your existing programs remain supported and critical issues will continue to receive fixes.
The legacy loyalty program will be eventually sunset. If you have questions about what this means for your program, migration, or timelines, contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify support form") or your Technical Account Manager.
Loyalty tiers are optional membership levels within your loyalty program.
Add as many tiers as you need per campaign.
**Example:** Basic, Silver, Gold, Platinum.
Determined by either **Point balance** or **Points collected in a period**.
**Example:** Points balance (100–499 points).
Each tier can define point multipliers to increase or decrease earned points per rule.
**Example:** 2x points for Gold tier members.
Each tier can define multipliers or custom values for reward point prices.
**Example:** Reward X costs 50% fewer points for Gold tier members.
## Qualification by point balance
The **Point balance** method qualifies customers based on their current, spendable point balance falling within the tier's defined minimum and maximum point range.
### Point balance – tier status logic
The **Point balance** tiers work as follows:
* **Tier start date**:
* **Immediately** (default behavior): The customer's tier is immediately upgraded when their point balance reaches the minimum threshold.
* **Tier expiration date**:
* **Immediately** (default behavior): The customer's tier is immediately downgraded when the balance falls below the minimum range.
* **Custom**: The tier remains valid for a defined period (months), even if the customer's balance falls out of the range. The expiration date counter starts when the customer reaches the minimum required points needed in the tier. Additionally, you can round up the expiration period until the end of a selected period (for example, end of a calendar month, quarter, year).
The auto-redeem feature operates before loyalty tier checks are performed. This creates a conflict for **Point balance** tiers and may prevent the customer from meeting the tier's qualification threshold.
## Qualification by points collected in a period
The **Points collected in a period** method qualifies the customer when they earn a defined number of points to reach the tier threshold within a specific time period.
Qualification is based on **collected points** (earned) rather than the current balance. As a result, **auto-redeem** does not interfere with these tiers.
### Qualification periods
The customers can earn points with **Points collected in a period** in the following time ranges:
* **Calendar month**: Points collected in one calendar month (January, February, and so on).
* **Calendar quarter**: Points collected in a quarter (from January until March, from April until June, and so on).
* **Calendar half-year**: Points collected in the half-year (from January until June and from July until December).
* **Calendar year**: Points collected in one calendar year (from January until December).
### Points collected in a period – tier status logic
The resulting tier status is determined by the combination of the start date and expiration date configurations:
* **Tier start date**:
* **Immediately**: Tier starts immediately when the threshold is reached.
* Example: For monthly qualification periods, the customer collects a required number of points on the 10th day of the month and the tier will start from that day.
* **Next calendar month**: Tier start is postponed until the beginning of the subsequent qualification period.
* Example: For monthly qualification periods, the customer collects a required number of points on the 10th day of the month (for example, March), the tier will start from the 1st day of the following month (April).
* **Tier expiration date**:
* **End of the qualification period**: Tier is valid until the end of the period in which it was granted.
* Example: For monthly qualification periods, the tier will be valid until the end of the month it was granted (for example from 10th March until 31st March).
* **End of the next calendar month**: Tier is valid until the end of the following period after it was granted.
* Example: For monthly qualification periods, the tier will be valid until the end of the following month based on the month the tier was granted (for example from 10th March until 30 April).
* **Extend expiration date by**: You can add a grace period to the tier expiration date to extend the time in days or months and delay tier downgrades.
* Example: For monthly qualification periods, the tier will be valid until the end of the month or the end of the next month in which the tier was granted and defined an additional 7 days period in the extensions. The tier will expire not at the end of the month but on the 7th day of the next month.
## Mapping earning rules and rewards
You can change the number of points given by an earning rule or the reward cost in points depending on the loyalty tier the customer is in:
* **Earning rules mapping**: Defines point **Multipliers** that increase or decrease the number of earned points per rule. You can also set a **Custom** number of points to change the default earning rule value.
- **Rewards mapping**: Defines **Multipliers** or **Custom** values that set new reward point prices for tier members. A reward can be also disabled for a tier using the **Not available** option. The **Custom** value is not available for **Pay with points** rewards.
## Tier campaign modification rules
You can change an existing campaign's qualification rules or tier structure.
Perform changes to **qualification rules** and **tier structure** in **sequential, separate campaign modification steps**. Otherwise, the system might schedule two asynchronous tasks, leading to potential discrepancies in customer tier updates.
### Qualification rules changes
You can trigger qualification rule changes by selecting the **Refresh tiers** option in the Tiers step under the expiration options when editing a campaign:
* Without the **Refresh tiers** option selected: Customer tiers remain unchanged according to the new rules upon campaign save. No tier upgrades or downgrades occur.
* With the **Refresh tiers** option selected: Customer tiers may be refreshed according to the new rules upon campaign save. Tier upgrades may occur, and expiration dates may be shortened or extended, but no downgrades will happen.
### Tier structure changes (thresholds)
Tier structure changes involve adding new tiers or modifying existing points thresholds:
* **Adding new tiers or changing points thresholds**:
* **Customer tiers without expiration dates**: Tiers are updated according to the new structure upon campaign save. Both tier upgrades and downgrades may happen.
* **Customer tiers with expiration dates**: Customers will not be downgraded to lower tiers but may be upgraded to higher tiers according to the new structure upon campaign save. Tier upgrades may occur, but no downgrades will happen.
- **Removing tiers**: Customers lose the removed tiers immediately upon campaign save.
# Product bundles
Source: https://docs.voucherify.io/build/product-bundles
Overview of product bundles, BOGO mechanics, discount types, limits, and bundle behavior
A bundle is a group of products, services, or features offered together as a single package. Bundles are often priced lower than the total cost of purchasing each item separately. In Voucherify, bundles work with cart promotions, generic codes, and unique codes.
This article describes in detail how bundles work, including bundle multiplication that multiplies discounts and limits based on the number of bundles in the cart.
## Glossary
A bundle is a group of products, services, or features offered together as a single package. Bundles are often priced lower than the total cost of purchasing each item separately.
Bundled items are the individual products or services that make up a bundle. When a customer buys all required bundled items together, they become eligible for the bundle discount or reward.
The minimum quantity of products defines how many items must be included in the bundle for it to qualify for the promotion. If the customer adds fewer items than the minimum, the bundle discount doesn’t apply.
The maximum number of eligible bundles sets a cap on how many bundles can be counted in a single order. This limit controls how many times the bundle discount can apply per transaction.
We recommend setting an item discount limit in:
* **Amount discount**: Apply the full discount to each item unit
* **New price**: Apply the discount to item unit
* **Upgrade Bonus**: Replace order items
Without the limit, each eligible unit receives the discount, regardless of how many bundles are in the order. By default, Voucherify automatically assigns the item discount limit for the discounted items to 1.
## Bundle scaling
Bundle scaling determines whether the discount is applied once or multiplied by the number of eligible bundles in the cart.
Use this setting to control how the discount value or limit behaves when multiple bundles are detected.
### Options
The discount scales automatically based on the number of eligible bundles in the cart.
* Discount values (amount or percentage) are multiplied by the number of bundles
* Limits (such as maximum discounted units) are also multiplied accordingly
For example, a \$5 discount per bundle results in a \$10 discount when two bundles are applied.
The discount is applied once, regardless of how many bundles are in the cart.
Choose this option if your formula already includes bundle quantity (e.g. `order.bundle.quantity`).
* Prevents double multiplication
* Gives full control over how the discount is calculated
Bundle scaling does **not apply** to the following discount types:
* **New price: Apply to whole cart**
* **New price: Apply the discount to item unit**
For these types, the discount value is not multiplied by the number of bundles, regardless of the selected option.
## Buy X, get Y for free
The **Buy X, get Y for free** discount category has the following types.
### Free products: Add missing order items to match total discount units count
**Free products: Add missing order items to match total discount units count** adds only the missing free products. It will match the total defined maximum number of eligible bundles limit.
**Example:**
Buy 1 laptop → get 1 laptop bag free.
Buy 2 laptops → get 2 laptop bags free to reach the required total.
**Result**:
The number of free products is multiplied by the number of bundles.
### Free products: Always add new units items
**Free products: Always add new units items** always adds new free products. It ignores whether the same product already exists in the cart.
**Example:**
Buy 1 pair of shoes → get 1 pair of socks free.
Buy 3 pairs of shoes → get 3 pairs of socks free, regardless of existing ones.
**Result**:
The number of newly added free products is multiplied by the number of bundles.
### Free products: Add many order items
**Free products: Add many order items** adds multiple free products at once when several bundles are qualified.
**Example:**
Buy 1 pizza + 1 cola → get 2 free desserts.
Buy 2 pizzas + 2 colas → get 4 free desserts.
**Result**:
All free products are multiplied by the number of bundles.
### Upgrade bonus: Replace order items
**Upgrade bonus: Replace order items** replaces existing products with upgraded ones. The multiplication applies to both the added and removed items.
**Example:**
Buy 1 small coffee → upgrade to 1 large coffee.
Buy 3 small coffees → upgrade to 3 large coffees.
**Result**:
The number of replaced and added products is multiplied by the number of bundles.
## Discount whole order
The **Discount whole order** discount category has the following types.
### Amount discount: Apply to whole cart
**Amount discount: Apply to whole cart** applies a fixed amount discount to the entire cart. The discount value is multiplied by the number of bundles.
**Example:**
\$1 discount per bundle (lip balm + hand cream)
5 × lip balms + hand creams → \$5 off the whole cart.
**Result**:
The discount value is multiplied by the number of bundles and applies to the cart total.
### Percent discount: Apply to whole cart
**Percent discount: Apply to whole cart** applies a percent discount to the entire cart. The percentage value is multiplied by the number of bundles.
**Example**:
5% discount per bundle (cleaning spray + microfiber cloth)
5 × cleaning sprays + microfiber cloths → 25% off the whole cart.
**Result**:
The percentage discount value is multiplied by the number of bundles and applies to the entire cart.
### New price: Apply to whole cart
**New price: Apply to whole cart** applies a fixed total price for the cart. The discount value is not multiplied.
**Example:**
New total cart price: \$50 per bundle (phone case + screen protector)
5x phone cases + screen protectors → \$50 total, not multiplied.
**Result**:
The discount value is not multiplied by the number of bundles. The total fixed price applies once to the entire cart.
## Discount bundle items by fixed amount
The **Discount bundle items by fixed amount** discount category has the following types.
### Amount discount: Apply the full discount to each item unit
**Amount discount: Apply the full discount to each item unit** applies a full discount to each item unit. The number of discounted units is multiplied by the number of bundles. By default, Voucherify automatically assigns the **Maximum eligible units per order item** limit to 1. Without a limit, each eligible unit receives the discount, regardless of how many bundles are in the order.
**Example**:
Laptop + bag, get \$20 off for a single mouse
Cart 1: Limit set
**Bundle**: Laptop + Bag
**Discounted product:** Mouse collection
**Discount rule:** **Maximum eligible units per order item** limit set to **1**
**Cart contents**:
Laptop × 2
Bag × 2
Mouse × 3 – \$40 total
**Explanation**:
The cart contains two complete bundles (Laptop + Bag × 2). Each bundle qualifies for one discounted mouse because the discount limit is set to one per bundle. Only two mice receive the discount, giving the customer a total discount of 2 × $20 = $40. The third mouse remains at full price.
Cart 2 – No Limit Set
**Bundle**: Laptop + Bag
**Discounted product:** Mouse collection
**Discount rule:** No maximum eligible units per order item limit set
**Cart contents**:
Laptop × 2
Bag × 2
Mouse × 3 – \$60 total
**Explanation**:
The cart again includes two complete bundles (Laptop + Bag × 2). Because there is no limit on the number of discounted items, all three mice receive the discount, so it’s \$60 in total. The rule applies to every matching product in the cart, not just one per bundle.
**Result**:
The discount value remains the same per unit item. The number of max discounted units is multiplied by the number of bundles.
### Amount discount: Apply the discount to item subtotal
**Amount discount: Apply the discount to item subtotal** applies a fixed discount to the subtotal of each targeted product. The discount value is multiplied by the number of bundles.
If a customer splits identical items into separate order lines, the discount applies individually to each line. This results in a higher total discount than if the items were grouped.
**Example**:
Bundle: Laptop + bag, get \$20 off for a mouse collection product
Cart 1: Combined mouse order line
**Bundle**: Laptop + Bag
**Discounted product:** Mouse collection
**Discount rule:** \$20 for each bundle
**Cart contents**:
Laptop × 2
Bag × 2
Mouse × 3 (one order line) \$40 discount
**Explanation**:
The cart includes two complete bundles (Laptop + Bag × 2), making the customer eligible for a \$40 subtotal discount. Because all three mice are grouped in a single order line, the discount is applied once to that line’s subtotal.
Cart 2: Split mouse order lines
**Bundle**: Laptop + Bag
**Discounted product:** Mouse collection
**Discount rule:** Subtotal discount applies separately to each order line
**Cart contents**:
Laptop × 2
Bag × 2
Mouse × 1 \$40 discount
Mouse × 1 \$40 discount
Mouse × 1 (three separate order lines) \$40 discount
**Explanation**:
The cart again includes two complete bundles (Laptop + Bag × 2). Because each mouse is on a separate order line, the discount is applied individually to each line. Each mouse line receives a \$40 discount, resulting in a total of \$120 off.
**Result**:
The discount value is multiplied by the number of bundles and applied to the subtotal of each targeted item.
## Discount percentage off bundle items
The **Discount percentage off bundle items** discount category has the following types.
### Percent discounts (item level)
**Percent discounts (item level)** applies a percentage discount to targeted items. The discount percent is multiplied by the number of bundles.
**Example:**
5% per bundle (2 packs of crisps)
4x packs of crisps → 10% off all soda drinks in the targeted collection.
**Result**:
The discount value is multiplied by the number of bundles. The maximum number of discounted units is not multiplied.
## Set price for bundle items
The **Set price for bundle items** discount category has the following types.
### New price: Apply the discount to item unit
**New price: Apply the discount to item unit** sets a new price for selected items. The value does not multiply, but the number of affected items multiplies by the number of bundles.
**Example**:
Set price: \$10 per ticket, \$2 per drink
**Maximum eligible units per order item** limit set to: 1 ticket and 2 drinks per bundle.
2 bundles = up to 2 tickets at \$10 and 4 drinks at \$2 discounted.
**Result**:
The discount value is not multiplied by the number of bundles. The number of affected products is multiplied by the number of bundles.
## Split discount between bundle items
The **Split discount between bundle items** discount category has the following types.
### Amount discount: Split the discount proportionally to amount
**Amount discount: Split the discount proportionally to amount** splits the discount proportionally based on the subtotal of each item. The discount value is multiplied by the number of bundles.
**Example**:
**Bundle**: Coffee Machine + Grinder
**Discounted products**: Coffee Beans + Filter Pack
**Cart contents**:
Coffee Machine × 2
Grinder × 2
Coffee Beans – \$30 (60% of the discounted amount)
Filter Pack – \$20 (40% of the discounted amount)
**Explanation**:
The discount is \$10 per bundle. With two bundles, the customer gets \$20 off in total. The discount is split proportionally – Coffee Beans receive \$12 (60%) and the Filter Pack receives \$8 (40%).
The allocation is based on the subtotal of all targeted order line items, not just the items within a single bundle.
**Result**:
The discount value is multiplied by the number of bundles and split proportionally across the targeted order line items based on their subtotal value.
### Amount discount: Split the discount proportionally to quantity
**Amount discount: Split the discount proportionally to quantity** splits the discount proportionally by product quantity. The discount value is multiplied by the number of bundles.
**Example**:
**Bundle**: Tennis Racket + Sports Bag
**Discounted products**: Tennis Balls + Wristbands
**Cart contents**:
Tennis Racket × 2
Sports Bag × 2
Tennis Balls × 3 (60% of the discounted quantity)
Wristbands × 2 (40% of the discounted quantity)
**Explanation**:
The discount is \$10 per bundle. With two bundles, the customer qualifies for a \$20 total discount. The discount is split based on quantity – Tennis Balls (3 units) receive \$12 (60%), and Wristbands (2 units) receive \$8 (40%).
**Result**:
The discount value is multiplied by the number of bundles and split proportionally by quantity.
# Referral program overview
Source: https://docs.voucherify.io/build/referral-campaign-overview
Understand the core concepts and workflow of building referral programs in Voucherify
Referral programs turn your existing customers into brand advocates. By rewarding users for inviting their friends, you create a self-sustaining growth loop that lowers acquisition costs and increases customer lifetime value.
Learn how referral mechanics work, from rewarding the referrer and the referee to managing multi-level programs.
## Key referral concepts
The following concepts are key for understanding the referral program.
The existing customer who shares their unique **referral code** with others. They receive a reward once their friend redeems the code or performs the custom event.
The new customer who joins using a **referral code** or performs the custom event. They often receive a "welcome" incentive to encourage their first interaction with your brand.
A unique code assigned to a **referrer**. When a **referee** redeems (uses) this code, Voucherify links the two profiles to track the successful conversion event.
A conversion event is the specific action that triggers a successful referral in Voucherify. Each campaign can only have one primary conversion event: code redemption or custom event.
A reward level that defines when and how a referrer is rewarded. Tiers enable milestone-based and multi-level referral programs.
There are two criteria for rewarding the referrer:
* Each unique referee redemption
* Minimum unique referee redemptions
By setting referral tiers, referrers can receive better rewards when they refer, for example, more than 20 people, and even more rewards when they refer more than 50.
An incentive issued to referrers and, in double-sided programs, to referees. Rewards can include discounts, gift credits, or loyalty points.
The assignment of a referral code to a specific customer. Codes must be published before a customer can start referring others.
Optionally, codes can also be shared by non-referrers, allowing multiple people to distribute the same code.
A setting for referral programs that ensures a customer can hold only one **referral code** per campaign. Once set, this can't be toggled off in the **Dashboard**.
An optional mode where the application automatically generates new unique **referral codes** when the initial batch runs out.
## Referral program types
When setting up your incentive workflow in the Campaign Manager, you must decide between a single-sided or double-sided structure. This determines who is rewarded when a conversion event occurs.
### Single-sided programs
In a single-sided program, only the referrer (the person sharing the code) is rewarded. The referee (the invited friend) joins the program or performs an action but does not receive an incentive from the referral campaign itself.
### Double-sided programs
A double-sided program rewards both the referrer and the referee. This "mutual benefit" model is often more effective at driving high conversion rates because it incentivizes the invited customer to complete their first purchase or sign-up.
## Conversion events
A conversion event triggers a successful referral either by redeeming a referral code or by triggering a custom event in your system.
### Referral code redemption
The most common conversion event is a successful redemption.
1. The referrer shares a code with a referee (new customer).
2. The referee uses the referral code during a checkout process (redemption).
3. Voucherify marks the customer as "referred" the moment the redemption is successful. If a discount is assigned to the referee, it is applied directly to their order during this step. Then:
* 3a: Referee receives a reward in case of a double-sided program.
* 3b: Referrer has a successful referral and receives a reward as configured by the program.
A referrer can't redeem the code they own. Only referees can.
### Custom events
Prerequisite: Developer setup
Tracking custom events in your system requires sending them to Voucherify through [POST Track custom events](/api-reference/events/track-custom-event) API endpoint.
When Voucherify tracks your custom events, the conversion event flow looks as follows:
1. The referrer shares a code with a referee (new customer).
2. Voucherify counts a successful referral only after receiving the API call for the specific event. The API request should include the referee's details and the referral code.
3. After the custom event, the referrer and the referee (in a double-sided program) are rewarded:
* 3a: New loyalty points or gift credits are assigned to the referee's account after they perform a custom event.
* 3b: Voucherify notes another successful referral and assigns a reward to the referrer (reward redemption).
4. If a referee's reward is a discount code, it is applied to the referee's order during the referral code redemption.
## Referee rewards
In double-sided programs, the new customer also receives a reward when the conversion event occurs.
### Reward types
You can choose from several reward categories depending on your business model:
* **Discount coupon**: Applies an immediate discount (e.g., 20% off, free shipping, or a fixed amount) to the referee's order when the referral code is used for redemption.
* **Gift card credits**: Adds a specific balance to the referee's gift card.
* **Loyalty points**: Adds points to the referee’s loyalty card, which can be redeemed for future rewards.
If a referee doesn't already have a loyalty or gift card, Voucherify will automatically publish one to their profile before adding the points or credits.
### Validation rules for referees
To prevent fraud and ensure high-quality leads, you can add a **validation rule** to referee rewards.
The recommended default rule is **Redemptions per customer in a campaign** set to 1. This ensures that each new customer can only be "referred" once, maintaining the integrity of your campaign budget.
## Referral workflow
Voucherify supports the referral program lifecycle through the following stages:
Build your referral logic in the **Dashboard**. This includes selecting **conversion event**, reward **tiers** and **criteria**, and defining specific **rewards**.
Assign **referral code**s to your advocates through [publication](/orchestrate/code-publication). You can use **distributions** to send these codes with email, text messages, or display them directly in your application.
When a friend performs the **conversion event** (code redemption or custom event), they provide the **referrer**'s **referral code**. Voucherify checks the code and records the link between the **referrer** and the **referee**.
For double-sided programs, the referee receives their reward at this step.
Once the defined criteria (each unique referee redemption or minimum unique referee redemptions) in a referral tier are met, Voucherify automatically triggers the reward for the referrer.
Track the performance of your referral campaigns using real-time reports to understand what drives customer engagement.
# Referral code import
Source: https://docs.voucherify.io/build/referral-code-import
Learn how to import referral codes to Voucherify
If you need to migrate referral codes from another system, you can use the **Import CSV tool** in the Dashboard.
The tool enables you to:
* Import new referral codes into a campaign.
* Update selected attributes of existing referral codes.
When importing codes to a campaign, the system applies two simultaneous limits for the import file:
* **Code count limit**: Up to **100,000** codes.
* **File size limit**: Up to **10 MB** CSV file size.
The import will stop when **whichever limit hits first**.
Note that **100,000 codes** is the overall campaign code limit. If the campaign already contains codes (e.g., 50,000 codes), only the remaining capacity (e.g., 50,000 codes) will be imported to maintain the 100,000 total code limit.
Important
* The start and expiration dates in the CSV file should be provided in compliance with the **ISO 8601** standard, for example, `2020-03-11T09:00:00.000Z`.
* CSV columns mapped to custom attributes will be added as code metadata. The number of custom attributes you can import as metadata is unlimited.
* You cannot import two identical codes to a single Voucherify project.
* When importing existing incentives (discount coupons, referral codes, loyalty cards, or gift cards) into a campaign, only two fields can be updated: the **active** status (`true/false`) and the **category**. All other attributes remain unchanged.
## Preparing CSV file for referral codes
Referral campaign prerequisite
Before importing, create a referral campaign in Voucherify.
Referral codes can only be imported into an existing referral campaign.
Imported codes inherit campaign settings unless explicitly overridden.
Use the CSV referral code file template for faster preparation.
### Required fields
* **Code**: A unique referral code value. You cannot import two identical codes into a single Voucherify project.
### Optional fields
* **Active**\
Enables or disables the referral code.\
Accepted values: `TRUE` or `FALSE`.
Import behavior:
* If the campaign is **Active** and the `active` field is omitted, imported codes are set to `TRUE`.
* If the campaign is **Expired** and the `active` field is omitted, imported codes are set to `FALSE`.
* **Category**\
A custom tag assigned to the referral code for filtering and organization.
* **Redeemed quantity**\
The number of times the referral code has already been redeemed. If omitted, the value defaults to `0`. This works only for new codes.
* **Start date**
The date and time when the referral code becomes active.
Accepted format: ISO 8601 (e.g., `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm:ssZ`). If omitted, the referral code is active immediately upon creation.
* **Expiration date**
The date and time when the referral code is no longer valid for redemption.
Accepted format: ISO 8601. Once this date passes, the referral code status automatically changes to `Expired`.
* **Metadata (custom attributes)**
Metadata allows you to add custom information to Voucherify objects. There are two ways to handle it:
* **Metadata (Schema)**: These are fields you define in **Project settings** > **Metadata schema**. You choose the data type (like string or number) and if the field is mandatory. This ensures your metadata is consistent.
* **Metadata (Unknown)**: These are fields sent to Voucherify without being defined first (through the API, imports, or manual entry). They are always treated as simple text strings. They are useful for one-time metadata, but they do not support advanced filtering or strict validation.
Metadata import behavior:
* If metadata columns are omitted, the referral code inherits the campaign’s metadata.
* If metadata columns are added and mapped, only those specific fields are overridden.
* Metadata that is not mapped remains unchanged.
Fields other than the ones listed above will not be imported. Even if you provide them, they will be skipped.
All unmapped attributes inherit the campaign’s default settings, including validation rules, reward logic, and time limits.
## Updating existing referral codes
You can re-import existing referral codes to update them.
When importing existing referral codes:
* Only **Active** status and **Category** can be updated.
* Other attributes remain unchanged.
Referral code values cannot be changed. To replace a code, create a new one.
## Import referral codes to a campaign
In **Campaign hub** > **Campaigns**, open your referral campaign.
In the top-right corner, use the three-dot menu to **Import CSV file**.
Upload your prepared CSV file.
Once uploaded, you'll see an overview of first rows and columns of the file.
In **Map Fields**, select for each CSV column:
* **Do not map** to skip that column.
* **Voucherify fields** to **Select** Voucherify properties, like **Code**, **Voucher type**, and so on.
* **Metadata (Schema)** to map a given column to custom attributes that are defined for vouchers.
* **Metadata (Unknown)** to map to an undefined custom attribute key.
Once ready, **Import** and wait for notification when the import is complete.
For large imports, the process can take a significant amount of time.
# Changelog
Source: https://docs.voucherify.io/changelog/changelog
Product updates and announcements
## Added
### Metadata values when adding vouchers to a campaign
You can now provide specific metadata values when adding vouchers to an existing campaign via the UI. If your campaign already uses a metadata schema, relevant fields will be prepopulated to save you time during the setup process.
## Added
### Dedicated loyalty program resource pages
Point Wallets, Earning Rules, and Rewards each get their own listing page within a loyalty program now, instead of being tucked into a shared view. You can reach them through breadcrumb navigation, so drilling into one resource and finding your way back to the others is more straightforward.
## Improved
### Higher tier limit in a tier structure
Tier structures were capped at 10 tiers. That cap is now 100, so programs with more granular tier progression don't have to work around the limit.
### Clearer discount calculation type order
When configuring earning rules, **post-discount** now appears before **pre-discount** in the calculation type order, putting the option most people reach for first.
## Fixed
* **Member metadata editing**: You can now edit a member's metadata directly from the UI, instead of having to delete and recreate the entry to change it.
## Added
### Dedicated SKU drawers
Getting the full picture on a SKU used to mean digging through tabs. We introduced a dedicated **SKU drawer** that gives you a comprehensive view of SKU details, attributes, and metadata in one place.
The drawer opens directly from the product builder and from any resource link that points to a SKU, so you don't lose your place to go look something up.
### Error message library
Validation rules are only as good as the message a customer sees when they fail one. You can now create and manage a centralized **error message library**: multi-language validation error messages that you define once and reuse across campaigns.
Need something more specific for a particular campaign or language? You can still define custom messages per language on top of the library.
## Improved
### Help button
The floating help button is gone. In its place: a **Get Help** option in the sidebar, alongside the rest of your navigation.
### Voucher list table view
The voucher list has moved from cards to a compact table. Each row now shows campaign name and redemption status, codes are easier to copy, and availability toggles are available right from the row menu, so bulk management no longer means opening vouchers one at a time.
### Campaign list details
The campaign list now surfaces discount type and campaign category up front. ID columns are gone, giving campaign names more room to breathe. The status column is more compact, with time-based indicators and tooltips replacing long labels, and the discount column now separates type, value, and effect into a clearer layout instead of cramming them into one line.
## Fixed
* **DemoShop access for merchants**: Merchants can no longer access DemoShop.
* **Formula editor parentheses**: The formula editor no longer strips parentheses during auto-formatting, so pasted and edited formulas keep their intended structure and calculation logic.
* **Analytics graph dates**: Dates on analytics graphs now display correctly for non-US locales.
## Removed
* **"Standalone" campaign wording**: References to "standalone" campaigns have been removed from filters, labels, and descriptions, and aligned with the generic campaign wording used everywhere else.
## Added
This release brings the whole new loyalty v2 program model.
### Loyalty v2
Loyalty v2 is now available for production use. We rebuilt loyalty so you can launch programs that are easier to design, extend, and integrate, without locking every rule into a single campaign setup.
The new model separates how members earn, keep, and spend value into reusable components. That means you can run multiple point wallets in one program, reuse earning rules, benefits, and rewards across designs, and evolve tiers and catalogs as the program grows without rebuilding the whole campaign each time. In the dashboard, you manage this in **Loyalty hub**. For integrations, the new `/v2/loyalties` API covers the full member journey, from enrollment and discovery through earning, spending, and fulfillment. Legacy `/v1/loyalties` remains available in maintenance mode.
#### In Loyalty hub
Configure modular programs from point wallets, earning rules, tier structures, benefits, and rewards. Start with a basic earn-and-spend program, then add richer earning logic and reward catalogs as you scale—keeping the program coherent as your loyalty strategy matures through incentive experimentation.
Go to the following pages to learn more about loyalty v2:
* [Loyalty key concepts](/build/loyalty-key-concepts)
* [Loyalty program overview](/build/loyalty-overview)
* [Create a basic loyalty program](/build/create-loyalty-program)
* [Point wallets](/build/create-point-wallets), [earning rules](/build/create-earning-rules), [tiers](/build/create-tier-structures), [benefits](/build/create-benefits), [rewards](/build/create-loyalty-rewards)
#### With the API
Enroll and manage members, examine earning rules and rewards before committing changes, process pay-with-points order payments, purchase rewards, and read memberships and transactions. Follow the integration path from sandbox setup through production deployment.
Go to the following pages to learn more about loyalty v2 API:
* [Loyalty v2 developer overview](/guides/loyalty-v2-overview)
* [Integrate loyalty v2](/guides/loyalty-v2-integrate)
* [Take loyalty v2 to production](/guides/loyalty-v2-take-to-production)
* [Loyalty v2 API reference](/api-reference/loyalty-v2-api-overview)
* [Loyalty v2 workshop](https://github.com/voucherifyio/loyalty-workshop)
## Improved
* **Approval flow with promotion tier transfer**: You can now transfer promotion tiers between projects even when the destination project requires mandatory approval requests. This ensures your governance rules are always respected.
* **Entity status in dropdowns**: Expanded pickers and dropdowns include real-time status or type information for each selectable item to improve readability.
* **Campaign scheduling**: To help protect budgets and marketing strategy, the campaign creation process now prevents start dates from being set in the past. You still have full flexibility to adjust dates when editing existing campaigns.
## Added
### Areas: Public v1 API
You can now manage **Areas** through the public REST v1 API. [Areas](/orchestrate/areas-and-stores) represent geographic or organizational groupings used with campaigns and products tied to areas and stores.
This lets you automate area setup and maintenance from external systems without using management-only API flows.
The following endpoints are available:
* **GET `/v1/areas`**: List areas (supports pagination).
* **GET `/v1/areas/{areaId}`**: Get a single area.
* **POST `/v1/areas`**: Create an area.
* **PUT `/v1/areas/{areaId}`**: Update an area.
* **DELETE `/v1/areas/{iareaId}`**: Delete an area.
To authenticate, use your standard server-side API key (`X-App-Id` / `X-App-Token`). Read operations require the **`areas.read`** permission; create, update, and delete require **`areas.manage`**.
These endpoints are available when your project has **Areas and Stores for campaigns**.
### OAuth service API keys
You can now create **OAuth Service API keys** in **Project settings** or **Team settings** > **OAuth Service** (global, multi-project). Assign a role to each key to control which permissions its tokens can carry. For multi-project, you can assign a separate role per each project.
### OAuth v2 token endpoint
Use `POST /v2/oauth/token` with `grant_type=client_credentials` to exchange OAuth Service key credentials (`Authorization: Basic base64(app_id:app_secret)`) for a 15-minute Bearer token.
Required parameters: `grant_type`, `scope`, and `project_id`.
Scopes use fine-grained permission codes such as `vouchers.read` and must stay within the key’s assigned role.
OAuth v1 (`POST /v1/oauth/token` with server-side API keys) remains available. OAuth v2 is the recommended approach for new machine-to-machine integrations.
## Fixed
* Qualifications API: Fixed an issue where the Qualifications API incorrectly processed the "has exactly" rule for metadata arrays. This update ensures that customers with empty metadata segments or specific preferences are correctly qualified for their eligible discounts.
## Fixed
* Formula builder:
* Fixed an issue where the formula editor incorrectly removed parentheses during auto-formatting, which could lead to incorrect calculation results. The editor now correctly preserves the formula structure and mathematical logic when pasting or editing.
* When selecting voucher or promotion tier metadata in the formula builder, the formula will properly use the `REDEEMABLE_METADATA` keyword.
## Improved
* **Time frame** configuration: The **Valid on specific hours** setting now accepts an empty **Expiration time** value. When it is empty, the validity lasts until the end of the day. This improvement works also for the `expiration_time` property in the API.
## Fixed
* **Activity**: Activity tab filters now correctly display attributes regarding activity instead of resources.
## Fixed
### Redemption rollback
Fixed an issue that allowed multiple concurrent rollbacks through the API for one redemption if they were made in the same milisecond or when the later request was processed before the first one. Now, the API will return a `400` error response with `multiple_requests` key.
### GET List publications
Fixed an issue that returned publications through the GET List publications endpoint with a `campaign` query parameter for a deleted campaign that shared the name with an existing campaign. Now, the endpoint will return publication results only for the existing campaign.
## Improved
### Accurate dashboard metrics
Publications and redemptions counts on the campaigns list now refresh the way they should. Hit reload and you'll see your most recent activity right away, no stale numbers in the way.
## Fixed
### Reliable voucher exports
Voucher exports from a campaign were sometimes ignoring your applied date filters. Fixed: your CSV exports now match the filtered list you see on the dashboard, every time.
## Added
### New redesigned formula builder
We’ve redesigned the discount formula builder to make formulas easier to write, edit, and review. The formula language and validation rules remain the same.
Formulas are now edited directly in the form field instead of a separate pop-up dialog. The field expands from a single line to multiple lines as the formula grows.
The previous token-based flow has been replaced with a code-style editor. You can type formulas directly, use syntax coloring, and get autocomplete suggestions for variables, metadata fields, operators, and functions.
When you select the formula field, a floating toolbar opens with shortcuts for inserting building blocks, adding starter templates, formatting expressions, and clearing the input.
For complex formulas, such as nested `IF` or `SWITCH` functions, you can open a visual diagram view. The diagram shows the formula as an interactive tree graph with zoom and pan controls. A resizable text strip and a collapsible **Logic breakdown** panel stay in sync with the formula text.
You can also explore the new builder in an [interactive step-by-step feature demo](https://app.demoboost.com/playback/WK3oShdK?step=1).
## Fixed
### Metadata schema
You can now create metadata fields when a metadata schema contains invalid references to object types that no longer exist.
## Removed
The following features were removed from Voucherify.
### Customer cockpits – Management API
As part of removing the cockpit functionality, the `cockpits` property was removed from the following Management API endpoints for managing brands:
* [POST Create brand](/api-reference/management/create-brand)
* [GET List brands](/api-reference/management/list-brands)
* [GET Get brand](/api-reference/management/get-brand)
* [PUT Update brand](/api-reference/management/update-brand)
## Improved
### New campaign list layout
The campaign list has been updated from a card-based view to a compact table layout. Key campaign details, including status, type, category, dates, voucher count, publications, and redemptions, are now easier to review across multiple campaigns.
Campaign details can now also be opened in a side drawer directly from the list, making it possible to view information without leaving the current page.
## Fixed
### Loyalty campaigns UI
Increased the limit of displayed rewards in the loyalty campaign user interface to ensure all assigned items are visible. You can now view more than 100 rewards at once without any display restrictions.
## Fixed
This release brings fixes to issues in the qualification API.
### Qualifications
* Fixed an issue that failed to return codes from generic (standalone) campaigns when those codes were not published or redeemed first. Now, generic codes will be returned by the qualification API also when they haven't been published.
* Fixed an issue that returned a bulk (individual) code that was redeemed but not published. Now, only the published bulk codes are returned in the qualification API.
## Fixed
### Marketing permissions access
Fixed an issue where users with Viewer access could still open the Marketing permissions tab. The tab is now correctly disabled for users without permission to manage customer consent settings.
### Discount builder display
Fixed an issue where parts of the new discount formula builder were displayed incorrectly for percentage discounts. The correct formula view is now shown consistently.
## Added
This release brings several new endpoints for managing metadata schemas.
### Metadata schema API
You can manage custom metadata schemas directly through the public v1 API using standard project-level permissions and API keys. We've added four new endpoints for managing metadata schemas:
* GET `/v1/metadata-schemas/{metadataSchemaId}`
* POST `/v1/metadata-schemas/{metadataSchemaId}`
* PUT `/v1/metadata-schemas/{metadataSchemaId}`
* DELETE `/v1/metadata-schemas/{metadataSchemaId}`
The endpoints work similarly to the Management API endpoints for managing metadata schemas.
## Improved
This release brings updates to the following endpoints.
### Create campaign: Generic (standalone) support
Generic (standalone) campaigns can now be created through the API ([POST Create campaign](/api-reference/campaigns/create-campaign)). This provides the same functionality previously available only through the Dashboard. The update ensures a consistent experience for managing campaigns across all integration methods.
Pass `"type": "STANDALONE"` and provide `voucher.code` field to create a generic campaign.
### List segments
The pagination query parameters were updated for the [GET List segments](/api-reference/segments/list-segments) endpoint to use `start_date` and `end_date` for easier navigation through data results.
## Added
### Reward redemption webhooks
You can now use webhooks with reward redemption distributions. The webhook sends information about the redeemed reward and customer to external systems automatically.
Learn more about the [`EVENTS.CUSTOMER.REWARD_REDEMPTIONS.COMPLETED`](https://docs.voucherify.io/api-reference/customer/reward-redemptions-completed) event.
### Referral code drawers
Referral codes now open in drawers. This lets you view details and manage resources without leaving the current page.
### Approval workflows for campaigns and validation rules
Approval Requests now support workflows for multiple related entities.
When you update Validation Rules in the campaign editor, Voucherify now creates an Approval Request automatically. This makes sure both the campaign settings and related validation rules are reviewed before publishing.
## Improved
### Clearer stacking rule settings
The stacking rules wizard now includes more detailed descriptions for:
* application rules,
* sorting rules,
* global limits.
The category list now also shows pills for:
* **No Effect Rules**,
* **Discount Calculations**.
These changes make important settings easier to find.
### Better promotion tier management
You can now transfer promotion tiers directly from the promotion tiers list view.
Voucherify also now shows a confirmation modal before deleting a promotion tier in campaign edit mode. This helps prevent accidental deletions.
## Fixed
### Referral distribution triggers
Fixed an issue where referral distributions using the `reward.redeemed` trigger did not run correctly when configured manually.
### Processing time display
Fixed an issue where background tasks showed processing times with an extra hour added.
### Viewer role permissions
Fixed an issue where users with viewer permissions could still see options for creating orders and managing rewards.
### Deleted products
Fixed an issue where deleted products were still available in the product list and through direct URLs.
## Hotfix
### Editing vouchers in referral and loyalty campaigns
Fixed an issue where the application froze when editing vouchers in referral or loyalty campaigns.
## Improved
### Smarter time selection
The time picker now uses **00:00** as the default start time and **23:59** as the default end time. Consistent 30-minute intervals were also added to make campaign scheduling faster and easier.
### Better stacking rules filtering
Promotion tiers, campaigns, and categories can now be found more easily in the Stacking Rules view thanks to new filtering options.
### More stable Mailchimp integration
Metadata handling in the Mailchimp integration has been improved so customer source information is kept correctly.
### Faster access to documentation
A direct link to the stacking rules documentation has been added to the interface, making it easier to find help when needed.
### New resource drawers
Referral Campaigns and Gift Vouchers now open in drawers, allowing details to be viewed without leaving the current page.
## Fixed
### Validation rule editing
Fixed an issue where multiple values in customer metadata array validation rules could not be saved or edited.
### Clearer validation logic
When adding multiple conditions to one validation rule, the interface now clearly shows whether all conditions (**AND**) or at least one condition (**OR**) must be met.
### Stacking rules permissions
Fixed an issue where users with read-only access could still attempt to move campaigns using drag and drop.
## Scheduled maintenance for shared regions (EU1, US1, AS1)
Planned maintenance will be performed on shared regions (EU1, US1, AS1) to improve system stability and reliability.
* **AS1:** May 5, 18:00–19:30 CEST
* **US1:** May 7, 08:00–09:30 CEST
* **EU1:** May 11, 06:00–07:30 CEST
A brief downtime (\~5–10 minutes) will occur during each window. Requests made during this time may return **500 errors**.
Status pages:
* AS1: [Status page](https://status.voucherify.io/incidents/tj3bj36zp12z)
* US1: [Status page](https://status.voucherify.io/incidents/vwq5013p6p3v)
* EU1: [Status page](https://status.voucherify.io/incidents/6yqhnr349f20)
## Improved
### System security and permissions
Updated system security and permission protocols to ensure consistent access control across all user roles, with no impact on the user experience.
## Hotfix
### GET v1/customers
Fixed an issue when the [GET List customers](/api-reference/customers/list-customers) with a `segment_id` query parameter didn't return customers for a passive segment. These segments now correctly display all customers when requested through the API.
## Hotfix
### Mailchimp
Fixed an issue where updating the audience in the Mailchimp configuration would unexpectedly disconnect the integration.
## Added
### Campaign management
You can now transfer campaigns between projects within the same region. This action is available directly from the Campaign details view, making it faster to reuse campaigns across projects.
### Braze
You can now connect to additional Braze region endpoints: **KR-01**, **JP-01**, and **ID-01**.
## Improved
### Braze
You now have more control over data sent to Braze. You can decide whether **barcode** and **QR code** information should be included in the Braze customer profile. Existing integrations continue to work without any changes.
### Areas and Stores picker
Selecting Areas and Stores is now faster. You can **select all or deselect all** with a single click.
### Dropdowns
You can now click anywhere within a dropdown option to select it, improving responsiveness and reducing misclicks.
### Data viewer
Publication details, product/SKU attributes, and earning rules metadata now open in a **larger side drawer**, making it easier to explore and review detailed data.
## Fixed
### Referral campaigns in distribution
Referral campaigns now display correctly when creating a distribution with the **"reward redeemed"** trigger.
## Added
This release brings a new discount effect.
You can now select a collection as the source of free items in discounts covering **Rewards** and **Buy X, Get Y free** types. The new **Add same items as ordered** discount effect allows you running campaigns with "add free items" effect across large product collections. Voucherify adds the collection products that are in the customer's cart.
In the API, this effect is called `ADD_SAME_ITEMS` and it's found in `redeemables.result.discount.effect` field for [validation](/api-reference/validations/validate-stackable-discounts#response-redeemables-items-one-of-0-result-one-of-0-discount-one-of-1-effect) and [redemption](/api-reference/redemptions/redeem-stackable-discounts#response-redemptions-items-voucher-discount-one-of-1-effect) endpoints.
## Added
### Product collections (CSV import)
You can now import a CSV file to create product collections, making it easier to handle large catalogs and set up product discounts at scale. You can also assign static metadata to all imported products.
### Vouchers
Introduced a new drawer-based experience for discount voucher details, improving consistency across the dashboard.
## Improved
### Products & Bundles / Validation Rules
Improved feedback when deleting an SKU. The UI now clearly indicates if the SKU is linked to a validation rule or bundle and cannot be removed.
### UI
Added subtle borders to card components for better visual clarity.
## Fixed
### Campaigns
Fixed pagination in advanced filtering when browsing categories in the campaign wizard.
### Promotion tiers
Restored the missing **Validation rules** section in the Rules tab.
### Vouchers
Fixed an issue where standalone vouchers created via API could cause infinite loading in the dashboard.
### Permissions & navigation
Fixed sidebar layout issues for custom roles with limited permissions.
### Loyalty
Fixed an issue where loyalty tiers in advanced filtering required a reload to appear.
### Date/time filters
Fixed an issue where filtering customers or products by date-type metadata (using days in the future or past) returned incorrect results due to a default date value. Filters now return correct results based on the selected time range.
## Fixed
This release brings several fixes to Voucherify:
* **Products**: Fixed an issue when a deleted SKU item was still visible in the product list.
* **Promotions**: Fixed an issue which allowed deleting a promotion tier when it was used in a distribution. Now, a promotion tier can't be deleted and it has to be removed from a distribution first.
* **Referral campaigns**: Fixed an issue which caused the referral flow to occur when a custom event was triggered in an inactive referral campaign.
## Hotfix
### Roles and permissions
Fixed the issue where users with a custom **USER** role could access **Team Settings** and **Project Settings** without the required permissions, which could result in unauthorized changes.
## Removed
The following features were removed from Voucherify.
### Customer cockpits
Customer cockpits were removed. URLs to customer cockpits will redirect to dashboard Preference center, where customers can manage their email preferences. The updated URL is also returned by the [GET Customer endpoint](/api-reference/customers/get-customer).
### Landing pages
Landing pages were removed. URLs to past landing pages will return a `404 Not found` page.
## Hotfix
### Redemptions
Fixed an issue where rolling back a redemption without an assigned customer via the UI failed.
## Hotfix
### Approval requests
Fixed an issue where pagination did not work correctly in the **Approval requests** table. You can now navigate between pages and change the number of rows displayed per page.
## Added
### Improved stacking rules and categories management
Configuring how incentives interact with each other is now **simpler and more transparent**.
Previously, **categories and stacking rules were managed in separate views**. Users first created categories and then configured their stacking behavior later in the **Stacking Rules** view. This separation made the setup process less intuitive and required switching between different parts of the dashboard.
**What changed**
* Categories and stacking rules are now configured in a single view
* Stacking eligibility and discount calculation mode can be defined during category creation
* Terminology has been updated to better reflect stacking behavior
* New permissions for viewing and modifying stacking rules
* Updated default permissions for Admin, User, and Viewer roles
With this update, category creation and stacking configuration are **unified into a single workflow**, allowing stacking behavior to be configured directly when creating or editing a category.
The **behavior of stacking rules and categories has not changed**.\
Existing configurations will continue to work as before, and **no updates to project configuration are required**.
**New permissions for Stacking Rules**
To support the updated workflow, we introduced two new permissions:
* **Read Stacking Rules** – allows users to access the Stacking Rules page and view stacking configuration.
* **Modify Stacking Rules** – allows users to edit stacking settings and assign stacking parameters to categories.
**Default role permissions**
| Role | Permissions |
| ---------- | --------------------------------------------------------------------- |
| **Admin** | Full access |
| **User** | Read stacking rules, read categories, create/modify/delete categories |
| **Viewer** | Read categories, read stacking rules |
**Learn more**
* [Manage categories](https://docs.voucherify.io/orchestrate/manage-categories)
* [Stacking rules](https://docs.voucherify.io/orchestrate/stacking-rules)
* [Using stacking rules and categories](https://docs.voucherify.io/orchestrate/using-stacking-rules-and-categories)
### Payload designer autocomplete
The **Payload Designer** now provides inline autocomplete suggestions for available variables.
When typing in the editor, relevant variables appear as semi-transparent suggestions. Press **Tab** to insert the suggestion instantly and continue writing.
This makes it easier to discover available variables and build payloads **faster and with fewer errors**.
### Redemptions in drawers
The **Redemptions** section now opens in **drawers**, improving navigation and making redemption details easier to explore without leaving the current view.
The drawer includes dedicated tabs for:
* **Transactions**
* **Metadata**
* **Dashboard**
This layout helps you quickly access redemption details while keeping the main interface visible.
### Bundle scaling option
A new option, **Bundle scaling**, lets you control how discounts apply when multiple eligible bundles appear in the cart.
You can now choose whether the discount:
* applies **once per order**, or
* **scales automatically** based on the number of qualifying bundles.
This provides greater flexibility when configuring bundle promotions and allows discounts to scale automatically without requiring custom formulas.
This release brings new validation rules, locale settings for dates, and several improvements and fixes.
## Added
### New validation rules
You can now use the following validation rules:
* **Total amount after discounts**: The rule allows to block validation and redemption when the total amount is discounted beyond the defined value. For example, you can prevent orders from being discounted to \$0. To differentiate the validation rules, the\*\* Total amount\*\* rule is renamed to **Total amount before discounts**.
* **Total number of redemptions per week**: Define the weekly limit of redemptions allowed in the entire campaign for all customers (the sum of all redemptions made with unique codes from the campaign).
* **Redemptions per incentive per week**: Define the weekly limit of redemptions for a given incentive.
* **Redemptions per customer per incentive per week**: Define the weekly limit of redemptions that a particular customer can make using a given incentive.
* **Redemptions per customer in a campaign per week**: Define the weekly limit of redemptions that a particular customer can make using codes from a particular campaign.
### Project settings: Add locale
You can now add locale settings for the project. The locale determines date and time formats and the starting day of the week (Monday, Saturday, or Sunday). The starting day of the week affects the new "per week" validation rules added in this release.
## Improved
### Distributions: Customer entered segment trigger
The distributions using the **Customer entered segment** trigger can now send the message to customers who have already joined the segment once the distribution is saved. The distribution then sends messages to each customer who joins the segment.
### Errors in validations and redemptions
Validations and redemptions requests will now return unified `redeemable_type` and `redeemable_id` fields for errors during validation or redemption. The change makes it easier to find an invalid redeemable in the API response.
### Audit log
The performance of API logs in the Audit log is now improved. The results load now faster.
### Categories API
The `DELETE /v1/categories/{id}` endpoint now blocks category deletion if it's used in Stacking rules. However, you can force the deletion together with entry to Stacking Rules by passing a new query parameter `remove_from_stacking_rules`; for example: DELETE `/v1/categories/{id}?remove_from_stacking_rules=true`.
## Fixed
* **Stacking rules and categories**: Fixed a bug that displayed a category ID in stacking rules when the category was deleted.
* **Audit log**: In custom webhook distributions, fixed a bug which incorrectly displayed a generic webhook payload instead of showing the actual payload.
* **PUT Update customer segment**: Fixed a bug which allowed entering any value to the `junction` field.
## Added
### Custom headers for webhooks in Project settings
You can now configure custom headers for webhooks in **Project settings**. This is consistent with the options available for webhooks available in **Distributions**.
### Drawer interface in promotions
Access and manage settings of Promotions with a new drawer interface.
### 12-month dashboard view
Review and analyze data from the past year by selecting the last 12 months as a time period in the new Dashboard.
## Improved
### Validation rules editing in the Rules tab
Selecting a new validation rule in an incentive’s **Rules** tab updates the display instantly. Before, the configuration had to be saved to see validation rule configuration.
### Loyalty tier selection clarity
When you select a loyalty tier in validation rules or distributions, you can now see the campaign each loyalty tier belongs to. This way you can easily distinguish between tiers with the same name in different campaigns.
## Fixed
* Clickable customer links in validations: When validating discounts, if a customer with a specific source ID exists, the validation list now displays a clickable resource link instead of plain text.
* Redemption limit message: Fixed an issue where a message incorrectly appeared stating that the redemption limit was reached for vouchers from campaigns with unlimited redemptions.
* Earning rules and used count: When disabling an earning rule, the **Used count** will now remain unchanged as expected.
* Campaign filtering: Filtering for vouchers, redemptions, and publications in campaign details now uses unique IDs instead of names, resolving crashes caused by special characters like `%` and improving performance.
As part of migrating [the Help Center](https://support.voucherify.io/ "Voucherify Help center – support documentation"), we've published a new section called [Optimize](/optimize/optimize-overview).
There, you can find details about:
* [Validations and redemptions](/optimize/validations-and-redemptions)
* [Creating validation rules](/optimize/create-validation-rules)
* [Validation rule reference](/optimize/validation-rules-reference)
* [Time limits](/optimize/time-limits)
* [Creating rewards](/optimize/create-rewards)
Additionally, we've added a new article about [Loyalty card import](/build/loyalty-card-import) to the [Build section](/build/campaign-overview).
## Added
### Gift campaign drawers
You can now open gift campaigns in a drawer view.
This makes it faster to view campaign details without leaving your current page.
### Payload designer – phone support
The payload designer now always includes the `phone` variable for both customer and holder objects.
This helps you personalize your payloads more easily.
## Improved
### Validations table – show more and show less
The validations table now includes a **show more/show less** button.
You can expand or collapse the incentive list to keep the view clean.
### API keys – improved security
Secret keys are now hidden after the first time they are generated.
Only the last four digits remain visible for verification.
This change applies to production projects.
Sandbox behavior is unchanged.
## Improved
### GET Campaign template
The [GET Campaign template](/api-reference/templates/get-campaign-template) endpoint has now a query parameter `expand=json_template`. The query parameter returns a `json_template` object that lists details about the campaign template, like `campaign`, `validation_rule`, or `campaign_type` fields.
The update to the documentation is in progress.
## Added
### Vouchers dashboard tab
The vouchers dashboard tab has a refreshed and unified design across all campaign types.
This provides a clearer and more consistent experience.
## Improved
### Integrations
Integration credentials are now hidden after saving.
This improves security and prevents secrets from being shown in the UI.
## Fixed
### Team settings
Fixed an issue that caused the API call limit to not update automatically when switching projects.
### Areas and stores
Fixed an issue where areas and stores assignments were not visible in project settings until the page was refreshed.
### Dashboard redemption
Fixed an issue which prevented vouchers from being redeemed after reloading the page during the redemption flow.
### Filters
* Fixed an issue that caused metadata filters with a value of `0` to display empty filter chips and apply incorrect filtering.
* Fixed an issue where value inputs were missing for **Includes** and **Overlaps** conditions when filtering by array date or datetime metadata.
* Fixed an issue which caused advanced filtering in distributions to show only active segments.
Passive segments are now also displayed.
## Hotfix
### Campaign drawers
Fixed an issue with business rule assignment in campaign drawers.
## Added
### Drawers for orders, customers, products, and discount campaigns
Orders, Customers, Products, and Discount Campaigns can now open in a drawer view.
This lets you view and edit details without leaving your current page.
### Product collection activity tab
Product collections now include an Activity tab.
The tab shows a history of changes made to each collection.
### Payload designer
The Payload Designer now supports mapping individual array elements.
You can select specific items using a picker, including quick options for the first item, second item, or a custom index.
### Campaign templates
Creating campaigns and tiers from templates now uses a wizard-based flow.
You can select existing resources such as product collections and segments during setup.
## Improved
### Order status update
You can now update the order status directly from the order header.
This makes quick status changes easier.
### Customer custom event wizard
The flow for creating customer custom events has been redesigned as a step-by-step wizard.
This improves clarity and usability.
### Filtering earning rules
You can now search for Earning Rules by name in Campaign edit mode.
Search is case-insensitive.
### Product collection edit
You can now edit both static and dynamic product collections directly from the Product Collection view and the Campaign wizard.
### Campaign template preview
When creating a campaign from a template, you can now preview discount details and selected resources before creating the campaign.
### Unified voucher headers
Discount Vouchers, Loyalty Cards, Referral Codes, and Gift Cards now use unified headers.
This improves consistency and clarity across views.
### Resource links
Resource links now support standard browser behavior.
You can open links in a new tab using Cmd-click (macOS) or Ctrl-click (Windows/Linux).
## Fixed
### Validation rules
Fixed an issue which allowed creating validation rules with unknown metadata properties.
### Discount campaign publish button
Fixed an issue that caused the Publish button to be out of sync with the campaign status.
The button now updates correctly without requiring a page reload.
### Formula builder
Fixed an issue which caused long parameter names in Dynamic Discounts to be hard to read.
Names are now truncated with an ellipsis and shown in full using a tooltip.
### Resource links
Fixed an issue where resource links could get stuck in an infinite loading state after a page refresh.
### Filters
Fixed an issue which caused filter controls to overflow when multiple conditions were added.
All controls now remain visible and accessible.
### Validation rules input
Fixed an issue which caused the Validation Rules input to become disabled after clearing a selected rule while editing a discount campaign.
The input now stays active and allows selecting or creating a new rule.
## Fixed
### Voucher publication performance
Fixed an issue that caused very slow voucher publication for large campaigns where all vouchers were already published.
The system now skips unnecessary checks and creates a new voucher immediately, which significantly improves performance for large campaigns.
### Loyalty points rounding
Fixed an issue that mainly affected loyalty programs using formulas to calculate points.
When a formula returned a decimal value, points were not added because only whole numbers were supported.
Points are now automatically rounded to the nearest whole number before being added to the customer’s loyalty card.
### Loyalty campaigns
Fixed an issue where Validation Rules could not be added when creating or editing Earning Rules in Loyalty campaigns.
## Added
### Exported audit log browser
You can now browse exported API audit logs directly in the app.
The new browser lets you search, filter, and view log details for ready exports created within the last 90 days. This makes reviewing API activity easier.
## Improved
### Voucher filtering
The filter previously named Voucher quantity is now called Redemptions quantity.
This name better reflects what the filter does when searching vouchers.
### Consistent tab names
Tab names across campaigns, vouchers, and customer views are now more consistent.
For example, Validation Rule is now Rules, and Redemption History is now Redemptions.
### Unified validation rules tab
The Rules tab now looks and works the same for Discount coupons, Gift cards, and Referral codes.
This makes validation rules easier to understand and manage.
### Payload Designer
The Payload Designer now supports mapping individual Voucherify metadata fields into the payload.
This allows more flexible payload configuration.
## Fixed
### Campaign templates and segments
Fixed an issue which caused campaigns created from templates to reuse an edited dynamic segment instead of creating a new segment based on the template.
### Approval requests for promotion tiers
Fixed an issue that prevented approval requests from being triggered when users with limited permissions edited promotion tiers.
### Braze channel in distributions
Fixed an issue which caused the Braze distribution channel to be missing for some triggers.
The channel is now available for Reward redeemed, Loyalty points adjusted, and Customer rewarded loyalty points.
## Added
### Drawers for rewards
Rewards now support drawers for a smoother navigation experience. When a reward is opened via an in-app resource link, it will open in a drawer, while opening the link in a new tab displays a dedicated reward page. This ensures consistent behavior with existing resource links and event handling.
## Improved
### Drawer headers
Drawer headers now display pills in a unified and consistent order across all resources. This standardization improves visual consistency and makes key information easier to scan and predict.
## Fixed
### Filters
Fixed a server error (500) that occurred when filtering resources by metadata with large IN conditions (more than 21 values).
### Areas and stores
Fixed an issue where cloned campaigns lost Area and Store assignments after an approval request was approved.
## Added
### Product collections – API
This release brings two new functionalities to the product collection API.
You can now use the PUT `v1/product-collections/{productCollectionId}` endpoint to:
* Update the name of a static or auto-update product collection.
* Update the filters of an auto-update product collection.
This way you can change the products covered by an auto-update collection, so you don’t have to add a new collection and edit your campaigns when you need to quickly tweak which products your promotion activities target.
Additionally, you can now use the GET `v1/product-collections/{productCollectionId}/activities` endpoint to check when the product collection was created and its name or filters updated.
## Improved
* **GET `v1/products/{productId}` endpoint**: Added a query parameter `hide=sku` to return only the product data without its SKUs.
* **GET `v1/segments/{segmentId}/activities` endpoint**: Added `has_more` and `starting_after_id` fields for pagination.
* **Preference center**: Customer email preferences can now be managed from the customer’s profile by clicking the cog button in the top right corner of the screen.
Welcome to your latest Voucherify update! Here's what's new, improved, and fixed!
## Added
### Customer segments: activity tab
**Customer Segment** pages now include a new **Activity** tab that provides a clear view of segment events. This log lists segment creation, activation, and update, helping teams better understand how segments change over time.
### Audit log: New drawer views for background tasks and exports
You can now preview **Background tasks** and **Exports** details in a drawer, so you can access information directly from the list view and you don't have to leave your current context.
### Vouchers list: Campaign is Unknown filter
The **Vouchers** list now supports filtering vouchers with or without a campaign assignment.
## Improved
### Drawers: Consistent design
The design and behavior of resource drawers (logs, metadata schemas, distributions, and so on) have been improved for better consistency and usability.
### Vouchers: Validation history
The **Validation history** view in voucher details has been updated. Vouchers are now automatically scoped to the current incentive via a pre-set, non-removable filter, so you only see relevant results. You can also filter by status and creation date.
### Approval requests: Multiple edits
Improved the approval requests list to make it easier to review and manage approvals for related resources.
## Fixed
* **Approval requests: Multiple edits**: Fixed an issue where approval requests could not be approved if multiple edits targeted the same object.
* **Earning rules: Long names**: Fixed an issue where long earning rule names overlapped the action menu, making edit and delete actions inaccessible.
* **Distributions: Infinite loader**: Fixed an issue where an infinite loading icon was displayed in the Distribution drawer after changing the distribution status.
* **Loyalty campaigns: Earning rule Mapping**: Fixed an issue where earning rule mappings were unintentionally removed during loyalty campaign edits.
## Hotfix
### Payload Designer
Resolved an issue where webhook payloads did not include certain custom event data. Webhooks now correctly deliver all configured custom payload fields.
## v1/loyalties API
The documentation for endpoint POST `v1/loyalties/{campaignId}/qualifications` [has just been added](/api-reference/loyalties/estimate-loyalty-points).
Use this endpoint to calculate an estimate number of points that a customer will receive for their order. The points are calculated for earning rules based on the order paid rule.
## Improved
### Loyalty program experience
Labels and info panels in Loyalty Campaigns now explain points expiration rules more clearly. This helps you understand how expiration works and what options are available.
### Discount campaign dashboard
The Dashboard tab in Discount Campaigns has a cleaner and more focused design.
### Discount campaign header
The Discount Campaign header has been updated for a clearer and more streamlined management experience.
### Product selection in discounts
When using Add Items, the first empty field in the Bundled Items or Discounted Items list is now filled automatically. New items are no longer added to the next position when an empty field is available.
## Fixed
### Discount campaign analytics
Fixed an issue which caused the "Total orders value" and "Discounted amount" to be missing from the Orders analytics chart for Discount Campaigns. These values now display correctly.
### Discount value fallback
Fixed an issue which caused the Discount value fallback to be hidden in campaign details for discount types created with the formula builder. The fallback value is now always visible.
### Formula tooltip consistency
Fixed an issue that caused the fallback tooltip in Discount Campaigns to show raw API values. The tooltip now displays the same formatted value shown on the dashboard.
### Activity log button
Fixed an issue that made the Log button unavailable for events in the Activity tab. The Log button is now enabled for all events with an associated log.
### Passive segments in referral campaigns
Fixed an issue which caused customer segments triggered by tiers in Referral Campaigns to be created incorrectly when using the approval flow. Segments now appear with the correct name and filter.
## Fixed
* **Qualifications**: Fixed an issue that failed to return redeemables in campaigns with a validity time frame set with interval and duration when daylight saving time changes.
## Added
This version brings several new features to Voucherify.
### Activity tab – advanced filtering & navigation
The Activity tab now has a new table view with advanced filters. You can filter by event name, category, date, and context-specific options (such as campaign or campaign type in Customers). This makes it easier to find specific changes without scrolling through long lists.
### Validation rules in drawers
Validation rules now open in drawers. This lets you view rule details without leaving your current page.
### Voucher import CSV
You can now map two new fields in CSV imports: start\_date and expiration\_date. These fields are supported when importing vouchers into campaigns and when creating standalone vouchers.
## Improved
### Discount campaign analytics tab
The Analytics tab in Discount Campaigns has a cleaner layout. You can choose how many charts to show per row (1–3), making it easier to view and compare results. All existing analytics features remain available.
### Discount wizard – step summaries
The discount wizard now shows key discount details under each step title. This includes discount type, value, effect, and related product, SKU, or collection links with “Show more” support. Validation rule names are shown as plain values, and steps without a rule are clearly marked.
## Fixed
### Metadata dictionary validation
Fixed an issue where users could continue even when a metadata dictionary value was invalid or removed. You must now fix all metadata errors before proceeding, including in cross-project approval scenarios.
### Approvals – duplicate error toasts
Fixed an issue that caused two error toasts to appear when an approval failed. Only one clear error message is now shown, giving you enough time to read and understand it.
### Product search
Fixed an issue that made product search case-sensitive and unclear. Search is now case-insensitive and begins after you type 3 characters. The “No items found” message only appears after 3 characters. Products with very short names can still be found with advanced filters.
## Added
This version brings several new features to Voucherify.
### Webhooks
You can now monitor changes to your customer profiles with the new webhook covering the `customer.updated` event. You can find this webhook in Project settings. This webhook is not triggered by bulk customer updates, like import customers with a CSV file, update customers in bulk, or update customers' metadata in bulk.
### Customer segments
This version brings a couple of new features to customer segments.
We've added a new API endpoint GET v1/segments to list your segments. You can use the following query parameters:
* `limit` with a maximum value of 100
* `order` with `created_at` (ascending) and `-created_at` (descending) values
* `filters` with `id`, `type`, `name`, `created_at` values
* `starting_after` with an ISO 8601 timestamp value
* `ids` with an ID as a string or an array of ID strings
Additionally, there's another new API endpoint for monitoring activities in the segment, GET `v1/segments/{id}/activities`. You can list the following events related to that segment:
* created
* updated
* activated
* filters\_updated
You can use the following query parameters:
* `limit` with a maximum value of 100
* `order` with `created_at` (ascending) and `-created_at` (descending) values
* `starting_after` with an ISO 8601 timestamp value
* `starting_after_id` with an activity ID; it returns activities created after this activity.
* `start_date` with an ISO 8601 timestamp value
* `end_date` with an ISO 8601 timestamp value
* `type` with an event type name
* `category` with an event category
## Fixed
* **Campaigns**: Fixed an issue that failed to set an unlimited redemption limit for vouchers when setting default\_voucher\_redemption.quantity to null while updating a campaign.
* **Redemptions**: Fixed an issue that prevented rolling back a parent redemption which had a successful and a failed redemption.
## Added
* **Payload Designer – Context-Based Examples**: The Payload Designer now shows example payloads that change automatically based on the selected trigger. Only variables relevant to the trigger type are displayed, making it easier to build and test payloads.
* **Payload Designer – Raw Payload Support**: You can now send raw webhook payloads. A new checkbox lets you switch between sending the full webhook payload or only the raw payload from the designer.
* **Payload Designer – Payload Preview**: A new preview panel shows example payload data. You can toggle the preview on or off for both default and custom payloads.
## Fixed
* **Lists**: Fixed an issue where several list views (such as Promotion Tiers and Promotion Stacks) did not refresh correctly after create, edit, or delete actions. Record counts, search results, and pagination now update correctly.
* **Events**: Fixed a bug where the *Performed By* and *Channel* fields were missing in event details when logs were unavailable. These fields are now always displayed.
## Added
* **Export Logs**: You can now export filtered API audit logs to CSV directly from the UI. All filters are supported.
* **Advanced filters for logs**: You can now filter logs by text in the request body and response body during export. Use one or both filters. Available on request for Enterprise customers.
## Improved
* **Segments**: The “Filtered Segment” name is now changed back to “Dynamic Segment” to match our standard terms.
## Fixed
* **Earning Rules**: Fixed an issue that blocked editing the time frame after setting an expiration date. You can now update all date fields correctly.
## Improved
* **SAML**: For clients with enabled SAML login, the password setup process while creating a new account is now completely disabled as this step is redundant.
## Improved
* **Show more**: The **Show more** component is now consistent across the app. You'll notice a unified click-to-open experience. It has also been introduced for Areas and Stores assignments, with a display limit and the remaining items accessible with the **Show more** button.
* **Payload designer**: Improved the Payload designer to correctly retain variables with `null` values when saving and reopening custom payloads.
## Fixed
* **Metadata**: Fixed an issue where dates in “array of dates” metadata fields were displayed incorrectly in pills when the project timezone differed from your local timezone. Dates now reflect the values you select, regardless of the timezone.
* **Time frame**:
* Fixed an issue where the **Starts in X days** label for promotion tiers differed from the campaign label when daylight saving time or timezone offsets were applied. The display is now consistent.
* Campaign start and expiration dates now consistently match your input, even during daylight saving time transitions.
* **Payload designer**: Payload designer now correctly saves empty arrays `[]` and empty objects `{}` in custom payloads.
## Removed
* **Segments**: Removed the initial\_sync\_status property from responses in POST v1/segments and GET v1/segments/ endpoints.
## Added
### Passive segments
This change helps you manage customer segments more efficiently. It reduces noise from frequent profile updates and gives you better control over when segment events should be tracked.
Segments created from filters are now Passive by default.
* Passive segments do not trigger join or leave events in a customer profile.
* Active segments still trigger these events.
* If a Passive segment is used in Earning Rules, Distributions, or Referral Tiers, it becomes active automatically.
* Existing Active segments are not affected.
### Read-only segments tab
A new Segments tab in the Customer Profile shows all segments a customer belongs to. This tab is read-only and includes search, pagination, and sorting.
### Edit passive segments
You can now edit conditions for Passive segments directly in the app. Once a segment becomes Active, it can no longer be edited.
### Drawers
Drawers now support a URL parameter to keep the opened item state after refresh or when sharing a link.
## Fixed
### Drawers
Fixed an issue where breadcrumb navigation didn’t close drawers for Metadata and Audit Logs. Clicking the breadcrumb now closes the drawer correctly.
### Metadata
Fixed an issue where a duplicate warning appeared for required metadata fields with predefined dictionary values.
## Improved
### Filters
You can now filter resources by an exact date in date-type fields, making it easier to find what you need.
## Fixed
### Discounts
Fixed an issue where editing discounts with dynamic collections triggered extra validation.
### Demo Shop
Fixed an issue where Free Item Discount campaigns with the “always add new items” setting didn’t show the free item correctly in the cart. The free unit now appears as a separate line, matching the API response.
### Orders
Fixed an issue where products selected by source ID didn’t display correctly as resource links when creating an order.
### Rewards
Fixed an issue where the Related Object column in the Rewards table showed wrong information for rewards assigned to referral tiers.
### Loyalties
Fixed an issue where the Adjust points button was active for unpublished loyalty cards. It’s now disabled to prevent errors when adding points to cards without a holder.
### Redemptions
Fixed an issue where the pagination counter in order details counted units instead of order line items.
### Earning rules
Fixed an issue where the points expiration label was unclear. It now says “Use campaign expiration rules” to better describe how it works.
## Added
### Metadata
The updated metadata editor — once only in Customers and Rewards — is now available everywhere. You can now edit metadata consistently in campaigns, customers, products, orders, redemptions, and more.
## Fixed
### Approval requests & metadata
Improved error handling when metadata changes from a single value to an array. The system now validates schema changes correctly, approval requests no longer fail, and error messages are clearer.
## Improved
### Table usability
Tables now support horizontal scrolling. Key columns such as ID/Name, Status, and Actions stay fixed while you scroll, making it easier to view and compare data across wide tables.
### Product & SKU display
The Product and SKU columns are now combined into one Name column for better clarity. If the item is an SKU, both the Product Name and SKU Name appear together.
## Added
### Audit log
This version brings new filters and functionalities to Logs. Thanks to these changes, you can quickly find relevant logs for analytics or troubleshooting.
#### New filters
Users with the **Read events and technical logs** permission can now find data quicker in the Audit logs thanks to the new filters:
* **Endpoint** – Lists all logs for a specific endpoint, e.g. `POST_v1_vouchers_import_csv`.
* **User** – Lists all logs for actions performed by a given organization user. Requires **Access to Project's Users list** permission.
* **Server-side API key** – Lists all logs performed with a given server-side API key. The filter uses the key name, so the key itself is protected. Requires **Access Project Settings** permission.
* **Client-side API key** – Lists all logs performed with a given client-side API key. The filter uses the key name, so the key itself is protected. Requires **Access Project Settings** permission.
#### Export API logs – API endpoint
You can now export API logs in a CSV file using the `POST /v1/exports` (Create exports) endpoint.\
Pass `"exported_object": "api_log"` in the request body.
You can use the following parameters:
* **fields:** `"id"`, `"created_at"`, `"status"`, `"request_id"`, `"channel"`, `"method"`, `"endpoint"`, `"url"`, `"user_email"`, `"app_id"`, `"client_app_id"`, `"request_duration"`, `"request_body"`, `"response_body"`.
* `filters`: `created_at` (with `$before` and `$after` conditions), `status` (with `$is` and `$is_not` conditions), `channel` (with `$in`, `$not_in` conditions), `app_id` and `client_app_id` (both with `$in`, `$not_in`, `$is`, and `$is_not` conditions).
* **order:** `created_at` (ascending order), `-created_at` (descending order).
## Improved
### Audit logs
* Logs for imports now include a downloadable file that was used in the import.
* Audit log now shows the async action ID, if applicable.
* Async action details now return the corresponding audit log ID.
* The **Channel** filter now only shows channels that were used and lists used SDKs as a channel source.
## Fixed
* Campaign builder: Fixed an issue which prevented changing the redemption limit when editing a campaign.
* Async actions: `GET v1/async-actions/{id}` endpoint now returns the `user` and `log_id`.
* Product CSV import: Fixed an issue which caused incorrect update of metadata for products in collections.
## Added
### Bundle multiplication
[Bundle Multiplication](/build/product-bundles) is now available for all users. It determines how many times a bundle can be applied within a single order, based on the number of complete sets of bundled items a customer adds to their cart.
With bundle multiplication, the system automatically checks how many full bundles exist in the order and applies the discount that many times.
#### What gets multiplied
* The **discount value** (for example, a \$10 bundle discount becomes \$20 if two complete bundles are found).
* **Free items** or **discounted quantities** linked to the bundle.
#### Example scenarios
* “Buy 2 T-shirts, get 1 hat free.” → The more T-shirts customers buy, the more hats they receive.
* “Buy a laptop and a mouse together for 10% off.” → Discount applies only to eligible products, up to the configured limit.
* “Get 20% off every second coffee mug (max 3 bundles per order).” → Maximum eligible bundles limit the number of discounted sets.
* “Buy 3 skincare products and pay only for 2.” → Item discount limit ensures only one item in each bundle is free.
* “Bundle any 4 books and get \$10 off the whole order (up to \$50 total).” → Discount multiplies with each bundle up to the set cap.
### Bundle multiplication
The **Discount Effect** can now be multiplied by the number of bundles in the cart.\
Each bundle increases either the **discount value** or the **discounted product limit**, depending on the configured Discount Effect, up to the maximum eligible bundles limit.
### Copy bundle button
Added an option to copy bundled items directly to discounted products with a single click.\
This feature works for all discount types except selected free product discounts.
### Discount tab
Updated the **Discount** tab with clearer sections for **Bundled Items**, **Discounted Products**, and **Excluded Products** in a simplified, read-only layout.\
A **collection badge** now indicates when a resource belongs to a product collection.
### Bundle discount setup
Redesigned the setup flow for **bundle discounts**, making the configuration process more intuitive and streamlined.
## Fixed
### Discount wizard validation
Fixed an issue where validation in the **Discount Wizard** did not persist across steps, which could allow saving incomplete or empty discounts.
## Removed
### Timeframe
Removed the **Timeframe** section above Campaign and Voucher details, as this information is already displayed in its own dedicated section.
## Added
### Areas and stores in the Management API
Added new endpoints for managing areas and area stores with the Management API. The endpoints allow you to:
* List areas in your project: `GET /management/v1/projects/{projectId}/areas`
* Get details about a specific area: `GET /management/v1/projects/{projectId}/areas/{id}`
* Create a new area: `POST /management/v1/projects/{projectId}/areas`
* Update an existing area: `PUT /management/v1/projects/{projectId}/areas/{id}`
* Delete an area: `DELETE /management/v1/projects/{projectId}/areas/{id}`
* List all area stores: `GET /management/v1/projects/{projectId}/areas/{areaId}/stores`
* Get a specific area store: `GET /management/v1/projects/{projectId}/areas/{areaId}/stores/{storeId}`
* Create a news area store: `POST /management/v1/projects/{projectId}/areas/{areaId}/stores`
* Update an existing area store: `PUT /management/v1/projects/{projectId}/areas/{areaId}/stores/{storeId}`
* Delete an existing area store: `DELETE /management/v1/projects/{projectId}/areas/{areaId}/stores/{storeId}`
## Improved
### Areas and stores
* Improved navigation when selecting areas, stores, and all stores.
* Improved permission checking for Areas & Stores features, ensuring proper access control.
* Added areas and stores filters to the campaign list.
## Fixed
### Areas and stores
* Fixed an issue which failed to copy areas and stores assignments when cloning a campaign.
* Fixed an issue which failed store assignments to display in area details view.
* Fixed an issue which allowed the users without required permissions to see areas and stores tabs.
* Fixed an issue which prevented users from creating promotion campaigns.
* Fixed an issue which allowed restricted users to add and publish vouchers for campaigns that the restricted users could only view.
## Improved
### Time picker
The time picker has been updated to use a drop-down menu instead of a clock.
The drop-down provides options every 30 minutes, and any valid time can also be entered manually.
Some time inputs in metadata definitions are not yet affected by this change and still use the legacy picker.
## Fixed
### Onboarding
Fixed the issue where the Demoshop onboarding flow stopped at step 5, so it now continues smoothly through all 8 steps.
### Metadata
* Fixed the issue where negative numbers could not be used in customer metadata and filters; negative values are now supported.
* Fixed the issue where metadata definitions were sorted by name length instead of alphabetically.
## Added
### Payload designer
We have introduced the **Payload Designer** for webhook integrations.
It lets you choose between sending the full webhook payload or designing your own JSON structure with static values, dynamic Voucherify keys, and nested objects.
It solves the main limitation of the previous approach by giving you greater control and clarity when shaping webhook data.
The mapping will be visible in the `data` object in the webhook.
## Improved
### Support widget update
We’ve refreshed the look of the support widget in the Dashboard and introduced a new support link.
While the appearance is slightly different, you can continue to reach out to our support team in the same way as before.
## Added
### Earning rules
Added a message that appears when customers reach the 100-rule limit. To add a new rule, you must first delete the existing one.
### Verification
Added `org_id` field to the general tab in the My profile section. Users can use it for verification when requesting sensitive data.
## Improved
### Validation rules
Updated the discount campaigns and referral campaigns by renaming the "Validation Rules" tab to "Discount" and aligning its UI with the promotion tier. The tab now displays bundles, included and excluded products, and all application rules.
### Delete resources
Updated the resource delete dialog with a clearer, simplified design. You can now choose between moving a resource to the bin or deleting it permanently using a streamlined layout.
## Fixed
### Vouchers
Fixed the issue where the loader kept spinning when manually adding a voucher to a campaign. The interface now shows a clear message and remains usable without errors.
## Added
### Loyalty
Estimate how many loyalty points your customers will receive with a new endpoint:
`POST /v1/loyalties/{campaignId}/qualifications`.
See the sample request and response:
```JSON Request theme={null}
{
"customer": {
"source_id": "customerSourceID",
"metadata": {
"reason": "loyaltyQualifications"
}
},
"order": {
"id": "ord_113628fa0685537f99",
"metadata": {
"source": "qualifyPoints"
}
}
}
```
```JSON Response 200 OK theme={null}
{
"campaign": {
"id": "camp_6hAtKbSF3iMj8wN8HjlvPuQG",
"name": "Loyalty-campaign",
"object": "campaign"
},
"points_estimation": 51
}
```
### Point estimation
This endpoint returns only an estimation, not a precise point value.
Also, this estimation works only for the Order paid earning rules. If a campaign includes tiers, mappings, and multiple earning rules, the calculation becomes more complex. During final calculation, a customer may change tiers and earn more or fewer points depending on other factors.
## Improved
### Voucher import
Added support for start\_date and expiration\_date when importing vouchers with CSV. You can add the respective columns to a CSV file to import vouchers with these parameters.
### Management API
Added limit and page query parameters to GET management/v1/projects//users endpoint. You can set a limit of a maximum of 100 results and paginate them.
## Fixed
### Product and SKU export
Fixed a bug which prevented a notification from being sent and displayed in the app when a product or SKU export was finished.
## Added
### Export
Export products & SKUs directly from the dashboard!
Grab all items or just your filtered view in seconds — no API needed. Files are ready in Exports in the Audit log for instant download. This makes sharing data or prepping lists for campaigns faster than ever, right from the dashboard.
### Earning rules
Added an option to search earning rules by name directly in the campaign dashboard. The search works across all earning rules, is not case sensitive, and shows only rules that match your text.
## Improved
### Validation rules
Renamed “Redemption by code holder” rule to “Redemption only by code holder” to more accurately describe its function.
### JSON viewer
Improved how objects are shown in the dashboard. Empty objects and confusing property counts are no longer displayed, making the view clearer and easier to read.
## Fixed
### Export
Fixed an issue where users without permission to export publication or redemption data could still see export buttons on the corresponding lists.
### Loyalty
Fixed an issue where users could not put 0 to ‘Months after earning activity rule’.
## Hotfix
### Webhooks
Fixed a bug which caused `VOUCHER.GIFT.TRANSACTION.CREATED` and `VOUCHER.LOYALTY_CARD.PENDING_POINTS.UPDATED` not to appear in Project settings and in the filters in Webhook send outs in the Audit log.
## Added
### Stacking rules
We’ve added a new limit for Stackable Discounts API: Limits per category. You can now set a limit (up to 10) of stacked incentives for individual categories.
For example, if you have a three categories, Bronze, Silver, Gold, you can set up a limit of 2 for Silver, and 1 for Gold, while Bronze is limited by the Maximum count of valid promotions per category to apply in a request. This means that a maximum of 2 incentives from the Silver category and 1 from the Gold category can be validated or redeemed in one stackable API request.
## Improved
### Segments
Changed the name of Dynamic segments to Active.
## Fixed
### Audit logs
Fixed an issue which caused incorrect filtering for the API value with the “not in” condition for Channel.
### Loyalty programs
Fixed an issue that caused the loyalty balance to reset after changing the time frame in the loyalty card.
## Improved
### Dynamic discount
Added support for order item quantity, price, and product metadata in the "Amount Discount: Apply the full discount to each item unit".
## Fixed
### Loyalty programs
Fixed an issue that triggered updates to all earning rules and loyalty tiers (even when no campaign changes were made) while updating a campaign.
### Bundle
Fixed an issue where creating a Bundle via API without specifying "type": "product\_or\_sku" caused the product not to be shown in the UI.
### Discount value
Fixed an issue that caused \[object Object] to be displayed as a discount value in orders.
### Log in page
Fixed an issue that caused users to log in automatically after selecting the Read more button in the carousel.
## Added
### New expiration type for campaigns and earning rules
We’ve added support for `FIXED_DAY_OF_YEAR` expiration type in Earning Rules. This new option gives you more control over loyalty point expiration, because you can set an exact month and day. This is a perfect option for seasonal promotions, loyalty program resets, or end-of-year expirations. For example, you can set an expiration date of 31 December for all loyalty points earned during the Black Friday sales.
Also, to improve clarity, expiration descriptions now display with short month names and a clearer date format.
### New drawer view for distribution details
Distribution details now open in a drawer view across the app, including when accessed through a direct URL address. The drawer includes complete distribution data, tabs, status controls, and a redesigned actions menu. Access is available to users with Read Distributions and Publications permissions.
## Improved
Improved the analytic tab to look consistent with other drawers across the app.
## Fixed
### Audit log
The filter label for Webhook send outs has been updated. The field previously shown as ID is now displayed as send out ID.
### Publications
Fixed an issue where users could view the publication history tab without proper permission.
### Stacking rules
Fixed an issue that caused stacking rules to be visible to users without the proper permission.
## Improved
### Rewritten the ResourceLink component to the new Angular version
We rewrote the ResourceLink component to the new Angular version, ensuring resource displays and tooltips are now consistent across the app.
We also made detail navigation work smoothly—opening in drawers or new tabs with our new drawer layouts.
## Fixed
### Approvals
* Fixed an issue where voucher details were missing in the approval request preview when multiple vouchers were selected.
* Fixed an issue which caused the campaign templates not to work correctly with approval requests.
### Custom events
Fixed custom event schema filters so they now update correctly when the condition changes.
### Distributions
Fixed an issue where changing the trigger for the distribution caused the campaign assignment to reset and allowed saving the distribution without a campaign assigned.
### Drawers
Fixed an issue that caused products from static collections to open in the same window instead of a new tab.
### Earning rules
Fixed an issue that caused a collection ID to be displayed instead of its name when multiple products or collections were selected.
### Referral campaigns
Fixed a bug which caused the criteria in the Custom conversion event to change upon saving.
### ResourceLink
Fixed an issue that caused the validation rule's name in the resource link not to refresh automatically after editing.
### User interface
Adjusted spacing in the campaign view between the tabs and the timeframe.
### Loyalty programs
Fixed an issue that triggered updates to all loyalty cards (even when no campaign changes were made) while updating a campaign.
## Added
### Stacking rules
We have added a new setting to Stacking rules: Sorting rule for grouped redeemables. You can now define a general order in which redeemables are applied when stacked discounts (validations or redemptions) include discounts with categories assigned to Joint and Exclusives.
This rule has two options:
* **Apply Joint categories last:** This is a default setting and the current behavior of the Stacking rules. In this scenario, Exclusive categories are applied first and then the Joint categories.
* **Apply Sorting rule to combined Joint and Exclusive categories:** This is a new setting. In this scenario, Stacking rules combine the discounts assigned to Joint and Exclusive categories into one group and apply the discounts according to the Sorting rule setting – request order or hierarchy.
## Added
### Refreshed UI for the publications history tab inside the discount coupon campaign view
We've refreshed the UI for the Publication history tab inside the discount coupons campaign view to match the recent UI changes. The refreshed look provides a compact overview of key details matching our latest UI style for improved usability and a smoother experience.
## Fixed
### Validation rules
Fixed an issue that did not allow the use of negative values when creating validation rules based on number metadata fields.
### UI
Fixed an issue where voucher codes incorrectly appeared as 'no code' in the history tab following bulk publication in discount coupon campaigns.
### Filters
Incentive filtering in the Validations has been split into two separate filters for better usability:
* **Number of stacked incentives** – allows conditions such as 'has exactly', 'has more than', or 'has less than' to filter based on the number of applied incentives.
* **Incentive name** – uses the “includes” condition to filter by specific incentive names.
## Added
### Refreshed UI for voucher tabs inside the campaign view
We've refreshed the UI for Vouchers, Referral codes, and Loyalty cards tabs inside the Campaign detail view to match the recent UI changes. The new tabs provide a compact overview of key details matching our latest UI style for improved usability and a smoother experience.
### Refreshed drawer layout for segments and collections
We’ve updated the UI for drawers used in Customer Segments and Product Collections, delivering a cleaner and more consistent experience.
This update also includes enhancements to breadcrumb navigation links, ensuring better usability and clarity.
## Fixed
### Approvals
* Fixed an issue where the non-existent record with draft status briefly appeared before the page loaded the approvals list.
* Fixed an issue where users with limited permissions could not delete vouchers with an approval request.
### Import
Fixed an issue where the redeemed amount property appeared during the field mapping step when importing referral or discount vouchers. The redeemed amount property is not relevant for these voucher types.
### UI
Fixed an issue where a segment and collection drawer could not open in a new tab from the segments and collections list view respectively.
## Added
### Discounts - new value limits for products
This feature can be enabled for you on demand. Contact [Voucherify support](https://www.voucherify.io/contact-support "Contact Voucherify Support site") to enable it.
You can now limit the number of discounted item units in discount coupons and promotions. With these new limits, you can build a scenario where each of your customers can get for example only 2 discounted product units in total in a campaign and the whole campaign covers only 200 discounted product units – units sold above this limit will not be discounted.
The limits cover the following product discounts:
* Amount discount: Apply the full discount to each item unit
* Percent discount: Apply the discount to item subtotal
* New price: Apply the discount to item subtotal
You can set the limits for products, SKUs, or collections. The new value limits are:
* **Maximum units per customer in campaign:** limits the number of discounted item units that one customer can receive in a given campaign.
For example, the limit is set to 2 for a T-shirt from the Adventure brand. One customer can only discount 2 units of this T-shirt.
* **Maximum units per campaign:** limits the number of discounted item units that all customers can receive in a given campaign.
For example, there are 10 Adventure T-shirts that can be discounted. The 10 discounted T-shirts are available to all customers and the customer who buys the 11th T-shirt won’t receive a discount.
* **Maximum units per campaign for a product in a collection:** limits the number of discounted item units of a given product in a collection that all customers can receive in a given campaign.
For example, the limit is set to 5 for the “Adventure-brand” collection consisting of T-shirts, beanies, and posters; this means that maximum 5 T-shirts, 5 beanies, and 5 posters will be discounted. The limit isn't split between products; each product has its own limit of 5 item units.
* **Maximum units per customer for a product in a collection:** limits the number of discounted item units of a given product in a collection that one customer can receive.
For example, the limit is set to 5 for the “Adventure-brand” collection consisting of T-shirts, beanies, and posters; this means that maximum one customer can get a discount on a maximum of 5 T-shirts, 5 beanies, and 5 posters. The limit isn't split between products; each product has its own limit of 5 item units.
* **Maximum units per promotion tier:** limits the number of discounted item units that all customers can receive in a promotion tier.
For example, there are 10 Adventure T-shirts that can be discounted. The 10 discounted T-shirts are available to all customers and the customer who buys the 11th T-shirt won’t receive a discount under a given promotion tier.
* **Maximum units per customer in promotion tier:** limits the number of discounted item units that one customer can receive in a given promotion tier.
For example, the limit is set to 2 for a T-shirt from the Adventure brand. One customer can only discount 2 units of this T-shirt under a given promotion tier.
* **Maximum units per promotion tier for a product in a collection:** limits the number of discounted item units of a given product in a collection that all customers can receive in a given promotion tier.
For example, the limit is set to 5 for the “Adventure-brand” collection consisting of T-shirts, beanies, and posters; this means that maximum 5 T-shirts, 5 beanies, and 5 posters will be discounted. The limit isn't split between products; each product has its own limit of 5 item units under a given promotion tier.
* **Maximum units per customer in promotion tier for a product in a collection:** limits the number of discounted item units of a given product in a collection that one customer can receive in a given promotion tier.
For example, the limit is set to 5 for the “Adventure-brand” collection consisting of T-shirts, beanies, and posters; this means that maximum one customer can get a discount on a maximum of 5 T-shirts, 5 beanies, and 5 posters. The limit isn't split between products; each product has its own limit of 5 item units.
All of the new limits can be combined with dynamic formulas. A dynamic formula determines the number of units that’s covered by the limit.
The limits can be configured in the Dashboard and through the API – validation rules.
## Added
### New referral tier builder
We've introduced a new referral tier builder in the fifth step of the referral campaign creation process.
## Improved
### Rewards
Added a drop-down to the reward step in the loyalty campaign creation process.
## Fixed
### Discount
Fixed an issue with missing fields in the 'capped by' option for:
* Product discount > Percent discount: Apply the discount to item subtotal
* Bundle with Product discount > Percent discount: Apply the discount to item subtotal
### Metadata
Fixed an issue with the metadata schema update that caused the schema to be cached.
### Earning rules
Fixed an issue with overlapping values in the Earning rules.
## Added
### Loyalty campaigns
You can now define multiple products and collections in the following rules in the Order has been paid earning rule, proportional calculation:
Pre-discount amount spent on items, Amount spent on items, Quantity of items in the cart.
Multiple products and collections are also supported in the API. A new parameter called applicable\_to can be added to the following PROPORTIONAL earning rules:
`ORDER_ITEMS_QUANTITY`, `ORDER_ITEMS_AMOUNT`, `ORDER_ITEMS_SUBTOTAL_AMOUNT`.
The parameter replaces the object and id fields with an array of objects, which contain an id and an object with a type product, sku, or products\_collection.
You can also define a dynamic formula for earning loyalty points. The configuration works in a similar way to a dynamic discount formula.
The dynamic formula is also supported in the API. There’s a new points\_formula field that defines the dynamic calculation of loyalty points.
## Added
### Commercetools connector
We've introduced a Gift Card connector for Commercetools that allows using Voucherify's gift cards during checkout.
This connector features an enabler module to flexibly embed frontend components and a processor module that integrates Voucherify with checkout and payment flows.
### Distributions
* You can now select which fields Voucherify will send in the webhook distribution channel. All fields are pre-selected by default.
* You can also map the fields to custom values, for example you can change fields customer.source\_id to any keys required by your system, like user.id.
* Added detailed webhook summaries to the distributions, showing the number of mapped fields, used headers, and the precise target URL.
## Improved
### Audit logs
Requests and responses are now displayed side by side in the drawer view.
### Distributions
For webhook distributions, limited the set of the characters to lowercase letters, numbers, and dashes in the additional HTTP headers.
### Filters
Clicking on the background while using filters now closes only one window at a time, instead of the entire filter panel.
## Fixed
### Loyalty
Fixed a bug which prevented the time frame for individual loyalty cards from being adjusted through the UI.
## Deprecated
* The Magento extension plugin has been deprecated.
* The Cockpit feature is going to be deprecated – all related links and sections have been removed from the Voucherify dashboard.
## Improved
### User interface
Drawers now remember the previously selected tab, filters, and page when navigating back.
## Fixed
### Bundles
* Fixed an issue where bundle effect discounts were not retained for the draft campaigns.
* Fixed an issue that caused input validation to prevent saving a discount in specific contexts.
### User interface
Fixed an issue where drawers remained open after clicking a resource link.
### Validation rules
Fixed the issue which prevented the correct display of unselectable items in nested lists, including geopoint metadata selection in the Validation Rules Builder.
# Dashboard quickstart
Source: https://docs.voucherify.io/discover/dashboard-quickstart
Learn dashboard basics, create your first campaign, and test it in the Demo Shop
Start your journey with Voucherify, an incentive optimization engine, and prepare your account for the first campaign. In this tutorial, you'll learn key concepts of Voucherify that will let you build attractive and effective promo campaigns.
A Voucherify account gives you access to the API and Dashboard. This means you and your developer and marketing teams can create and manage Voucherify promotions.
If you're a developer, go to [Developer hub](/guides/api-quickstart) to learn more about Voucherify API and other technicalities.
You can also find there details about [planning your integration](/get-started/integration-overview).
## Create account
[Create an account](http://app.voucherify.io/#/signup) to start using Voucherify.
Fill in your details and choose your region. Your region determines where your data is stored. Choose the region closest to your location to reduce latency.
After you sign up, you will receive a verification email. If you don't receive it, [contact Voucherify support](https://www.voucherify.io/contact-support "Voucherify support").
Voucherify gives you a 60-day trial to play and test the platform for free in a Sandbox project. A project is an environment within a single account to create your incentive campaigns. You can have specific production and testing environments or create separate projects for different markets or time zones.
If you upgrade from trial to a paid plan, Sandbox will be visible in your projects list, but it won't be counted toward your project limit.
## Onboarding
Once logged in, Voucherify will lead you through a marketer onboarding tour. As part of the tour, you can create your first campaign and set up additional rules to fine tune your promotion activity.
If you don't want to follow the onboarding tour, you can skip it any time.
Alternatively, you can create your first campaign with the tutorial below.
## Tutorial: Set up a generic code campaign
Here, you'll create a discount coupon campaign that uses a validation rule to show how Voucherify's rule engine works in practice.
Go to Voucherify and follow these steps:
In the left sidebar, go to **Campaign hub** > **Campaigns** > **Create campaign**.
Select **Discount coupons** out of the available campaign types.
Configure the basic details:
1. Name your campaign, for example *FLASH campaign*.
2. Select **Generic (standalone) code** and type your code name, for example *FLASH!*.
3. Leave **Redemption limit** set to **Unlimited**; this means that the code can be used any number of times, by any number of customers.
Go to **Time frame**, but leave the settings as they are. You don't need to set up when the campaign starts, expires, or when it's active or inactive for this tutorial.
Configure the basic discount details:
1. Go to **Discount value**, click **Add discount** > **Order discount**.
2. In **Discount type**, leave **Amount discount: Apply to whole cart** and set **Discount amount** to `10`.
Go to **Conditions** and click the plus button to open the validation rule builder. Here, you'll set conditions that will limit who can use the code and what the cart will need to include for the coupon to be applicable.
Click **Add rule**, add name (for example *FLASH campaign validation rule*), and configure the following rules:
1. In **Products**, set **Any order item** to **Collection** > **All coffees**. This means that the cart will have to include a coffee product.
2. In **Prices and quantities**, set **Total amount** to **is more than 99.99**. This means that a customer's cart total amount will have to be 100 or more.
3. In **Budget constraints**, set **Redemptions per customer in a campaign** to **is less than or equal to 1**. This means that a customer can only use the *FLASH!* coupon once.
4. Click **Save**.
In the discount builder, click **Save** again.
You can set voucher or campaign custom attributes. Skip this step in this tutorial and go to the next step.
You can check the campaign configuration if everything's configured correctly.
Click **Save** to create campaign.
If you're interested in detailed campaign guides, go to:
* [Create coupon campaign](/build/create-discount-coupons).
* [Create discount promotion](/build/create-discount-promotions).
* [Create gift card campaign](/build/create-gift-cards).
* [Create loyalty program](/build/create-loyalty-campaign).
* [Create referral program](/build/create-referral-campaign).
### FLASH campaign in the Demo Shop
Each project has a **Demo Shop**. It shows how the integration between Voucherify and customer touchpoints works in practice.
Once you've created the *FLASH campaign*, check it out in the **Demo Shop** to see how the rule engine works in action.
In this tutorial, you'll check scenarios when validation fails and succeeds depending on different validation rule conditions.
You've set the *FLASH!* coupon to have the following conditions:
1. A coffee product in the cart (beans, not coffee machines).
2. Cart whose total amount is 100 or more.
3. The coupon can be redeemed only once by a given customer.
In the upper side of the **Demo Shop**, click the entry button to select a customer. You can select, for example, Karen Doe.
First, check how the coupon validation fails, because the first condition of the validation rule is not met:
1. Add **Roast Master - coffee machine** to the cart.
2. Go to **Cart**. The cart meets the 2. condition, as it's above 100.
3. Find the *FLASH!* coupon in **Promotions** and click **Apply**.
You will see an error message at the bottom of the screen that the coupon can't be applied, because the cart doesn't have coffee beans, which would meet the first condition.
Now, check how the coupon validation fails, because the second condition of the validation rule is not met:
1. Remove **Roast Master - coffee machine** from the cart.
2. Go back to **Shop** and add **Sumatra - Burbon** (SKU: 1000g) to the cart to meet the 1. condition. Add only one unit.
3. Find the *FLASH!* coupon in **Promotions** and click **Apply**.
You will see an error message at the bottom of the screen that the coupon can't be applied, because the cart total amount doesn't exceed 100, which would meet the second condition.
Now, validate and redeem (use) the coupon successfully:
1. Add a second unit of **Sumatra - Burbon** to the cart. The cart total amount should now exceed 100.
2. Find the *FLASH!* coupon in **Promotions** and click **Apply**.
You'll receive a success message that the coupon has been applied. The discount is applied to the cart and the total amount has changed.
Now, check how the coupon validation fails, because the third condition of the validation rule is not met:
1. In the cart above, click **Go to payment** > **Submit order and redemption** to finalize the purchase.
2. Once done, the content of the cart will remain the same. Find the *FLASH!* coupon in **Promotions** and click **Apply**.
You will see an error message at the bottom of the screen that the coupon can't be applied, because the same customer, Karen Doe, tries to use the coupon for the second time. This doesn't meet the third condition, even though the first two conditions are met.
If you change the customer to Jane Doe, the coupon can be used again, because the overall redemption limit for the whole campaign is unlimited.
## Check default Sandbox data
As Sandbox comes with sample products, customers, validation rules, and campaigns, it's good to check them out. This way you can quickly learn more about different promotions and Voucherify's other possibilities.
Check out the following places:
* In **Campaign hub**:
* **Campaigns**: Lists all created campaigns; by default, Sandbox includes all campaign types.
* **Validation rules**: Lists all created validation rules.
* **Products**: Lists all created products.
* **Product collections**: Lists all collections, which group the products that share defined criteria.
* In **Engagement**:
* **Customers**: Lists all added customers. By default, you'll have three customers.
* **Segments**: Lists all segments, which group the customers who share defined criteria.
In **Campaigns**, click through the listed campaigns to learn how they're configured. You can also edit them to check their settings within the campaign builder and try to recreate them in other campaigns. Also, it's good to clone a campaign and to tweak their settings in a safe way in their duplicate.
Similarly, you can check and clone validation rules to get a better understanding of how the rule engine can be configured.
## Play around in the Demo Shop
If you haven't created and checked the [FLASH campaign](#flash-campaign-in-the-demo-shop), use **Demo Shop** to try out campaigns and check how they work for test customers.
In the Demo Shop, you can select a customer to:
* Apply incentives: Use the **Promotions** section to apply incentives.
* Add products to cart: Browse products from the product list and click **Add to Cart**.
* Manage **Cart**: Review your cart.
* Access **Customer wallet**: View coupons, loyalty cards, gift cards, and all the other available incentives in the Wallet Panel.
You can validate and redeem codes from created campaigns to test different scenarios and validation rules for different customers. The results of each redemption are logged in the **Redemptions** section of the Dashboard.
### What scenarios can you test with the Demo Shop?
You can check the following:
* Choosing a customer to check incentives for customer segments
* Qualification for incentives
* Discount vouchers validation and redemption
* Promotion validation and redemption
* Pay with loyalty points: loyalty card validation and redemption
* Pay with gift card: gift cards validation and redemption, choose how much gift card credits to apply to an order
* Stacking multiple incentives
* Region- and currency-specific campaigns
Dev tip
Click **API calls** in the bottom panel to see all API calls made throughout the customer journey in the Demo Shop.
There, you can see the API methods and endpoints called. You can also check the payload of requests and responses and copy them. You can copy the request payload to use it later on in [Voucherify Postman collections](https://www.postman.com/voucherify/voucherify-s-public-workspace/overview "Voucherify public workspace").
## Next steps
Once you've learned basic Voucherify capabilities, explore the following topics.
Explore different demo sections to learn how Voucherify features work in the Dashboard, demo store, mobile app, and POS emulator.
[Open interactive demo](https://app.demoboost.com/playback/mcsxiprn?step=1)
Read the [Integration blueprint](/get-started/integration-overview) to learn what steps you and your dev team need to follow to successfully integrate with Voucherify.
When you want to prepare your project to be a production environment or you want to use data that better your specific case in Sandbox, visit the following articles:
* [Customers](/prepare/customers)
* [Products](/prepare/products)
* [Orders](/prepare/orders)
* [Metadata](/prepare/metadata)
* [Custom events](/prepare/custom-events)
# Vincent
Source: https://docs.voucherify.io/discover/vincent
Automate incentive campaigns and cross-system analysis using natural language with Vincent, Voucherify's AI agent.
Describe the incentive you want, and Vincent builds it inside your account. It reads your data freely, but it asks for your approval before it creates or changes anything.
## About Vincent
Vincent is Voucherify's AI agent for incentive campaigns. It uses the same validation logic, guardrails, and API that already power your incentives, so nothing about how your campaigns work changes. What changes is the interface: instead of building a campaign field by field in the dashboard, you describe what you want in a conversation.
Every request follows the same pattern. Vincent looks at your account first, checking existing campaigns, naming conventions, and metadata schemas, so its suggestions fit what you already have. It then proposes a step-by-step plan and waits for you to review it. You can approve the plan as it is, or edit a step directly, for example, change a discount value or a date range, before anything runs. If a step fails partway through, Vincent can retry it, skip it, revise the plan, undo completed steps, or hand off to a person, instead of leaving your account in a half-finished state.
Editable execution plans are a new addition to Vincent. If a proposed step is almost right but not quite, for example the discount should be 20% instead of 15%, change the value directly in the plan instead of asking Vincent to start over. Vincent re-checks the change before you give final approval.
Unlike Voucherify Core MCP, where API calls count toward your billing period, Vincent's actions aren't subject to usage-based billing or API call limits.
## Activating Vincent
Vincent is currently available to a limited set of customers, with priority given to Enterprise plans. It isn't a self-serve toggle in the dashboard yet. To request access, submit the early access form at [voucherify.io/vincent](https://www.voucherify.io/vincent), or check with your Account Manager if you already have one.
## What Vincent can do
Vincent handles four broad kinds of requests: setting up your account structure, checking a campaign before it goes live, building and analyzing campaigns, and answering customer questions on the spot.
### Configuration and setup
Ask Vincent to keep your account structure clean before you build on top of it. Vincent can review undocumented custom attributes across your account and turn them into a formal metadata schema, set up an initial schema from scratch for a newer account, or group products by category and price into a reusable product collection.
### Campaign creation and validation
Describe the mechanic you want, and Vincent configures it: an A/B test on a welcome incentive, a buy-one-get-one (BOGO) campaign, or a flash sale with VIP targeting, for example. Before any campaign goes live, Vincent can also run a readiness check on it, catching conflicts or missing conditions you'd otherwise find out about the hard way.
### Analytics and insights
Ask Vincent about performance instead of digging through a dashboard. Vincent can factor product margin into what it recommends rather than just projected uplift, compare variants within a campaign to see which one is actually driving results, break down revenue for a given time period, or find your best-performing campaigns and rebuild the logic behind them for a new one. It can also answer one-off customer questions, like whether a specific customer qualifies for a birthday discount or has an active wallet balance, which is useful for resolving a support ticket on the spot.
### Connecting other tools, for cross-system reasoning
Vincent can also connect to tools outside Voucherify, market and competitive intelligence sources, or customer engagement and CRM platforms, and reason across both sides instead of just Voucherify's own data. Connecting one of these is optional, and each one unlocks a different set of scenarios. A few examples:
* **Competitive and market intelligence.** Scan competitor promotions and turn what's found into a campaign action: find whitespace in competitor timing ahead of a key date, benchmark discount depth or flash sale duration and adjust your own campaign to differentiate, analyze category-level competitor promotions and respond, benchmark end-of-season clearance mechanics before launching your own, or build a full promotional calendar based on the competitive landscape.
* **Audience parity checks.** Compare how a segment like "Gold tier" or "dormant customers" is actually defined across two systems, flag where the rules diverge, and recommend which definition should be the source of truth.
* **Churn-aware win-back briefs.** Pull at-risk signals from a connected customer engagement platform, then design a matching Voucherify offer, discount, validity, code pool, as a brief ready for review.
* **Journey overlap and fatigue checks.** Before a campaign launches, check whether the same audience is already being targeted elsewhere that week, across other campaigns or channels, and get a recommendation to delay, exclude a group, or merge messages.
* **Consent checks before a send.** Confirm the planned channel is actually allowed for that audience under current consent settings, before anything goes out.
In these cross-system scenarios, the connected tool stays read-only. Vincent reasons over its data but only writes back into Voucherify, and only after you approve. Any action needed on the other system comes back as a written recommendation for you to carry out there.
## See it in action
Two examples show what a Vincent conversation looks like end to end, from a question to a live campaign.
**Responding to a competitor promotion.** Ask Vincent to scan competitor promotions ahead of a key date, and it returns a breakdown of each competitor's discount range, offer type, and overall strategy, closing with a short summary of the competitive picture. Ask it to plan a response, and Vincent checks your existing campaigns and product collections first, then proposes a few response strategies, for example a tiered spend promotion, a BOGO with free shipping, and a loyalty member exclusive, each with a stated goal and a reason it should work against what competitors are doing. Before building anything, it asks a few clarifying questions: which product category, coupon codes or auto-applied promotions, which dates, and which audience.
**Editing a plan before you approve it.** Ask Vincent to create a promotion restricted to a segment that doesn't exist yet, for example "VIP Shoppers", and Vincent proposes a definition for it rather than guessing silently, then lays out an execution plan: create the segment, create the campaign, add the discount tier, and set the validation rule. You can edit any step's parameters directly in the plan, and once you do, the approval button relabels from **Approve and run** to **Approve edited plan**, alongside a **Discard plan** option that's available throughout. Change the discount percentage or the spend threshold, and Vincent flags anything in the step's own description that's now out of sync with your edit, so you can update the wording along with the number.
## Current limitations
Vincent is early in its rollout, so it's worth knowing where the edges are before you rely on it.
* **Access is limited.** Vincent isn't generally available yet. It's rolling out to selected customers, with Enterprise plans prioritized.
* **Write actions need your approval.** Vincent reads account data freely, but it can't create or change a campaign, rule, or other data without you confirming the action first. Nothing goes live on its own.
* **Cross-system use cases depend on what's connected.** Competitive benchmarking, audience parity checks, and similar scenarios only work once the relevant external tool is connected. Without one, Vincent still works, just without that layer.
* **Complex calculations are estimates, not guarantees.** For scenarios involving multiple earning rules, tiers, or mappings, treat Vincent's output as a strong starting point and verify it before treating it as final.
* **It's still evolving.** As an early-access product, functionality, prompts, and supported use cases may change as the rollout continues.
## Troubleshooting and feedback
Vincent is still under active development, and we'd love your feedback to help shape it. If something doesn't work as expected, or you hit a gap in what Vincent can do, let us know. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your Account Manager.
## Disclaimer
Vincent is an early-access AI agent, and its setup, configuration, and outputs are provided "as is" and without warranties.
Use is at your own risk. Voucherify is not liable for issues caused by incorrect setup, misuse, or decisions made based on Vincent's output. Always review a proposed change before you approve it.
If you have questions or need support, reach out to our team, [we're here to help](https://www.voucherify.io/contact-support).
## Related features
If you want to go deeper on how Vincent works, or connect other AI tools to your Voucherify data, these related resources cover it.
Vincent runs on a plan, approve, execute, recover workflow built with LangGraph. It connects to two separate services: one for reading account data, and one for writing changes once you've approved them. This separation is what keeps read access unrestricted while write access always waits for a human decision.
If you want AI tools other than Vincent to read your Voucherify data directly, for example inside Claude Desktop or Cursor, see the [Voucherify Core MCP](https://docs.voucherify.io/guides/voucherify-core-mcp) guide.
# Voucherify user guide
Source: https://docs.voucherify.io/discover/voucherify-user-guide
Learn how to prepare data, build campaigns, optimize incentives, orchestrate operations, analyze performance, and manage your account in the Voucherify dashboard
The Voucherify user guide helps marketers and administrators configure promotional campaigns without writing code. Follow these sections in order to launch your first campaign, or jump to any section as needed.
## Your journey
Set up customers, products, orders, and metadata. Clean data enables precise targeting and faster campaign launches.
Create discount coupons, cart promotions, loyalty programs, gift cards, and referral campaigns.
Control eligibility with validation rules, set time limits, and configure rewards.
Publish codes, maintain campaigns, control stacking rules, and manage areas and stores.
Track campaign and voucher activity, review redemption analytics, and audit project changes.
Configure your Voucherify account, team and project settings, and organization security from one place.
## How the sections connect
Each section builds on the previous one:
1. **Prepare**: Import customers, products, and define metadata. This data powers your validation rules and segments.
2. **Build**: Choose a campaign type and configure the incentive mechanics.
3. **Optimize**: Add validation rules to control who can redeem, set time windows, and create rewards.
4. **Orchestrate**: Publish codes to customers, manage active campaigns, control how incentives stack, and target specific regions or stores.
5. **Analyze**: Measure campaign performance, inspect voucher activity, review redemption analytics, and audit project changes.
6. **Manage**: Administer your subscription and billing, team and project settings, and organization-wide security controls.
Start with the Prepare section to set up your foundational data. Well-structured customer and product data makes campaign targeting faster and more accurate.
## What's next?
* **New to Voucherify?** Start with [Prepare](/prepare/prepare-overview) to set up your data.
* **Ready to launch?** Jump to [Build](/build/campaign-overview) to create your first campaign.
* **Fine-tuning?** Use [Optimize](/optimize/optimize-overview) to add targeting rules.
* **Managing live campaigns?** Go to [Orchestrate](/orchestrate/orchestrate-overview) to publish codes and control operations.
* **Measuring results?** Head to [Analyze](/analyze/analyze-overview) to track performance and audit changes.
* **Setting up your workspace?** Visit [Manage](/manage/manage-voucherify-overview) to configure your account, team, projects, and security.
# Integration blueprint
Source: https://docs.voucherify.io/get-started/integration-overview
Follow this blueprint for a successful Voucherify launch
## Discover
Before going live, involve the right people: marketing, product, and engineering. Define what "success" means in your context:
* **What are you trying to improve?** Conversion rate? Repeat purchase? Average order value (AOV)?
* **Which incentive types are worth testing?** Coupons, bundles, gift cards, referrals, loyalty points?
* **Who sees what?** Define your audience segments, control groups, and rules.
* **Where do incentives appear?** Email, app, checkout, QR codes?
* **When do they trigger?** Map rules like time windows, frequency caps, cart conditions.
* **How do you stop overspend?** Set up budget caps, time frames, and throttling logic.
* **What else is in your stack?** CDP, CRM, CEP? Map what tools to connect.
## Plan
Start with a Voucherify Sandbox project. It comes with its own API keys and a 60-day trial for safe testing. For best performance, pick a project region close to your region.
Consider these key points in your planning:
* **Team access**: Invite as [many users](/manage/members-and-roles) as needed and assign role-based access to keep responsibilities clear and data secure. Generate separate API keys if needed to manage integrations by scope.
* **API touchpoints**: Map out your customer journey to decide where incentives will appear and how they’ll be redeemed. Identify if you need [qualification](/guides/checking-eligibility), [validation](/api-reference/validations/validate-stackable-discounts), or [redemption](/api-reference/redemptions/rollback-stackable-redemptions) steps and where each fits in the flow. Then, pinpoint which systems (e.g. e-commerce, mobile app, POS) should connect with Voucherify to handle these calls.
* **Data model**: Define what kind of data you need and prepare them beforehand.
* **Distribution**: Decide how you will deliver promo codes or promotion notifications to customers. We recommend using dedicated CEPs. Voucherify offers two distribution modes:
* Pull: Use API to get promotions in front of customers (e.g., list all active coupons).
* Push: Define a trigger for the message send-out (e.g., if a customer signs up for a newsletter, send them a 10% off promo code).
* **Reporting**: Plan how you’ll measure campaign performance using Voucherify Dashboard or data exports. If you're using a BI tool, define how data will flow (CSV, APIs, or [webhooks](/api-reference/introduction-to-webhooks)).
* **Migration**: If you are moving from another promotion system, plan the [import of existing incentives](/guides/import-codes).
* **Scale**: Estimate your expected load (API call volumes, user count, and peak redemption rates). High traffic or large datasets might require a dedicated region or impact your rate limit planning. This helps you choose the right subscription tier and avoid performance issues.
* **Project structure**: Voucherify lets you manage separate projects for different brands, locations, currencies, or dev stages. You can isolate business contexts with distinct projects or use categories, labels, code prefixes, and metadata to manage everything in a shared project. Projects affect settings like currency, timezone, user roles, API keys, and webhooks. For enterprise users, the [Management API](/guides/management-api) allows full programmatic control over project setup, updates, and maintenance.
* **Security and compliance**: Review any [security](/guides/security) requirements and data policies before integrating. Identify sensitive data (PII) that will be sent to Voucherify and ensure it aligns with GDPR or other regulations. Use server-side API keys for critical operations and ensure encryption for data in transit. Control access with Voucherify’s role-based permissions and project scopes. If fraud is a concern, plan rules or monitoring to detect and block suspicious activity.
Voucherify’s modular design lets you integrate only what you need first, then expand as your needs grow.
### Promotion limits
As part of planning, define exactly who can and can’t access your promotions. For each campaign, combine rules using Boolean logic across customer, order, product, and time dimensions:
* **Customers and customer attributes**: Voucherify lets you collect, update, store, and export customer data to be used in your campaigns. Once synced, you can build [segments](/prepare/customer-segments) and apply limits based on any attribute.
* **Cart structure and product information**: Integrating your inventory allows you to launch product-specific campaigns and add physical rewards to loyalty and referral programs. When the product data is synced, you can quickly:
* Restrict promotions to apply to certain products or develop [“buy X, get Y” scenarios](/build/product-bundles).
* Exclude products and SKUs from campaigns.
* Create loyalty earning rules based on cart structure.
* Build static and dynamic product collections.
* Define product attributes using metadata.
Syncing customer and product data is optional. Instead of syncing data, you can use an external customer or product identifier to provide relevant attributes during validation.
* **Promotion budget**: Voucherify offers a safety net that works hand in hand with customer profile- and cart-based [validation rules](/optimize/validation-rules-reference). You can configure a campaign in a way that automatically stops when its target is satisfied, for example:
* Redemptions per customer/code in a specific timeframe.
* Maximum discount for a percentage deal.
* Total order value, discounted amount, and total number of redemptions.
* Many more!
* **Custom attributes and events**: Add custom fields to Voucherify. The schema configuration ensures custom data integrity by supporting various data types, including arrays, data limits, and nesting. You can also map custom events to trigger promotion-related activities, such as promo code send-out.
## Model and prepare data
A successful implementation of Voucherify requires preparing a good data model:
* **Customer data**: Identify which customer attributes and events Voucherify needs to meet your use case. Decide whether to sync this data through the API or Dashboard, and how often updates should occur to stay accurate. You can also integrate a CDP to automate and centralize this flow.
* **Product catalog**: If your campaigns rely on product data, connect your product catalog to Voucherify. Import product IDs, SKUs, or collections so promotion rules can use them accurately. Sync through the API or Dashboard and decide how often to update. Make sure product IDs match your e-commerce system to keep everything consistent.
* **Orders**: Sync transaction data with Voucherify during validation or redemption to enforce cart-level rules. For legacy order history, use the import orders endpoint or the [Create](/api-reference/orders/create-order) and [Update](/api-reference/orders/update-order) Order APIs. This ensures redemptions are tied to real transactions and enables accurate tracking and reporting.
* **Metadata**: [Define metadata schemas](/guides/metadata-mapping) upfront for customers, orders, or other entities to support custom rules, like loyalty tier or custom segments. Adding these fields ensures consistency and guides developers on what data to include in API calls. It also makes rule-building in Voucherify clearer and more reliable.
* **Event schema**: If you plan to use [custom events](/prepare/custom-events), set them up in Voucherify ahead of time. This ensures your system's events are recognized and can trigger rewards or promotions based on real-time actions.
* **Campaign configuration**: While campaign setup is mainly for marketing, creating one or two test campaigns with validation rules is useful during development. It helps confirm that your customer, product, and transaction data is properly integrated and aligns with campaign logic.
Take into consideration your data volume (how many customers, products, orders, and other records you plan to send to Voucherify). This helps you plan for performance, API usage, and any bulk import needs upfront.
## Integrate
In the Integrate phase, you incorporate Voucherify’s API into your application workflows:
* Authenticate with the Voucherify API:
* Server-side (secret) API key: Used for secure operations on your backend.
* Client-side (publishable) API key: Used for public client applications (mobile apps, web apps) to access a subset of the API labeled as client-side. Client-side features require domain/mobile app origin whitelisting in **Project settings** > **Client-side settings**.
* OAuth 2.0: Voucherify supports OAuth 2.0 for API authorization.
* Install an SDK: Voucherify provides SDKs for various languages, which automatically handle API keys.
* Select core API calls:
* [**Validation**](/api-reference/validations/validate-stackable-discounts): Checks the eligibility of discounts and calculates final prices.
* [**Redemption**](/api-reference/redemptions/redeem-stackable-discounts): Applies incentives to a customer’s order.
* [**Qualification**](/guides/checking-eligibility): Suggests relevant promotions and coupons based on customer attributes, selected scenario, and current shopping cart contents, with filtering options for campaign category and hierarchy. It can be used to display strike-through prices.
* [**Publication**](/api-reference/publications/create-publication): Associates a code with a specific customer, typically for code distribution. This step can be triggered on demand.
* Connect with your stack: Configure API keys to integrate Voucherify with other tools.
* Migrate data: Import the planned data as well as any legacy codes you want to transfer from your previous systems.
* Configure additional functionalities: Prepare distributions to automate actions in response to selected triggers or set up webhooks for automation and data tracking.
## Test
Before you launch, test your Voucherify integration thoroughly to ensure it works just as you planned. Voucherify offers two ways of basic testing:
* **Sandbox**: Each Voucherify account comes with a [Sandbox](/discover/dashboard-quickstart#check-default-sandbox-data) that’s separate from your project limit and has its own API keys. It’s capped at 100 API calls per hour and includes default test data like campaigns, codes, customers, and products. For meaningful testing, add realistic data – customers who qualify (or don’t), sample products, and example campaigns. This helps validate your setup before going live.
* **Demo Shop**: The Sandbox includes a built-in Demo Shop, a test environment for simulating transactions and validating campaigns. You can apply discounts, redeem codes, and see how your rules behave in real scenarios. Each redemption is logged in the Dashboard, and you can inspect API requests and responses, including full JSON payloads.
### Functional testing
For each campaign type and user story, perform tests within your application:
* **Coupons**: Test valid, expired, used, and invalid codes. Confirm correct discount application and appropriate error messages.
* **Cart promotions**: Test various cart contents to ensure automatic promotions trigger (or not) as expected.
* **Loyalty**: Simulate earning points by triggering events like test purchases. Check that loyalty balances update correctly and that point redemptions only succeed when enough points are available.
* **Referrals**: Simulate referral flows using two test customer accounts, verifying incentives for both the referred and referrer.
* **Distribution**: Trigger conditions for automatic distributions (emails, etc.) and confirm messages are sent.
Intentionally test failure scenarios and edge cases. Send malformed API calls, remove required data, use wrong keys, or disable networks to ensure your error handling works. Also test complex rules like mutually exclusive promotions or budget caps to confirm campaigns behave correctly under pressure.
### Data integrity checks
Ensure data consistency between systems. After test redemptions, verify the following in the Voucherify Dashboard:
* Redemption entries to confirm details such as customer and order amount. Check with your internal database if it also reflects the redemption.
* Order entries to check if discounts, metadata, and activity data show intended results.
* Audit log to inspect any other event that requires checking, including webhook sendouts.
## Deploy
Before rolling out the integration into production, complete a final launch checklist:
* **Swap to production API keys**: Update the application configuration to use the production Voucherify API keys for the live environment.
* **Data consistency**: Replicate key data from your Sandbox to your production project. Double-check that product catalogs, metadata schemas, and other configs are consistent. Use campaign templates to transfer discount or gift campaign setups easily, ensuring a smooth transition without starting from scratch.
* **Enable production campaigns**: Activate and configure all campaigns intended for launch in the production Voucherify project. Upload production-specific data and verify campaign settings (date ranges, discount values, budget limits). Disable or delete any test campaigns or codes in the production project that should not be live.
* **Access**: Confirm all team members needing access to Voucherify have appropriate roles in the production project. Ensure API key permissions align with required API actions.
* **Training**: Confirm the Marketing/CRM team is proficient in using Voucherify in production, including creating, pausing, and monitoring campaigns.
* **Backup**: Establish a contingency plan for potential issues post-launch, such as disabling a malfunctioning promotion or reverting to manual workarounds. Understand how to contact Voucherify support for urgent platform issues.
* **Privacy and compliance check**: Verify all privacy measures are in place, particularly regarding real customer data flow. Ensure compliance with GDPR and other regulations.
* **Go live communication**: Inform all relevant parties, including customer support, about new promotions and the Voucherify system.
## Maintain
You can use the following functionalities to track and maintain your Voucherify project:
* **Webhooks**: Stream real-time events directly into your systems. Webhooks enable instant reactions, integration with marketing automation, and syncing with data warehouses or analytics platforms.
* **APIs for data export**: Use Voucherify’s APIs to query redemptions, customer profiles, campaign statistics, and more. Bulk operations are supported, making this ideal for syncing with BI tools or external reporting systems.
* **Built-in reporting and CSV export**: Access real-time analytics in the Dashboard for each campaign type, and export data (vouchers, redemptions, customer lists) in CSV format for deeper analysis or audit trails.
* **Campaign and customer insights**: Track campaign performance, ROI, and budget spent over time or in real-time. Drill down into aggregate metrics or browse individual events. Use the 360-degree customer view to explore personal details, order history, promotion activity, and loyalty status.
* **Redemption tracking**: Analyze when and why redemptions fail to optimize eligibility rules and UX flows.
* **Audit logs**: Full transparency into system activity with logs covering API request/response data, webhook events, and system-level changes, useful for debugging and compliance.
* **API usage monitoring**: Keep tabs on your hourly and monthly API consumption with clear dashboards. Set up automatic in-app or email alerts when nearing limits for API calls, redemptions, or bulk operations. Alerts also cover webhook usage thresholds.
* **Integrations with BI and marketing tools**: Voucherify supports event streaming (for example with Kafka), async CSV exports, and direct integrations with CDPs and CEPs. This makes it easy to use Voucherify as a data source in broader marketing and analytics pipelines.
## What’s next?
* Explore the [Voucherify Postman Collection](https://www.postman.com/voucherify/voucherify-s-public-workspace/) to check API requests and responses.
* Join [Voucherify Community Slack](https://www.voucherify.io/community) to get help and inspiration.
* Visit the [Voucherify roadmap](https://roadmap.voucherify.io/) to find out what Voucherify developers are currently working on or suggest improvements and vote for features you want to see in the platform.
* Contact [Voucherify support](https://www.voucherify.io/contact-support) if you have any further questions.
# Voucherify docs
Source: https://docs.voucherify.io/get-started/introduction
Welcome to Voucherify documentation!
Documentation
Everything you need to build, launch, and fine-tune incentives that actually work. Explore Voucherify's APIs, SDKs, and recipes to quickly go from first call to full rollout.
# Key concepts
Source: https://docs.voucherify.io/get-started/key-concepts
Learn the key concepts to help you implement loyalty and promotional campaigns and integrate Voucherify with your stack
Voucherify operates on fundamental building blocks that you can use to create your loyalty and promotional campaigns and integrate them with your system.
Some Voucherify objects connect to each other to support different business scenarios.
## Project
A project is an environment for managing your activities in Voucherify. Use a project to manage activities for a specific brand, region, or currency, or for development and staging. For example, each Voucherify account has a Sandbox project for testing purposes.
A project contains all the resources described in this article.
Each project has a set of unique API keys. Also, the data, for example customers, products, campaigns, or all IDs generated by Voucherify, are separate for each project.
Read [Project settings](/manage/project-settings) article to learn more.
Voucherify [Management API](/guides/management-api "Management API"), available as an Enterprise feature, enables you to manage projects through the API. For instance, you can set up new projects with a specific configuration fully programmatically. You can list, retrieve, update, or delete projects and their settings programmatically.
## Campaigns, vouchers, and promotions
A project consists of campaigns that are based on vouchers and promotion campaigns, which don't need them.
### Campaign
You use campaigns to carry out promotional activities.
There are five basic campaign types, which create:
* [discount coupons](/build/discount-promotion-overview),
* [loyalty cards](/build/loyalty-campaign-overview).
* [gift vouchers](/build/gift-card-overview),
* [referral codes](/build/referral-campaign-overview),
* [promotions](/build/discount-promotion-overview) (without vouchers),
For voucher-based campaigns, each campaign has a set of unique voucher codes, which work in the same way.
Campaigns work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ----------------------------- | ---------------------------------------------------------------------------- |
| Validation rule | Sets campaign eligibility criteria, like the order total must be over \$100. |
| Product or Product collection | Targets discounts to specific products or collections. |
| Distribution | Sends campaign codes via email, SMS, and other channels. |
| Campaign metadata | Adds custom information, such as images or terms and conditions. |
| Category | Defines discount stacking behavior and helps filter results. |
| Template | Saves configuration of a gift or discount campaign. |
[Campaign](/api-reference/campaigns/campaign-object) API reference
### Voucher
A voucher is an incentive you offer to end customers. Each voucher has a unique code and ID.
Vouchers can be grouped under one campaign to serve the same purpose. For example, you can create a campaign that assigns vouchers to customers who have a birthday.
You use vouchers in the following campaign types:
* [discount coupons](/build/discount-promotion-overview),
* [gift vouchers](/build/gift-card-overview),
* [referral codes](/build/referral-campaign-overview),
* [loyalty cards](/build/loyalty-campaign-overview).
[Voucher](/api-reference/vouchers/voucher-object) API reference
### Promotions and promotion tiers
A promotion is a campaign that groups specific discounts. It does not require a voucher code. When a customer or their order qualifies, Voucherify automatically applies the discount to the order, or shows it to the customer as part of the [qualification](#qualification) process.
A promotion tier is a specific discount with conditions. Voucherify automatically applies the discount to customers and orders that meet those conditions.
You can apply promotion tiers together as a promotion stack or arrange them in a hierarchy within a single promotion campaign.
[Promotion tier](/api-reference/promotions/promotion-tier-object) API reference
### Template
A template saves a campaign configuration and links to all resources from the original campaign: validation rules, metadata, rewards, distribution setup, and more. Use it to create a new campaign with the same configuration or edit its details as needed.
* [Create campaign template](/api-reference/templates/create-campaign-template) API endpoint
* [Campaign templates](/build/campaign-templates) article
## Order
An order represents a transaction placed by a customer in your system. It contains details about the items and details about any incentives as well as discounts applied to the order.
Orders work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| --------------- | ---------------------------------------------------------------------- |
| Redemption | Incentives tied to specific orders. |
| Validation rule | Logic can include total amount, quantity, etc. |
| Metadata | Adds order-specific information for validation and reporting purposes. |
| Distribution | Can trigger messages based on order events. |
[Order object](/api-reference/orders/order-calculated-object) API reference
## Products and product collections
Voucherify can store your product catalog. You can also group products into collections.
### Product
A product represents an item or service sold to end-customers. A product can also have its variants – Stock Keeping Units (SKUs).
Products work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ------------------ | ------------------------------------------------------------------------------------- |
| Product collection | Used to form static or dynamic (updated automatically) groups of products. |
| Metadata | Defines properties like brand, category, etc. Used in filtering or dynamic discounts. |
[Product object](/api-reference/products/product-object) API reference
### Product collection
A product collection groups products according to criteria defined with filters, for example price or metadata values.
Product collections work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ---------- | ------------------------------------------ |
| Product | Selected manually as a static collection. |
| Metadata | Filters products based on shared metadata. |
[Product collection object](/api-reference/product-collections/product-collection-object) API reference
## Reward
A reward is a benefit that customers can get by exchanging (redeeming) loyalty points or as part of a referral program.
Rewards work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Campaign (referral and loyalty programs) | Rewards can be linked to campaigns to define what the customer receives, like a gift card, a product, etc. |
[Reward object](/api-reference/rewards/reward-object) API reference
## Customer and customer segments
Voucherify can store details about your customers. You can also group customers into segments according to defined criteria.
### Customer
A customer is an entity in Voucherify that represents an end customer of a store, a B2B customer, or any partner who sees products or services. A customer can be assigned vouchers or be eligible for promotions.
A customer object can have many parameters, for example:
* name,
* email,
* birthdate,
* metadata.
Customer entities work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ----------------- | ---------------------------------------------------------------------- |
| Customer metadata | Adds attributes like VIP customers, region, etc. Used in segmentation. |
| Custom events | Triggers based on behavior, like app installation. |
| Customer segment | Selected manually as a static segment. |
[Customer object](/api-reference/customers/customer-activity-object) API reference
### Customer segments
A segment is a customer group that shares the same parameters.
There are two types of segments in Voucherify:
* **static**: it contains a manually prepared list of customers based on customer ID,
* **dynamic**: customers are dynamically added to or removed from the segment if they match a given filter. For example, it can be the customer's birthday is today, they haven't placed any orders in the past 30 days, or they joined a newsletter.
Customer segments work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ----------------- | ------------------------------------------------------ |
| Customer | Source of data for static or dynamic segments. |
| Customer metadata | Filters customers based on shared metadata. |
| Custom events | Used for rules that define segment inclusion. |
| Validation rule | Used to narrow down campaign eligibility. |
| Distribution | Used to trigger message send out to matched customers. |
[Customer segments](/prepare/customer-segments) article
## Incentivization rules and processes
In Voucherify, you can set rules that govern how incentives, such as vouchers or discounts, are applied. You manage these incentives through several processes related to their application.
### Validation rules
Validation rules are conditions you apply to campaigns, generic (standalone) vouchers, promotion tiers, or distributions. For example, the customer or their order must meet these conditions before Voucherify applies the incentive.
You can create a validation rule in advance. It is an independent object that you can attach to or detach from the above-mentioned objects and reuse in the future.
Validation rules work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Metadata, for example for customers, orders, Custom events, redemptions | Customer metadata can restrict coupon usage to specific user profiles, like allow redemptions only if `customer.region = "EU"`. |
| Order | Set conditions based on the contents of the cart, like Apply a discount on `order.total_amount` above \$100. |
| Product or product collection | Require or exclude specific products in the cart. |
| Campaign | Sets eligibility criteria, like a discount campaign can include a validation rule that checks if the customer's order exceeds \$100; if the condition isn’t met, the coupon won’t apply. |
| Customer or customer segment | Apply discounts only to a specific segment, like limit access to the "Loyal Customers" segment. |
* [Validation rule](/api-reference/validation-rules/validation-rule-object) API reference
* [Validation rules and campaign limits](/optimize/validation-rules-reference) article
* [How to build validation rules](/optimize/create-validation-rules) article
### Qualification
Qualification is the process that validates which incentives (for example products, vouchers, or promotions) can be used in the customer's order.
* [Qualification](/api-reference/qualifications/check-eligibility) API reference
* [Qualification – checking eligibility](/guides/checking-eligibility) article
### Validation
Validation checks if a combination of vouchers or promotion tiers, together with the applied validation rules, is valid for the customer. Based on the result, Voucherify calculates the final price. Validation checks up to 30 vouchers or promotion tiers.
[Validate stackable discounts](/api-reference/validations/validate-stackable-discounts) API reference
### Redemption
Redemption applies and consumes vouchers or promotion tiers on the customer's order. It checks if a voucher or promotion tier, together with the applied validation rules, is valid for the customer. Redemption checks up to 30 vouchers or promotion tiers.
Redemptions work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ------------ | ------------------------------------------ |
| Metadata | Used for tracking or limiting redemptions. |
| Order | Ties redemption to a specific transaction. |
| Distribution | Can trigger a distribution. |
[Redeem stackable discounts](/api-reference/redemptions/redeem-stackable-discounts) API reference
### Rollback
A rollback reverts a redemption. It withdraws the incentive from the customer's order and updates its status.
[Rollback stackable discounts](/api-reference/redemptions/rollback-stackable-redemptions) API reference
## Communication
You can use Voucherify as part of your communication strategy. Voucherify also supports webhooks to notify you about events related to customers, redemptions, or loyalty programs.
### Distribution
Distribution sends vouchers and other promotional messages to customers. You can use distribution as a [publication](#publication) method.
There are two types of distributions:
* **automatic**: an event triggers the distribution,
* **manual**: you send the message to all customers or a specified group.
Distribution channels include, among others:
* emails,
* text messages,
* live chat,
* push notifications.
Distributions work together with other Voucherify entities, see examples in the table below.
| Links with | Example |
| ---------------- | -------------------------------------- |
| Custom event | Trigger messages when an event occurs. |
| Customer segment | Sends messages to a defined group. |
| Campaign | Serves as a source for incentives. |
[Distributions overview](/integrations/distributions-overview) article.
### Publication
Publication assigns a voucher to an end customer.
[Publication](/api-reference/publications/publication-object) API reference
### Webhooks
A webhook is an HTTP callback triggered by an event rather than by a direct request. You can use webhooks to notify external systems about events or actions performed in Voucherify.
The events can be custom. You can use custom events to track end-customer interactions with a system.
* [Introduction to Voucherify webhooks](/api-reference/introduction-to-webhooks) article
* [Custom event](/api-reference/events/event-object) API reference
* [Webhook notifications](/api-reference/distribution-webhooks) article
* [Custom events](/prepare/custom-events) article
## Metadata (custom attributes)
Metadata (custom attributes) are customizable data you can add to default Voucherify objects. A custom attribute consists of a key and value pair.
* [Metadata schema](/api-reference/metadata-schemas/metadata-schema-object) API reference
* [Metadata mapping](/guides/metadata-mapping) article
* [Create metadata schema](/api-reference/management/create-metadata-schema) – Management API endpoint
* [Getting started with metadata](/prepare/metadata) article
## Custom events
Custom events are actions taken by your customers. You can use them to track customer behavior and build personalized campaigns. For example, you can send a 5% off coupon to customers who abandon their cart.
* [Custom events](/prepare/custom-events) article
* [Create custom event schema](/api-reference/management/create-custom-event-schema) – Management API endpoint
# Voucherify overview
Source: https://docs.voucherify.io/get-started/welcome-to-voucherify
Learn about Voucherify and its possibilities
## What is Voucherify?
Voucherify is an API-first incentive optimization engine for the agentic era, built for teams who need to move fast, personalize deeply, and control every variable.
Voucherify slots easily into your existing stack and lets you launch:
* **[Coupons](https://www.voucherify.io/coupon-software)** with dynamic rules and tracking.
* **[Auto-applied discounts](https://www.voucherify.io/discount-promotions)** personalized by context.
* **[Gift cards](https://www.voucherify.io/gift-cards)** that work across regions and can be topped up.
* **[Bundles](https://www.voucherify.io/product-bundling)** with unlimited variables and multiplication behavior.
* **[Loyalty programs](https://www.voucherify.io/loyalty-software)** that adapt based on behavior, value, region, or any metadata.
* **[Referral programs](https://www.voucherify.io/referral-programs)** with flexible reward logic and fraud control.
You don't need to rip anything out. Even if you already have a legacy loyalty system, Voucherify can sit alongside it and help you move faster.
## Who is Voucherify for?
Voucherify is built for developers, marketers, and product teams across:
* E-commerce and retail
* Subscription and on-demand services
* Travel, fintech, telecom, and more
You can use Voucherify across the customer journey:
* **Acquire** new customers with targeted promos
* **Convert** them with welcome offers
* **Grow** with referrals and personalized rewards
* **Retain** with flexible loyalty programs
* **Win back** with smart reactivation offers
All of this runs on a unified incentive engine that talks to your existing systems: CDPs, CRMs, e-commerce platforms, marketing automation, and more.
## Built for integration and scale
Voucherify is MACH-certified and composable by design. Voucherify's APIs and webhooks let you:
* Trigger incentives in real time from any system
* Validate/redeem in the moment
* Push activity to your data lake or CEP
* Scale with confidence across brands and markets
Voucherify's Rule Engine lets you define eligibility, value, redemption logic, and segmentation rules in one place.
## Choose your tools
You can work with Voucherify via:
* **REST API**: Build fully custom, composable promo workflows.
* **Dashboard**: Launch, manage, and report on promotions without writing code.
Want to dig deeper? Explore [the integration blueprint](/get-started/integration-overview) or jump straight to [the API reference](/api-reference/introduction-api).
### Voucherify SDKs
Want to develop faster? Check Voucherify's SDK suite to integrate even more easily.
## Common problems Voucherify solves
* Promo logic stuck inside monoliths or legacy platforms
* Loyalty systems that take months to launch and update
* Inflexible campaigns tied to fixed offer types
* Misalignment between dev and marketing teams
* Over-discounting or fraud from lack of control
* Manual campaign QA, testing, and approvals
* Poor ROI from generic offers
## Let’s build smarter incentives
Whether you're launching your first coupon or scaling a loyalty system across 20 markets, Voucherify is built to get you there faster.
# API overview
Source: https://docs.voucherify.io/guides/api-overview
Learn how Voucherify’s API works to build, optimize, or maintain your integration
## Choose the right API endpoint
Voucherify hosts API regions in multiple regions. Pick the one closest to your users for lower latency.
Shared region endpoints:
* Europe (default): `https://api.voucherify.io`
* United States: `https://us1.api.voucherify.io`
* Asia (Singapore): `https://as1.api.voucherify.io`
If your company has a dedicated region, use its unique URL. If you're calling the wrong region, you'll receive an error.
[SDKs](/guides/sdks) let you override the default API endpoint. Read Readme of a specific SDK to learn more.
## Understand request processing
Each API request runs in two phases:
* **Synchronous phase** – main response (for example, redemption result).
* **Asynchronous phase** – [background tasks](/analyze/audit-logs#background-tasks) such as:
* Updating segments
* Sending webhooks
* Applying loyalty points
* Triggering distributions
Async operations may complete a few seconds later. Monitor them under **Dashboard** > **Background tasks**.
Examples of long-running jobs:
* Bulk imports or exports (customers, products, vouchers)
* Campaign creation or updates
* Metadata updates
| **Types by Context** | **Endpoint** |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CAMPAIGN** | |
| `CAMPAIGN.VOUCHERS_IMPORT` | **POST** [/campaigns/\{campaignId}/import](/api-reference/campaigns/import-vouchers-to-campaign) |
| `CAMPAIGN.VOUCHERS_IMPORT_CSV` | **POST** [/campaigns/\{campaignId}/importCSV](/api-reference/campaigns/import-vouchers-to-campaign-by-csv) |
| `CAMPAIGN.VOUCHERS_UPDATE` | **PUT** [/campaigns/\{campaignId}](/api-reference/campaigns/update-campaign) |
| `CAMPAIGN.VOUCHERS_DELETE` | **DELETE** [/campaigns/\{campaignId}](/api-reference/campaigns/delete-campaign) |
| `CAMPAIGN.VOUCHERS_GENERATE` | - **POST** [/campaigns](/api-reference/campaigns/create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
- **POST** [/campaigns/\{campaignId}/vouchers](/reference/add-vouchers-to-campaign)> |
| | |
| **CUSTOMERS** | |
| `CUSTOMERS.IMPORT_CSV` | **POST** [/customers/importCSV](/api-reference/customers/import-and-update-customers-using-csv) |
| `CUSTOMERS.BULK_UPDATE` | **POST** [/customers/bulk/async](/api-reference/customers/update-customers-in-bulk) |
| `CUSTOMERS.METADATA_UPDATE` | **POST** [/customers/metadata/async](/api-reference/customers/update-customers-metadata-in-bulk) |
| **PRODUCTS** | |
| `PRODUCTS.BULK_UPDATE` | **POST** [/products/bulk/async](/api-reference/products/update-products-in-bulk) |
| `PRODUCTS.METADATA_UPDATE` | **POST** [/products/metadata/async](/api-reference/products/update-products-metadata-in-bulk) |
| `PRODUCTS.IMPORT_CSV` | **POST** [/products/importCSV](/api-reference/products/import-products-using-csv) |
| `SKUS.IMPORT_CSV` | **POST** [/skus/importCSV](/api-reference/products/import-skus-using-csv) |
| **VOUCHERS** | |
| `VOUCHERS.IMPORT` | **POST** [/vouchers/import](/api-reference/vouchers/import-vouchers) |
| `VOUCHERS.IMPORT_CSV` | **POST** [/vouchers/importCSV](/api-reference/vouchers/import-vouchers-using-csv) |
| `VOUCHERS.BULK_UPDATE` | **POST** [/vouchers/bulk/async](/api-reference/vouchers/update-vouchers-in-bulk) |
| `VOUCHERS.METADATA_UPDATE` | **POST** [/vouchers/metadata/async](/api-reference/vouchers/update-vouchers-metadata-in-bulk) |
| **ORDERS** | |
| `ORDERS.IMPORT` | **POST** [/orders/import](/api-reference/orders/import-orders) |
| **METADATA KEY PURGE** | |
| `CAMPAIGNS.METADATA_KEY_PURGE`, `CUSTOMERS.METADATA_KEY_PURGE`, `PRODUCTS.METADATA_KEY_PURGE`, `VOUCHERS.METADATA_KEY_PURGE`, `ORDERS.METADATA_KEY_PURGE` | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: **Dashboard** > [**Project Settings**](/prepare/metadata#maintenance) |
## Improve performance and efficiency
To keep your integration fast, efficient, and within your budget, follow the following tips.
### Use efficient API flows
Follow the recommended flows for validation, redemption, and campaign management. Avoid unnecessary round-trips.
To learn more about optimized flows, read the [Integration processes](/guides/integration-processes) guide.
### Synchronize data when really needed
You can send [customer](/guides/data-synchronization#upserting-customers), [order](/guides/data-synchronization#order-synchronization), or [product](/guides/data-synchronization#overriding-product-data) data directly in validation or redemption calls. In some cases it's not needed to create them earlier through the API or imports.
### Replace polling with webhooks
Use [webhooks](/api-reference/introduction-to-webhooks) instead of repeated API requests to check your data. Webhooks don’t count toward API call limits and deliver updates in real time.
## Client-side API (browser and mobile)
Use the client-side API only when you must expose live validation in a web or mobile app. For example, you want users check a promo code on checkout.
### SDK and widgets
The [Voucherify JS SDK](https://github.com/voucherifyio/voucherify-js-sdk/) includes methods and components for:
* Validation
* Redemption
* Voucher publication
* Subscription forms
[React widgets](https://github.com/voucherifyio/voucherify-js-sdk/tree/%40voucherify/sdk%402.9.4/packages/react-widget) are available but no longer supported.
### Rate limiting
Client-side calls share a global limit per IP address. If the limit is exceeded, the API returns:
```json theme={null}
{
"code": 429,
"message": "Too many requests hit the API too quickly."
}
```
### Client-side settings
Go to **Dashboard** > **Project Settings** > **Client-side Settings** to configure:
* **Allowed website URLs** – list allowed origins. Use `*` only in development.
* **Danger zone options** – enable with caution to allow the following directly from a client-side API or SDK:
* Redeeming vouchers (risk: users may change request data)
* Publishing vouchers
* Listing vouchers
* Creating customers (risk: it can expose customer metadata creation to the browser)
* Updating voucher expiration (recommended only for controlled test cases)
* Creating loyalty or referral events
Enable these only if you fully understand the security impact.
## Manage API versions
Voucherify releases dated API versions that control the API or webhook behavior, like properties sent in requests and responses. When the API introduces breaking changes, a new dated version is released. However, your project won’t auto-upgrade, so you control when to move.
Check your current version in **Project Setting** > **API Version**.
### Backward-compatible changes
Voucherify may:
* Add new endpoints or properties
* Add optional parameters
* Change property order
* Change the length or format of object IDs or other opaque strings
* Introduce new webhook event types
Your integration should ignore unknown fields and event types.
### Upgrading
1. Review the API changelog
2. Test the new version in a Sandbox project.
3. Click **Upgrade to the latest API version** when ready.
### API changelog
Read the API changelog:
* **v2017-04-05 (deprecated)**:
* Responses from the voucher and campaign listing methods were moved to the new object structure. Methods now render specific properties for a total count and an array of objects.
* Introduced validation for listing parameters: `limit` and `page`. A limit can range between 1 and 100 items.
* `GET voucher/campaign` methods render **validation rules** related to the voucher object (can be inherited from a campaign).
* Created an API method for getting a campaign identified by name.
* **v2017-04-20 (deprecated)**:
* Response from the voucher publish method was moved to the new object structure. Returned voucher details are wrapped by a transaction object describing the publication event:
```json theme={null}
{
"id": "pub_whQzIndYoyZoqiLEKN0s04GK",
"object": "publication",
"created_at": "2017-04-20T13:18:01Z",
"customer_id": "cust_mOjhGypfbqch0v3DpAA9LDXj",
"tracking_id": "janusz",
"channel": "API",
"metadata": {
"test": true
},
"voucher": {}
}
```
* **v2018-08-01**: Introduces a new model for building **Validation Rules**. The extended mechanism provides advanced configuration for promo conditions. Changes affect these API methods:
* `List Promotion Tiers`: replaced an object describing conditions by a list of records describing an association between rule and tier (`validation_rule_assignments`).
* `List Promotion Tiers for campaign`: same as above.
* `Promotion Tier Object`: updated to support new structure.
* `Validation Rule Object`: reorganized to handle advanced rules.
* `Validation Rule Assignment Object`: added to describe relation between rules and linked promotions.
* `Validation Rules`: modified data model.
* **Webhooks v2024-01-01**: In v20231205, a new version of webhooks was introduced. These webhooks are available for distribution and the events listed in **Project settings**.
# API quickstart
Source: https://docs.voucherify.io/guides/api-quickstart
Make your first API call in minutes
## Create account
[Create an account](http://app.voucherify.io/#/signup) to start using Voucherify.
Fill in your details and choose your region. Your region determines where your data is stored. Choose the region closest to your location to reduce latency.
After you sign up, you will receive a verification email. If you don't receive it, [contact Voucherify support](https://www.voucherify.io/contact-support "Voucherify support").
If your organization sells products or services to customers based in the EU, you must adhere to the General Data Protection Regulation (GDPR).
Learn more in the [security and data protection article](/manage/security-and-data-protection "Voucherify, GDPR and CCPA compliance").
## Get your API keys
To use the Voucherify API, you need two credentials:
* **Application ID** (sent as `X-App-Id` header)
* **Application secret key** (sent as `X-App-Token` header)
Add these headers to every API request.
**To find your keys:**
1. Go to **Project settings**.
2. Open the **General** tab.
3. Scroll to the **Application keys** section.
**Key types:**
* **Application keys** – Use these to authorize API requests from your server. You can create multiple keys for different users.
* **Client-side keys** – Use these for public applications like mobile apps and websites.
* **Integration keys** – Use these to connect with other platforms.
**Sandbox API keys are always visible.**
In production projects:
* Primary secret key: visible for 14 days after first generation, or 15 minutes after regeneration
* Secondary secret keys: visible for 15 minutes after generation or regeneration
Save your secret keys immediately and store them securely.
## Make your first API call
Your Sandbox project includes test campaigns and codes you can use right away.
The most common API call is **validation**. This checks if a customer can use a discount code on their order.
**To make your first validation call:**
1. Log in to your Voucherify account (top right corner of this page). This connects your Sandbox API keys to the interactive documentation.
2. Go to [Validate stackable discounts](/api-reference/validations/validate-stackable-discounts).
3. Click **Try it** button.
4. Select your **Region** based on your region:
* `api` – Europe
* `us1.api` – North America
* `as1.api` – Asia
5. The cURL field on the right will already have the Sandbox onboarding validation selected.
6. Click **Send** to send the request.
The response appears above the request. You can modify the request using the interactive documentation.
**Alternative:** Use the [Postman collection](https://www.postman.com/voucherify) to make API calls.
**Next steps:** Explore the [Sandbox project and Demo shop](#-explore-the-sandbox-project) to test campaigns and view API payloads.
## Use the Postman collection
[Postman](https://www.postman.com/) is a tool for testing APIs. The Voucherify Postman collection includes all API endpoints and integration examples.
**To get started:**
1. Go to the [Voucherify Postman collection](https://www.postman.com/voucherify/voucherify-s-public-workspace/overview).
2. Fork the collection to your Postman workspace. For beginners, fork [Voucherify API – Onboarding](https://www.postman.com/voucherify/voucherify-s-public-workspace/collection/iut4une/voucherify-api-onboarding).
3. Add your API credentials in **Environments**.
4. Send your first [validation request](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/m646u4g/onboarding-validation-request).
**Available collections:**
* [Core API endpoints](https://www.postman.com/voucherify/voucherify-s-public-workspace/collection/z8gcn5w/voucherify-api-core-api-endpoints) – All Voucherify endpoints
* [Integration examples](https://www.postman.com/voucherify/voucherify-s-public-workspace/collection/ymwnigh/voucherify-api-integration-examples) – Integration and business scenarios
* [Sandbox onboarding](https://www.postman.com/voucherify/voucherify-s-public-workspace/collection/iut4une/voucherify-api-onboarding) – Learning resources for new users
## Invite team members
**To add users to your team:**
1. Click your name in the lower left corner.
2. Go to **Team Settings**.
3. Select **Team** to invite members and assign [roles](/manage/members-and-roles).
Enterprise clients can use the [Management API](/guides/management-api) to perform account-related activities regarding projects, users, and other settings through the API.
## Explore the Sandbox project
The [Sandbox project](/guides/api-quickstart#explore-the-sandbox-project) helps you learn the Voucherify API through the dashboard. Use it alongside the interactive API reference or Postman collection.
### Audit log
The [Audit log](/analyze/audit-logs) tracks all API activity.
**To view API logs:**
1. Go to **Audit log** in the left sidebar.
2. Click **Add filter**.
3. Select **Channel**.
4. Choose condition `in` and select `API`.
The log shows status, method, URL, log ID, channel, and creation date.
Click any log entry to see request and response bodies, query parameters, and related events.
### Demo shop
The Demo shop shows how Voucherify integrates with customer applications. Use it to test campaigns and monitor API calls during the customer journey.
**To use the Demo shop:**
1. Go to **Marketer hub** in the left sidebar.
2. Click **Demo shop**.
3. Expand the **API calls** bar at the bottom of the screen.
The API calls section shows endpoint details, methods, and JSON payloads. You can copy payloads or view the API documentation for each method.
# Authentication and authorization
Source: https://docs.voucherify.io/guides/authentication
Authorization methods and principles used to access the Voucherify platform HTTP APIs.
## Authorization overview
Voucherify uses two pairs of keys – one for server applications (*back-end*) and one for publicly available client applications (*mobile apps* and *web applications*).
In addition to the keys, you will need to choose suitable [API endpoints](/api-reference/introduction-api).
## Application authentication
To access Voucherify API, the client application needs to pass `Application ID` and `Application Secret Key`. To find your keys, head to the Project Settings and in the General tab scroll down to the Application Keys section. Below that section, you can generate your integration keys and see the client-side keys.
By default, there are two pairs of authentication keys. The first, Application Keys, are meant to authorize your requests to Voucherify API. You can create more Application Keys for each user. The second, Client-Side Keys, are meant for publicly available client applications (mobile apps and web applications).
A generated pair of Application ID and Application Secret Key must be attached to every HTTP request as custom headers: `X-App-Id`, `X-App-Token`.
The primary secret key is visible for 14 days only when it is generated for the first time and for 15 minutes when the token is regenerated. Secondary secret keys are visible for 15 minutes when they are generated for the first time or regenerated.
Write your secret keys down and keep them in a safe place.
**The API keys in the Sandbox Project are never hidden.**
```markdown App Keys theme={null}
X-App-Id: 3XXXXXXa-125l-XXXr-qXXX-3XXXX8092e70
X-App-Token: 4XX1XD-2X3X-XXXX-3X59-8XXXXXXX23y3
```
Most likely, you will not have to send your keys manually. See [SDKs](/guides/sdks) that know how to handle them, so no extra code is needed.
It is essential that you keep your keys secure and not share them with others. Treat it as your application's password to Voucherify.
### Integration keys
Voucherify can be integrated with different platforms, which receive data from Voucherify or which send data to Voucherify.
#### Platforms that send data to Voucherify
To generate keys for integration platforms that send data to Voucherify, head to the Project Settings and in the General tab, scroll down to the Integration Keys section. Select the plus icon on the right to add new keys. Enter the name and select the user role for the integration.
Available integration platforms:
* [Airship](/integrations/airship "Airship Integration")
* [Amplience](/integrations/amplience "Amplience Integration")
* [Bloomreach](/integrations/bloomreach-cms "Bloomreach CMS Integration")
* [Bloomreach Engagement](/integrations/bloomreach-engagement "Bloomreach Engagement Integration")
* [Braze](/integrations/braze-overview "Braze Integration")
* [commercetools](/integrations/commercetools "commercetools integrations")
* [Contentful](/integrations/contentful "Contentful Integration")
* [Iterable](/integrations/iterable "Iterable Integration")
* [MoEngage](/integrations/moengage "MoEngage Integration")
* [mParticle](/integrations/mparticle "mParticle Integration")
* [Segment](/integrations/segment "Segment Integration")
The API keys for the integration platforms are visible for 15 minutes when they are generated for the first time or regenerated.
#### Platforms that receive Voucherify data
To add integration keys from the platforms that receive data from Voucherify, go to the Home section and select the Integrations tab. Select the integration from the list and paste your key. The following platforms are supported:
* [ActiveCampaign](/integrations/activecampaign "ActiveCampaign Integration")
* [Batch](/integrations/batch "Batch Integration")
* [BigCommerce](/integrations/bigcommerce "BigCommerce Integration")
* [Bloomreach Engagement](/integrations/bloomreach-engagement "Bloomreach Engagement Integration")
* [Braze](/integrations/braze-overview "Braze Integration")
* [Intercom](/integrations/intercom "Intercom Integration")
* [Klaviyo](/integrations/klaviyo "Klaviyo Integration")
* [Mailchimp](/integrations/mailchimp "Mailchimp Integration")
* [mParticle](/integrations/mparticle "mParticle Integration")
* [Segment](/integrations/segment "Segment Integration")
* [SendGrid](/integrations/sendgrid "SendGrid Integration")
* [Twilio](/integrations/twilio "Twilio Integration")
## Client-side authentication
The other authentication mechanism uses publishable keys. They are meant to be used by the public (web and mobile) clients to access a subset of the API (labeled with `(client-side)` in the [API reference](/api-reference/client-side/check-eligibility-client-side)).
Remember to whitelist your domain/mobile app origin in the Project settings > Client-side Settings to allow client-side connections.
### Client-side request headers
For client-side HTTP requests, you need to provide the following headers:
```curl Client-side request headers theme={null}
-H "X-Client-Application-Id: YOUR-CLIENT-SIDE-APPLICATION-ID" \
-H "X-Client-Token: YOUR-CLIENT-SIDE-TOKEN" \
-H "Content-Type: application/json" \
-H "origin: yourdomain.com" \
```
Here is an example of a client-side request ([Validate Voucher (client-side)](/api-reference/client-side/validate-stackable-discounts-client-side)) authorized using client-side API keys.
```curl Client-side redemption theme={null}
curl -X GET \
-H "X-Client-Application-Id: YOUR-CLIENT-SIDE-APPLICATION-ID" \
-H "X-Client-Token: YOUR-CLIENT-SIDE-TOKEN" \
-H "Content-Type: application/json" \
-H "origin: yourdomain.com" \
-d '{
"order" : {
"amount" : 20000
}
}' \
"https://api.voucherify.io/client/v1/validate?code=BLCKFRDY"
```
## OAuth 2.0
Voucherify supports also OAuth 2.0 authorization method.
You can use a Voucherify API key to generate OAuth tokens for the authorization of an API client. The tokens can access the whole server-side or client-side API, or you can limit its access to specific parts, like campaigns, vouchers, or validations, by using the `scope` parameter.
The OAuth token inherits all the permissions and IP whitelists of the API key that is used to generate it. The token is valid for 15 minutes.
If the API key that is used to generate the OAuth token is deleted or blocked, you cannot generate new OAuth tokens and the existing ones will stop working after one minute. However, regenerating the API key used to generate an OAuth token does not affect the token.
The OAuth 2.0 is supported with the following endpoints:
* [Generate OAuth token](/api-reference/oauth/generate-oauth-20-token)
* [Introspect OAuth token](/api-reference/oauth/introspect-oauth-20-token)
* [Revoke OAuth token](/api-reference/oauth/revoke-oauth-20-token)
### Use case ideas
You can use Voucherify OAuth 2.0 in the following ways.
For example, you can generate OAuth tokens inside each application with a Voucherify API key and token delivered to them directly. Such an app should monitor the expiration time to create a new token, so that it works without interruptions. Also, you can limit the access of the token to specific parts of the Voucherify API with the `scope` parameter.
Alternatively, you can have a dedicated app or service to generate OAuth tokens with a Voucherify API key and token. This app serves the OAuth tokens to other apps, for example with a limited access as defined with the `scope` parameter. This way, you can restrict the access to the Voucherify API key and token to this service and ensure better security and dedicated log tracking.
By using OAuth 2.0, you can lower the risk of a negative impact on your organization if such token is exposed or leaked, as they:
* can be limited with the `scope` parameter,
* expire in 15 minutes,
* can be revoked at any time.
# Qualification - checking eligibility
Source: https://docs.voucherify.io/guides/checking-eligibility
## Overview
Sometimes you want to show a customer all the coupons they’re eligible for – taking into account their **attributes** as well as the **current content of their cart**.
Voucherify's [Qualifications API](/api-reference/qualifications/check-eligibility) helps recommend applicable promotions and coupons in the given customer and order context with filtering options based on campaign category and hierarchy.
The qualifications API can be applied (among others) for:
* Upsell scenarios - showing customers their available discounts and encouraging them to adjust the cart to qualify for promotions.
* Customer wallet - providing a list of vouchers the customer was assigned/received (in Voucherify's terms, a voucher was **published** to the customer) in the past that can be used for the current cart.
* Strike through price - showing new prices for a list of products after a promotional discount is applied.
* Showing coupons available for given products in a product catalog
## API endpoints
There are two dedicated API Endpoints for checking eligibility:
| **Endpoint** | **Link** |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **POST** `v1/qualifications` | Check eligibility using the [server-side endpoint](/api-reference/qualifications/check-eligibility). |
| **POST** `client/v1/qualifications` | Check eligibility using the [client-side endpoint](/api-reference/client-side/check-eligibility-client-side). |
You can find a description of the qualification object schema in the data model description [here](/api-reference/qualifications/qualification-object).
Qualification has a 5-minute cache for the returned results. If you change your campaign settings or validation rules, the changes will apply to qualification results after the cache refreshes.
## Scenarios
To specify the types of promotions and codes that you want to reveal to your customers, you can include a scenario. A scenario defines the type of content to return from all the available campaigns and standalone codes that you created in Voucherify.
| **Scenario** | **Possible Use Case** |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ALL | Returns all redeemables available for the customer in one API request. |
| CUSTOMER\_WALLET | returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile. |
| AUDIENCE\_ONLY | Returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only. |
| PRODUCTS | Returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule). |
| PRODUCTS\_DISCOUNT | Returns all promotions available for products when a discount is defined as applicable to specific item(s). |
| PROMOTION\_STACKS | Returns the applicable promotion stacks. |
| PRODUCTS\_BY\_CUSTOMER | Returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule). |
| PRODUCTS\_DISCOUNT\_BY\_CUSTOMER | Returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s). |
In the request, you can add [options](/api-reference/qualifications/check-eligibility) to configure the parameters returned in the response, e.g. filters for types of redeemables or sorting rules like `BEST_DEAL` or `LEAST_DEAL`.
## Use cases
The following scenarios show a couple of use cases that are possible with the qualifications API. Depending on the scenario, you send a slightly different API call and the results are returned in the context of the scenario.
### Customer profile
The customer is assigned 2 vouchers.
| **Campaign** | **Details** |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Gift card campaign | The gift voucher maIxGd5r can be used by the owner of the code only |
| Discount campaigncamp\_f78wOLL9cE2WCSdtliT0UIh0 | Voucher code vm3HkNF2 from a 10% discount for BOSCH products redeemable by the owners of the code. |
### Promotions
The use case assumes there are also two promotions available.
1. 10% for everyone on entire order
2. 20% for Digital books for VIP customers.
The following examples send a qualification API call with several different settings and explain the results.
***
### Case 1 - Logged in vs non-logged in customers
* If the customer is not logged in, the customer will see only one promotion - the 10% for everyone. | `"scenario": "ALL"`
* If they are logged in, they will see two promotion tiers and all the vouchers they have on their hand. | `"scenario": "ALL"`
#### Not logged in
Since the customer cannot be identified, the API does not return redeemables that are out of scope, i.e. that are dependent on the customer profile.
```json Request theme={null}
{
"scenario": "ALL",
"order": {
"items": [
{
"source_id": "bosch_product_1",
"quantity": "1",
"price": 10000,
"related_object": "product",
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"source_id": "digital_book",
"quantity": "1",
"price": 1500,
"related_object": "product",
"product": {
"name": "Digital Book"
}
}
]
},
"options": {
"expand": [
"redeemable"
]
}
}
```
```json Response theme={null}
{
"redeemables": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "promo_mIVcCKyEOu47LPDjXn3rTUC1",
"object": "promotion_tier",
"created_at": "2023-09-18T11:52:08.234Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ORDER",
"percent_off": 10,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"discount_amount": 1150,
"total_discount_amount": 1150,
"total_amount": 10350,
"applied_discount_amount": 1150,
"total_applied_discount_amount": 1150,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"name": "10% off",
"banner": "10% off",
"campaign_id": "camp_orPbvjZ9OSmaZzRvj5gjT1kK",
"campaign_name": "Promotion - % off"
}
],
"total": 1,
"has_more": false
},
"order": {
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"price": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"price": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"stacking_rules": {
"redeemables_limit": 30,
"applicable_redeemables_limit": 5
}
}
```
#### Logged in
Once you identify the customer, the Qualifications API can return the promotions that are customer specific and the voucher codes the customer owns and that can be used right now.
This would then return the following:
| **Campaign** | **Details** |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| Gift card campaign | The gift voucher maIxGd5r can be used by the owner of the code only |
| Discount campaign10% discount for BOSCH products | Voucher code vm3HkNF2 from a 10% discount for BOSCH products redeemable by the owners of the code |
| 10% for everyone on entire order | The promotion is available for anyone and gives a 10% discount |
| 20% for Digital books for VIP customers | The promotion is available to customers who are VIP customers and is applicable to digital books only |
```json Request theme={null}
{
"scenario": "ALL",
"customer": {
"source_id": "GUID_123_john_wayne",
"name": "John Wayne",
"metadata": {
"tier": "VIP"
}
},
"order": {
"items": [
{
"source_id": "bosch_product_1",
"quantity": "1",
"price": 10000,
"related_object": "product",
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"source_id": "digital_book",
"quantity": "1",
"price": 1500,
"related_object": "product",
"product": {
"name": "Digital Book"
}
}
]
},
"options": {
"expand": [
"redeemable"
]
}
}
```
```json Response theme={null}
{
"redeemables": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "promo_mIVcCKyEOu47LPDjXn3rTUC1",
"object": "promotion_tier",
"created_at": "2023-09-18T11:52:08.234Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ORDER",
"percent_off": 10,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"discount_amount": 1150,
"total_discount_amount": 1150,
"total_amount": 10350,
"applied_discount_amount": 1150,
"total_applied_discount_amount": 1150,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"name": "10% off",
"banner": "10% off",
"campaign_id": "camp_orPbvjZ9OSmaZzRvj5gjT1kK",
"campaign_name": "Promotion - % off"
},
{
"id": "maIxGd5r",
"object": "voucher",
"created_at": "2023-09-15T13:00:36.391Z",
"result": {
"gift": {
"credits": 2500
}
},
"order": {
"amount": 11500,
"discount_amount": 2500,
"total_discount_amount": 2500,
"total_amount": 9000,
"applied_discount_amount": 2500,
"total_applied_discount_amount": 2500,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"campaign_id": "camp_blYBZY5V5KQ3PuLfzs0DmuX0",
"campaign_name": "Gift Card Campaign Fall 2023"
},
{
"id": "vm3HkNF2",
"object": "voucher",
"created_at": "2023-09-15T12:59:34.860Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 10,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"items_discount_amount": 1000,
"total_discount_amount": 1000,
"total_amount": 10500,
"items_applied_discount_amount": 1000,
"total_applied_discount_amount": 1000,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"discount_amount": 1000,
"applied_discount_amount": 1000,
"price": 10000,
"subtotal_amount": 9000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_kHDQEBDVn8G04oxvgzRf5et9",
"strict": false,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
},
{
"object": "product",
"id": "bosch_product_1",
"source_id": "bosch_product_1",
"strict": true,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
}
],
"total": 2,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"campaign_id": "camp_f78wOLL9cE2WCSdtliT0UIh0",
"campaign_name": "10% discount for BOSCH products"
},
{
"id": "promo_QwH9khhoiNAthPykdnpAcpAi",
"object": "promotion_tier",
"created_at": "2023-09-15T12:48:11.443Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 20,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"items_discount_amount": 300,
"total_discount_amount": 300,
"total_amount": 11200,
"items_applied_discount_amount": 300,
"total_applied_discount_amount": 300,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"discount_amount": 300,
"applied_discount_amount": 300,
"price": 1500,
"subtotal_amount": 1200,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_KM2mzWPu77CFvZX2wWBqVKVp",
"strict": false,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
1
]
},
{
"object": "product",
"id": "digital_book",
"source_id": "digital_book",
"strict": true,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
1
]
}
],
"total": 2,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"name": "20% off Digital books for VIP customers",
"banner": "20% off Digital books for VIP customers",
"campaign_id": "camp_orPbvjZ9OSmaZzRvj5gjT1kK",
"campaign_name": "Promotion - % off"
}
],
"total": 4,
"has_more": false
},
"tracking_id": "track_wBhrnKJfwZMTuOpQ+uItfJXOJ6STUymy",
"order": {
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"price": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"price": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"stacking_rules": {
"redeemables_limit": 30,
"applicable_redeemables_limit": 5
}
}
```
> Case 1 Summary
>
> The qualification request returned all of the possible vouchers and redeemables the customer could use right now. You can use the qualifications API request to enhance the customer experience by:
>
> * Showing the current promotions available for everyone on the home page
> * Showing a different set of promotions available for a specific customer on the home page
> * Present the list of available discounts during the customer's checkout
All of these scenarios require one API request per attempt.
This scenario considered the promotions, voucher codes, and voucher campaigns available for the customer to be used on the current cart. You can experiment with the "Audience Only" scenario that will return all of the discounts based on the customer profile alone, enabling you to create upsell scenarios.
***
### Case 2 - Vouchers assigned to customer
This example sends the same request, but with a different `scenario` setting.
Only the voucher codes assigned to the customer will be returned. `"scenario": "CUSTOMER_WALLET"`
```json Request theme={null}
{
"scenario": "CUSTOMER_WALLET",
"customer": {
"source_id": "GUID_123_john_wayne",
"name": "John Wayne",
"metadata": {
"tier": "VIP"
}
},
"order": {
"items": [
{
"source_id": "bosch_product_1",
"quantity": "1",
"price": 10000,
"related_object": "product",
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"source_id": "digital_book",
"quantity": "1",
"price": 1500,
"related_object": "product",
"product": {
"name": "Digital Book"
}
}
]
},
"options": {
"expand": [
"redeemable"
]
}
}
```
```json Response theme={null}
{
"redeemables": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "maIxGd5r",
"object": "voucher",
"created_at": "2023-09-15T13:00:36.391Z",
"result": {
"gift": {
"credits": 2500
}
},
"order": {
"amount": 11500,
"discount_amount": 2500,
"total_discount_amount": 2500,
"total_amount": 9000,
"applied_discount_amount": 2500,
"total_applied_discount_amount": 2500,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"campaign_id": "camp_blYBZY5V5KQ3PuLfzs0DmuX0",
"campaign_name": "Gift Card Campaign Fall 2023"
},
{
"id": "vm3HkNF2",
"object": "voucher",
"created_at": "2023-09-15T12:59:34.860Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 10,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"items_discount_amount": 1000,
"total_discount_amount": 1000,
"total_amount": 10500,
"items_applied_discount_amount": 1000,
"total_applied_discount_amount": 1000,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"discount_amount": 1000,
"applied_discount_amount": 1000,
"price": 10000,
"subtotal_amount": 9000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_kHDQEBDVn8G04oxvgzRf5et9",
"strict": false,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
},
{
"object": "product",
"id": "bosch_product_1",
"source_id": "bosch_product_1",
"strict": true,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
}
],
"total": 2,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"campaign_id": "camp_f78wOLL9cE2WCSdtliT0UIh0",
"campaign_name": "10% discount for BOSCH products"
}
],
"total": 2,
"has_more": false
},
"tracking_id": "track_wBhrnKJfwZMTuOpQ+uItfJXOJ6STUymy",
"order": {
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"price": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"price": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"stacking_rules": {
"redeemables_limit": 30,
"applicable_redeemables_limit": 5
}
}
```
> Case 2 Summary
>
> The customer wallet scenario returned the list of vouchers the customer can use right now. This mechanism enables you to show the customer, at the cart level, all of their vouchers they can use, including the gift vouchers and loyalty cards that can be used as the means of payment, enabling your customers to choose a specific reward for themselves, or allowing you to apply the discounts automatically.
***
### Case 3 - Vouchers applicable to specific products
Only a promotion that is applicable to items in the cart. `"scenario": "PRODUCTS_DISCOUNT"`
```json Request theme={null}
{
"scenario": "PRODUCTS_DISCOUNT",
"customer": {
"source_id": "GUID_123_john_wayne",
"name": "John Wayne",
"metadata": {
"tier": "VIP"
}
},
"order": {
"items": [
{
"source_id": "bosch_product_1",
"quantity": "1",
"price": 10000,
"related_object": "product",
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"source_id": "digital_book",
"quantity": "1",
"price": 1500,
"related_object": "product",
"product": {
"name": "Digital Book"
}
}
]
},
"options": {
"expand": [
"redeemable"
]
}
}
```
```json Response theme={null}
{
"redeemables": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "vm3HkNF2",
"object": "voucher",
"created_at": "2023-09-15T12:59:34.860Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 10,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"items_discount_amount": 1000,
"total_discount_amount": 1000,
"total_amount": 10500,
"items_applied_discount_amount": 1000,
"total_applied_discount_amount": 1000,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"discount_amount": 1000,
"applied_discount_amount": 1000,
"price": 10000,
"subtotal_amount": 9000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_kHDQEBDVn8G04oxvgzRf5et9",
"strict": false,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
},
{
"object": "product",
"id": "bosch_product_1",
"source_id": "bosch_product_1",
"strict": true,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
}
],
"total": 2,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"campaign_id": "camp_f78wOLL9cE2WCSdtliT0UIh0",
"campaign_name": "10% discount for BOSCH products"
},
{
"id": "camp_f78wOLL9cE2WCSdtliT0UIh0",
"object": "campaign",
"created_at": "2023-09-15T12:59:34.307Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 10,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"items_discount_amount": 1000,
"total_discount_amount": 1000,
"total_amount": 10500,
"items_applied_discount_amount": 1000,
"total_applied_discount_amount": 1000,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"discount_amount": 1000,
"applied_discount_amount": 1000,
"price": 10000,
"subtotal_amount": 9000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"price": 1500,
"subtotal_amount": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_kHDQEBDVn8G04oxvgzRf5et9",
"strict": false,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
},
{
"object": "product",
"id": "bosch_product_1",
"source_id": "bosch_product_1",
"strict": true,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
0
]
}
],
"total": 2,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"name": "10% discount for BOSCH products"
},
{
"id": "promo_QwH9khhoiNAthPykdnpAcpAi",
"object": "promotion_tier",
"created_at": "2023-09-15T12:48:11.443Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 20,
"is_dynamic": false
}
},
"order": {
"amount": 11500,
"items_discount_amount": 300,
"total_discount_amount": 300,
"total_amount": 11200,
"items_applied_discount_amount": 300,
"total_applied_discount_amount": 300,
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"amount": 1500,
"discount_amount": 300,
"applied_discount_amount": 300,
"price": 1500,
"subtotal_amount": 1200,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_KM2mzWPu77CFvZX2wWBqVKVp",
"strict": false,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
1
]
},
{
"object": "product",
"id": "digital_book",
"source_id": "digital_book",
"strict": true,
"effect": "APPLY_TO_EVERY",
"order_item_indices": [
1
]
}
],
"total": 2,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"name": "20% off Digital books for VIP customers",
"banner": "20% off Digital books for VIP customers",
"campaign_id": "camp_orPbvjZ9OSmaZzRvj5gjT1kK",
"campaign_name": "Promotion - % off"
}
],
"total": 3,
"has_more": false
},
"tracking_id": "track_wBhrnKJfwZMTuOpQ+uItfJXOJ6STUymy",
"order": {
"items": [
{
"object": "order_item",
"source_id": "bosch_product_1",
"related_object": "product",
"quantity": 1,
"price": 10000,
"product": {
"name": "BOSCH GDR 120-LI Cordless Impact Driver / Wrench"
}
},
{
"object": "order_item",
"source_id": "digital_book",
"related_object": "product",
"quantity": 1,
"price": 1500,
"product": {
"name": "Digital Book"
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"stacking_rules": {
"redeemables_limit": 30,
"applicable_redeemables_limit": 5
}
}
```
> Case 3 Summary
>
> Voucherify will return all the discounts that apply to the products you sent in the order. When a customer is browsing your products and is shown the product listing page, you can send, in the payload, the list of all the products the customer is presented and Voucherify will return all the discounts that apply to these products. The returned results can be visualized, for example, by a striked-through price.
***
### Case 4 - Upselling (audience only)
The upsell scenario displays all the incentives within customer's reach in their cart view and encourages them to purchase additional products. `"scenario": "AUDIENCE_ONLY"`
```json Request theme={null}
{
"scenario": "AUDIENCE_ONLY",
"customer": {
"source_id": "15072024",
"name": "John Toolman",
"email": "[email protected]",
"metadata": {
"subscribed": false
}
},
"order": {
"items": [
{
"quantity": 1,
"price": 10000,
"amount": 10000,
"source_id": "23425235",
"name": "GDR Drill",
"related_object": "product",
"product": {
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "gray"
}
}
},
{
"quantity": 1,
"price": 40000,
"amount": 40000,
"source_id": "327583490",
"name": "GRW Stirring Mech.",
"related_object": "product",
"product": {
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "dark_green"
}
}
}
]
},
"options": {
"limit": 30,
"starting_after": "null",
"sorting_rule": "DEFAULT",
"expand": [
"redeemable",
"validation_rules",
"category"
],
"filters": {
"resource_type": {
"conditions": {
"$is": [
"promotion_tier"
]
}
}
}
}
}
```
```json Response theme={null}
{
"redeemables": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "promo_zEvnqe70cvuC1UZ4Dwpc8HIN",
"object": "promotion_tier",
"created_at": "2024-07-12T13:40:07.596Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 25,
"is_dynamic": false
}
},
"order": {
"amount": 50000,
"total_amount": 50000,
"items": [
{
"object": "order_item",
"source_id": "23425235",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"id": "prod_0efff3875308dc5ab8",
"source_id": "23425235",
"name": "GDR Drill",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "gray"
},
"price": 10000
}
},
{
"object": "order_item",
"source_id": "327583490",
"related_object": "product",
"quantity": 1,
"amount": 40000,
"price": 40000,
"subtotal_amount": 40000,
"product": {
"id": "prod_0efff55b6308dc189f",
"source_id": "327583490",
"name": "GRW Stirring Mech.",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "dark_green"
},
"price": 40000
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "product",
"id": "prod_0efff4bd5b88dc03ee",
"source_id": "23787597244",
"strict": false,
"effect": "APPLY_TO_EVERY",
"aggregated_quantity_limit": 1
}
],
"total": 1,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {
"button_link": "https://www.diytoolkit.com/products/mixing-accessories/bosch",
"button_text": "ADD MIXING ACCESSORIES",
"terms_and_conditions": [
"Discount applies only to BOSCH mixing accessories with the purchase of the BOSCH Stirring Mechanism.",
"Limit one discounted accessory per customer."
]
},
"categories": [],
"name": "Mix it Up with Power",
"banner": "Buy any Bosch stirring mechanisms and get 25% off any Bosch mixing accessories.",
"campaign_id": "camp_BpaPSw3Ij0T0Hd7McHZn5hPF",
"campaign_name": "Upselling",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_kPomkMQRhDGCSnsf",
"rule_id": "val_Znc2zJvKopJm",
"related_object_id": "promo_zEvnqe70cvuC1UZ4Dwpc8HIN",
"related_object_type": "promotion_tier",
"object": "validation_rules_assignment",
"validation_status": "PARTIALLY_VALID",
"validation_omitted_rules": [
"1"
]
}
],
"total": 1
}
},
{
"id": "promo_NNdPNMKlHqBWLEOMD7F29Zbh",
"object": "promotion_tier",
"created_at": "2024-07-12T13:40:07.161Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ORDER",
"percent_off": 15,
"is_dynamic": false
}
},
"order": {
"amount": 50000,
"discount_amount": 7500,
"total_discount_amount": 7500,
"total_amount": 42500,
"applied_discount_amount": 7500,
"total_applied_discount_amount": 7500,
"items": [
{
"object": "order_item",
"source_id": "23425235",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"id": "prod_0efff3875308dc5ab8",
"source_id": "23425235",
"name": "GDR Drill",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "gray"
},
"price": 10000
}
},
{
"object": "order_item",
"source_id": "327583490",
"related_object": "product",
"quantity": 1,
"amount": 40000,
"price": 40000,
"subtotal_amount": 40000,
"product": {
"id": "prod_0efff55b6308dc189f",
"source_id": "327583490",
"name": "GRW Stirring Mech.",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "dark_green"
},
"price": 40000
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {
"button_link": "https://www.diytoolkit.com/products/tools/bosch",
"button_text": "ADD ADDITIONAL BOSCH TOOL",
"terms_and_conditions": [
"Discount applies to the entire purchase.",
"Must buy 3 BOSCH power tools to qualify.",
"Cannot be combined with other coupons or promotions."
]
},
"categories": [
{
"id": "cat_0f00fcef1f89b84497",
"name": "Exclusive",
"hierarchy": 1,
"created_at": "2024-07-04T09:12:22.909Z",
"object": "category",
"stacking_rules_type": "EXCLUSIVE"
}
],
"name": "Complete Your Set",
"banner": "Add 3 Bosch power tools to your cart and save 15% on the entire purchase.",
"campaign_id": "camp_BpaPSw3Ij0T0Hd7McHZn5hPF",
"campaign_name": "Upselling",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_wPUdL0bcM0a6ghsz",
"rule_id": "val_1UieF6chm4ZG",
"related_object_id": "promo_NNdPNMKlHqBWLEOMD7F29Zbh",
"related_object_type": "promotion_tier",
"object": "validation_rules_assignment",
"validation_status": "PARTIALLY_VALID",
"validation_omitted_rules": [
"1"
]
}
],
"total": 1
}
},
{
"id": "promo_efLUWNBKOeKvfMwrDCU6QdKH",
"object": "promotion_tier",
"created_at": "2024-07-12T13:40:06.969Z",
"result": {
"discount": {
"type": "UNIT",
"effect": "ADD_MISSING_ITEMS",
"unit_off": 1,
"unit_type": "prod_0efff23a1648dc2df0",
"product": {
"id": "prod_0efff23a1648dc2df0",
"source_id": "2857934875983543",
"name": "Bosch Rapid Charger"
},
"is_dynamic": false
}
},
"order": {
"amount": 53500,
"initial_amount": 50000,
"items_discount_amount": 3500,
"total_discount_amount": 3500,
"total_amount": 50000,
"items_applied_discount_amount": 3500,
"total_applied_discount_amount": 3500,
"items": [
{
"object": "order_item",
"source_id": "23425235",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"id": "prod_0efff3875308dc5ab8",
"source_id": "23425235",
"name": "GDR Drill",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "gray"
},
"price": 10000
}
},
{
"object": "order_item",
"source_id": "327583490",
"related_object": "product",
"quantity": 1,
"amount": 40000,
"price": 40000,
"subtotal_amount": 40000,
"product": {
"id": "prod_0efff55b6308dc189f",
"source_id": "327583490",
"name": "GRW Stirring Mech.",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "dark_green"
},
"price": 40000
}
},
{
"object": "order_item",
"product_id": "prod_0efff23a1648dc2df0",
"quantity": 1,
"discount_quantity": 1,
"initial_quantity": 0,
"amount": 3500,
"discount_amount": 3500,
"initial_amount": 0,
"applied_discount_amount": 3500,
"applied_discount_quantity": 1,
"applied_quantity": 1,
"applied_quantity_amount": 3500,
"price": 3500,
"subtotal_amount": 0,
"product": {
"id": "prod_0efff23a1648dc2df0",
"source_id": "2857934875983543",
"name": "Bosch Rapid Charger",
"price": 3500
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {
"button_link": "https://www.diytoolkit.com/products/cordless-tool-kits",
"button_text": "ADD CORDLESS TOOL KIT.",
"terms_and_conditions": [
"Free charger with purchase of cordless tool kits only.",
"Limit one free charger per customer."
]
},
"categories": [],
"name": "Stay charged",
"banner": "Buy any cordless tool kit and receive a free rapid charger.",
"campaign_id": "camp_BpaPSw3Ij0T0Hd7McHZn5hPF",
"campaign_name": "Upselling",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_w7NCg6C4f2Hqrlo4",
"rule_id": "val_ZrnfCjDiSvIm",
"related_object_id": "promo_efLUWNBKOeKvfMwrDCU6QdKH",
"related_object_type": "promotion_tier",
"object": "validation_rules_assignment",
"validation_status": "PARTIALLY_VALID",
"validation_omitted_rules": [
"1"
]
}
],
"total": 1
}
},
{
"id": "promo_z0mYFqqnYo8eR8LW7HC2dWTk",
"object": "promotion_tier",
"created_at": "2024-07-12T13:40:06.805Z",
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ITEMS",
"percent_off": 20,
"is_dynamic": false
}
},
"order": {
"amount": 50000,
"total_amount": 50000,
"items": [
{
"object": "order_item",
"source_id": "23425235",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"subtotal_amount": 10000,
"product": {
"id": "prod_0efff3875308dc5ab8",
"source_id": "23425235",
"name": "GDR Drill",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "gray"
},
"price": 10000
}
},
{
"object": "order_item",
"source_id": "327583490",
"related_object": "product",
"quantity": 1,
"amount": 40000,
"price": 40000,
"subtotal_amount": 40000,
"product": {
"id": "prod_0efff55b6308dc189f",
"source_id": "327583490",
"name": "GRW Stirring Mech.",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "dark_green"
},
"price": 40000
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {
"button_link": "https://www.diytoolkit.com/products/stands-and-tables",
"button_text": "ADD BENCH TOOL",
"terms_and_conditions": [
"Discount applies only to tool stands and tables.",
"Cannot be combined with other coupons or promotions."
]
},
"categories": [
{
"id": "cat_0f00fcef1f89b84497",
"name": "Exclusive",
"hierarchy": 1,
"created_at": "2024-07-04T09:12:22.909Z",
"object": "category",
"stacking_rules_type": "EXCLUSIVE"
}
],
"name": "Enhance Your Workshop",
"banner": "Purchase a bench tool and get 20% discount on tool stands and tables.",
"campaign_id": "camp_BpaPSw3Ij0T0Hd7McHZn5hPF",
"campaign_name": "Upselling",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_jGuPwTMgwN2A871D",
"rule_id": "val_S82j82DYDf5H",
"related_object_id": "promo_z0mYFqqnYo8eR8LW7HC2dWTk",
"related_object_type": "promotion_tier",
"object": "validation_rules_assignment",
"validation_status": "PARTIALLY_VALID",
"validation_omitted_rules": [
"1"
]
}
],
"total": 1
}
}
],
"total": 4,
"has_more": false,
},
"tracking_id": "track_6G9+vdeGnx+Zf09lzSq5dw==",
"order": {
"items": [
{
"object": "order_item",
"source_id": "23425235",
"related_object": "product",
"quantity": 1,
"amount": 10000,
"price": 10000,
"product": {
"id": "prod_0efff3875308dc5ab8",
"source_id": "23425235",
"name": "GDR Drill",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "gray"
},
"price": 10000
}
},
{
"object": "order_item",
"source_id": "327583490",
"related_object": "product",
"quantity": 1,
"amount": 40000,
"price": 40000,
"product": {
"id": "prod_0efff55b6308dc189f",
"source_id": "327583490",
"name": "GRW Stirring Mech.",
"metadata": {
"category": "Tools",
"vendor": "Bosch",
"color": "dark_green"
},
"price": 40000
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"stacking_rules": {
"redeemables_limit": 30,
"applicable_redeemables_limit": 5,
"applicable_exclusive_redeemables_limit": 1,
"exclusive_categories": [
"cat_0f00fcef1f89b84497"
],
"joint_categories": [],
"redeemables_application_mode": "ALL",
"redeemables_sorting_rule": "REQUESTED_ORDER"
}
}
```
> Case 4 Summary
>
> Based on the customer order, Voucherify will encourage customers to buy a more expensive version of a product or add extra products from a matching theme adding various incentives. This process focuses on enhancing the customer's purchase to increase the total sale.
### Bundles
With bundles, you can create discount incentives that depend on the content of the customer's cart (`order.items` array in the request). For example, you can create a bundle of two thermal bottles and five products from a product collection that the customer must have in their cart to be eligible for a \$10 discount for a hoodie.
The incentives based on a bundle behave differently depending on the qualification scenario. The incentives are returned depending on how the customer's cart meets bundle requirements:
* `ALL` – the cart must meet the bundle conditions for the incentive to be returned;
* `AUDIENCE_ONLY` – the cart does not have to meet the bundle conditions for the incentive to be returned;
* `CUSTOMER_WALLET` – the cart must meet the bundle conditions;
* `PRODUCTS` – the cart does not have to meet the bundle conditions;
* `PRODUCTS_DISCOUNT` – the incentive is returned if it is a discount that target products and if that discounted product is in the cart; however, the cart does not have to meet the bundle conditions;
* `PROMOTION_STACKS` – the cart must meet the bundle conditions;
* `PRODUCTS_BY_CUSTOMER` – the cart does not have to meet the bundle conditions
* `PRODUCTS_DISCOUNT_BY_CUSTOMER` – the incentive is returned if it is a discount that target products and if that discounted product is in the cart; however, the cart does not have to meet the bundle conditions.
If the bundle conditions are not met, but the incentive is returned nevertheless, the qualification will return the data showing which SKUs, products, or collections are missing and the missing quantity.
In the following example, the bundle conditions are:
* 2 Star Thermal Bottles
* 5 Adventure-brand products
Because the customer's cart (`order.items`) include only 1 Star Thermal Bottle, 1 Adventure T-shirt, and 2 pairs of Adventure Socks, the qualification returns data with `identified` products and their quantities that meet the bundle conditions and what is `missing` in the bundle, namely 1 Star Thermal Bottle and 2 items from the Adventure-brand collection (`"id": "pc_pWu3TzRFhJ99Xak7Z7QlynNa"`).
```json Qualification request theme={null}
{
"customer": {
"source_id": "rdmr01"
},
"order": {
"items": [
{
"product": {
"id": "prod_0fc35dfe978defeb6b",
"name": "Star Thermal Bottle",
"price": 2499,
"metadata": {
"brand": "Star"
}
},
"quantity": 1
},
{
"product": {
"id": "prod_0fc35dfeaa0defeb73",
"name": "Adventure T-shirt",
"price": 1999,
"metadata": {
"brand": "Adventure"
}
},
"quantity": 1
},
{
"product": {
"id": "prod_0fc35dfeabcdefeb80",
"name": "Adventure Socks",
"price": 499,
"metadata": {
"brand": "Adventure"
}
},
"quantity": 2
}
]
},
"options": {
"filters": {
"campaign_type": {
"conditions": {
"$is": [
"DISCOUNT_COUPONS"
]
}
},
"resource_type": {
"conditions": {
"$is": [
"voucher"
]
}
}
},
"expand": [
"redeemable",
"validation_rules"
],
"limit": 1
},
"scenario": "AUDIENCE_ONLY"
}
```
```json Qualification response theme={null}
{
"redeemables": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "BUNDLE-PROD-1c",
"object": "voucher",
"created_at": "2025-03-26T11:00:17.987Z",
"result": {
"discount": {
"type": "AMOUNT",
"effect": "APPLY_TO_ITEMS",
"amount_off": 1000,
"aggregated_amount_limit": 10000,
"is_dynamic": false
},
"bundle": {
"quantity": 0,
"identified": [
{
"id": "prod_0fc35dfe978defeb6b",
"object": "product",
"item_index": 0,
"item_quantity": 1
},
{
"id": "prod_0fc35dfeaa0defeb73",
"object": "product",
"item_index": 1,
"item_quantity": 1
},
{
"id": "prod_0fc35dfeabcdefeb80",
"object": "product",
"item_index": 2,
"item_quantity": 2
}
],
"missing": [
{
"id": "prod_0fc35dfe978defeb6b",
"object": "product",
"item_quantity": 1
},
{
"id": "pc_pWu3TzRFhJ99Xak7Z7QlynNa",
"object": "products_collection",
"item_quantity": 2
}
]
}
},
"order": {
"amount": 5496,
"total_amount": 5496,
"items": [
{
"object": "order_item",
"id": "ordli_10568b16f101e97576",
"quantity": 1,
"initial_quantity": 1,
"amount": 2499,
"initial_amount": 2499,
"price": 2499,
"subtotal_amount": 2499,
"product": {
"id": "prod_0fc35dfe978defeb6b",
"source_id": "star-th-bottle",
"name": "Star Thermal Bottle",
"metadata": {
"brand": "Star"
},
"price": 2499
}
},
{
"object": "order_item",
"id": "ordli_10568b16f101e97577",
"quantity": 1,
"initial_quantity": 1,
"amount": 1999,
"initial_amount": 1999,
"price": 1999,
"subtotal_amount": 1999,
"product": {
"id": "prod_0fc35dfeaa0defeb73",
"source_id": "adv-tshirt",
"name": "Adventure T-shirt",
"metadata": {
"brand": "Adventure"
},
"price": 1999
}
},
{
"object": "order_item",
"id": "ordli_10568b16f101e97578",
"quantity": 2,
"initial_quantity": 2,
"amount": 998,
"initial_amount": 998,
"price": 499,
"subtotal_amount": 998,
"product": {
"id": "prod_0fc35dfeabcdefeb80",
"source_id": "adv-scks",
"name": "Adventure Socks",
"metadata": {
"brand": "Adventure"
},
"price": 499
}
}
],
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [
{
"object": "products_collection",
"id": "pc_nw1xRgXB8cBzDJSrSbdSqJP4",
"strict": false,
"effect": "APPLY_TO_EVERY",
"skip_initially": 0,
"repeat": 1,
"target": "ITEM"
}
],
"total": 1,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"metadata": {},
"campaign_id": "camp_vzuF8JZdh1tdQqw3R6rS63ci",
"campaign_name": "Bundle-Product-Discount",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_e9RsrtXBMCJ5ti1S",
"rule_id": "val_g1rAIcaPuxAd",
"related_object_id": "v_XXSJVTBFFKLPiy585UqtTPiYJMF1bnBW",
"related_object_type": "voucher",
"object": "validation_rules_assignment",
"validation_status": "VALID"
}
],
"total": 1
}
}
],
"total": 1,
"has_more": true,
"more_starting_after": "2025-03-26T11:00:17.987Z"
},
"tracking_id": "track_C7TLT9aBmso=",
"order": {
"items": [
{
"object": "order_item",
"id": "ordli_10568b16f101e97576",
"quantity": 1,
"product": {
"id": "prod_0fc35dfe978defeb6b",
"source_id": "star-th-bottle",
"name": "Star Thermal Bottle",
"metadata": {
"brand": "Star"
},
"price": 2499
}
},
{
"object": "order_item",
"id": "ordli_10568b16f101e97577",
"quantity": 1,
"product": {
"id": "prod_0fc35dfeaa0defeb73",
"source_id": "adv-tshirt",
"name": "Adventure T-shirt",
"metadata": {
"brand": "Adventure"
},
"price": 1999
}
},
{
"object": "order_item",
"id": "ordli_10568b16f101e97578",
"quantity": 2,
"product": {
"id": "prod_0fc35dfeabcdefeb80",
"source_id": "adv-scks",
"name": "Adventure Socks",
"metadata": {
"brand": "Adventure"
},
"price": 499
}
}
],
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"stacking_rules": {
"redeemables_limit": 25,
"applicable_redeemables_limit": 5,
"applicable_exclusive_redeemables_limit": 1,
"exclusive_categories": [],
"joint_categories": [],
"redeemables_application_mode": "PARTIAL",
"redeemables_sorting_rule": "REQUESTED_ORDER",
"redeemables_no_effect_rule": "REDEEM_ANYWAY",
"redeemables_products_application_mode": "STACK",
"redeemables_rollback_order_mode": "WITH_ORDER"
}
}
```
# CSV export with API
Source: https://docs.voucherify.io/guides/csv-export
Voucherify enables programmable export of:
* [vouchers](/api-reference/vouchers/get-voucher),
* [redemptions](/api-reference/redemptions/get-redemption),
* [publications](/api-reference/publications/list-publications),
* [customers](/api-reference/customers/get-customer),
* [order](/api-reference/orders/get-order) and point expirations to a CSV file
## How to export data to CSV
1. Trigger the export with [Create Export](/api-reference/exports/create-export) and store the `id` of [the export object](/api-reference/exports/get-export) you'll get in the response from Voucherify.
2. [Get](/api-reference/exports/get-export) the export's status providing the `id` and take a look at the `status` field from the response. If it's still `SCHEDULED`, this means that the export is still in progress and you should ask later.
3. When the status is finally `DONE`, the `result` will store the URL as in the example below:
```json Response theme={null}
{
"id": "export_lhZvHKphiMESVdIncRKvoaZh",
"object": "export",
"created_at": "2017-02-24T14:03:00.196Z",
"status": "DONE",
"channel": "API",
"exported_object": "voucher",
"parameters": {
"fields": [
"code",
"voucher_type"
],
"filter": {
"categories": {
"conditions": {
"$in": [
"postman"
]
}
}
}
},
"result": {
"url": "https://download.voucherify.io/v1/exports/export_lhZvHKphiMESVdIncRKvoaZh?token=TOKEN"
}
}
```
4. To [download the export file](/api-reference/exports/download-export), use the provided URL together with authentication headers.
## Filters
Voucherify allows you to specify the time frame for the records you want to retrieve. Thanks to this mechanism, it should be easy to implement a pagination mechanism. See the example of a request body:
```json Request theme={null}
{
"exported_object":"redemption",
"parameters":{
"order":"-created_at",
"fields":[
"id",
"object",
"date",
"voucher_code",
"customer_id",
"result"
],
"filters":{
"junction":"and",
"created_at":{
"conditions":{
"$after":[
"2018-05-30T22:00:00.000Z"
],
"$before":[
"2018-06-29T22:00:00.000Z"
]
}
}
}
}
}
```
The export request will result in a single file being generated by the system.
# Data parsing
Source: https://docs.voucherify.io/guides/data-parsing
Learn how to read and use data sent by Voucherify
Voucherify API sends much data in a validation or redemption response but only some of the data is relevant to end-customers, who use your store or services.
* Learn how to read Voucherify API response
* Learn which data are relevant
* Learn which data could be shown to end-customers
You know which data to show to end-customers
## Response analysis
A complete API response for [validation](/api-reference/validations/validate-stackable-discounts) or [redemption](/api-reference/redemptions/redeem-stackable-discounts) includes many objects. In the example below, the response shows, among others, the following objects:
* order – the order placed by the customer
* customer – the customer who placed the order
* voucher – a discount coupon redeemed in the order
* item – an item in the cart
The amount values in the request and response are multiplied by 100 to represent two decimal places, e.g. \$100 is `10000`.
**Unroll a full redemption API request and response for a discount coupon**
```json Request theme={null}
{
"customer": {
"source_id": "test_customer_id_2"
},
"redeemables": [
{
"object": "voucher",
"id": "Discount-Coupon-Adventure"
},
{
"object": "voucher",
"id": "Discount-whole-cart"
}
],
"order": {
"items": [
{
"source_id": "adv-mug",
"related_object": "product",
"price": 1000,
"quantity": 3,
"product": {
"metadata": {
"brand": "Adventure"
}
}
},
{
"source_id": "adv-tshirt",
"related_object": "product",
"price": 2000,
"quantity": 3,
"product": {
"metadata": {
"brand": "Adventure"
}
}
},
{
"source_id": "star-th-bottle",
"related_object": "product",
"price": 2500,
"quantity": 2,
"product": {
"metadata": {
"brand": "Star"
}
}
}
],
"metadata": {}
},
"metadata": {}
}
```
```json Response theme={null}
{
"redemptions": [
{
"id": "r_0e141f80896e43c0d6",
"customer_id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"tracking_id": "track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy",
"date": "2024-01-02T09:43:23.941000Z",
"order": {
"id": "ord_pNW0emWxtkL83evBp7bhYqe7",
"source_id": null,
"amount": 14000,
"items_discount_amount": 4000,
"items_applied_discount_amount": 4000,
"total_discount_amount": 4000,
"total_applied_discount_amount": 4000,
"total_amount": 10000,
"items": [
{
"object": "order_item",
"source_id": "adv-mug",
"related_object": "product",
"quantity": 3,
"amount": 3000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 1000
},
{
"object": "order_item",
"source_id": "adv-tshirt",
"related_object": "product",
"quantity": 3,
"amount": 6000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 2000
},
{
"object": "order_item",
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2,
"amount": 5000,
"price": 2500
}
],
"metadata": {},
"object": "order"
},
"customer": {
"id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"name": "Jane Doe",
"email": "[email protected]",
"source_id": "test_customer_id_2",
"metadata": {
"lang": "en",
"test": true,
"region": "EMEA"
},
"object": "customer"
},
"result": "SUCCESS",
"voucher": {
"id": "v_NhxOlxSaoeK13zf949Q3u0CRQ0ag0L3o",
"code": "Discount-Coupon-Adventure",
"discount": {
"type": "AMOUNT",
"amount_off": 2000,
"aggregated_amount_limit": 5000,
"effect": "APPLY_TO_ITEMS"
},
"type": "DISCOUNT_VOUCHER",
"campaign": "Basic discount-2",
"campaign_id": "camp_BiFtRVJHJ8moAUe75NzspHNO",
"is_referral_code": false,
"created_at": "2023-12-06T15:34:57.264+00:00",
"object": "voucher"
},
"redemption": "r_0e141f8085ee43c0d5",
"metadata": {},
"object": "redemption"
},
{
"id": "r_0e141f80896e43c0d7",
"customer_id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"tracking_id": "track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy",
"date": "2024-01-02T09:43:23.941000Z",
"order": {
"id": "ord_pNW0emWxtkL83evBp7bhYqe7",
"source_id": null,
"amount": 14000,
"discount_amount": 2500,
"applied_discount_amount": 2500,
"items_discount_amount": 4000,
"total_discount_amount": 6500,
"total_applied_discount_amount": 2500,
"total_amount": 7500,
"items": [
{
"object": "order_item",
"source_id": "adv-mug",
"related_object": "product",
"quantity": 3,
"amount": 3000,
"discount_amount": 2000,
"price": 1000
},
{
"object": "order_item",
"source_id": "adv-tshirt",
"related_object": "product",
"quantity": 3,
"amount": 6000,
"discount_amount": 2000,
"price": 2000
},
{
"object": "order_item",
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2,
"amount": 5000,
"price": 2500
}
],
"metadata": {},
"object": "order"
},
"customer": {
"id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"name": "Jane Doe",
"email": "[email protected]",
"source_id": "test_customer_id_2",
"metadata": {
"lang": "en",
"test": true,
"region": "EMEA"
},
"object": "customer"
},
"result": "SUCCESS",
"voucher": {
"id": "v_B6Dp1HuhX7em7zvgkHUElfrGU3UctHei",
"code": "Discount-whole-cart",
"discount": {
"type": "AMOUNT",
"amount_off": 2500,
"effect": "APPLY_TO_ORDER"
},
"type": "DISCOUNT_VOUCHER",
"campaign": "Discount cart",
"campaign_id": "camp_RA6MbSbWRZdycPsllKzRwa38",
"is_referral_code": false,
"created_at": "2023-12-13T14:22:50.862+00:00",
"object": "voucher"
},
"redemption": "r_0e141f8085ee43c0d5",
"metadata": {},
"object": "redemption"
}
],
"parent_redemption": {
"id": "r_0e141f8085ee43c0d5",
"customer_id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"tracking_id": "track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy",
"date": "2024-01-02T09:43:23.941000Z",
"order": {
"id": "ord_pNW0emWxtkL83evBp7bhYqe7",
"source_id": null,
"status": "PAID",
"customer_id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"referrer_id": null,
"amount": 14000,
"discount_amount": 2500,
"applied_discount_amount": 2500,
"items_discount_amount": 4000,
"items_applied_discount_amount": 4000,
"total_discount_amount": 6500,
"total_applied_discount_amount": 6500,
"total_amount": 7500,
"items": [
{
"object": "order_item",
"source_id": "adv-mug",
"related_object": "product",
"quantity": 3,
"amount": 3000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 1000
},
{
"object": "order_item",
"source_id": "adv-tshirt",
"related_object": "product",
"quantity": 3,
"amount": 6000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 2000
},
{
"object": "order_item",
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2,
"amount": 5000,
"price": 2500
}
],
"metadata": {},
"object": "order"
},
"customer": {
"id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"name": "Jane Doe",
"email": "[email protected]",
"source_id": "test_customer_id_2",
"metadata": {
"lang": "en",
"test": true,
"region": "EMEA"
},
"object": "customer"
},
"result": "SUCCESS",
"metadata": {},
"object": "redemption"
},
"order": { // This is the order object to be used as a source of data
"id": "ord_pNW0emWxtkL83evBp7bhYqe7",
"source_id": null,
"created_at": "2024-01-02T09:43:23.862926Z",
"updated_at": null,
"status": "PAID",
"amount": 14000,
"discount_amount": 2500,
"items_discount_amount": 4000,
"total_discount_amount": 6500,
"total_amount": 7500,
"applied_discount_amount": 2500,
"items_applied_discount_amount": 4000,
"total_applied_discount_amount": 6500,
"items": [
{
"object": "order_item",
"source_id": "adv-mug",
"related_object": "product",
"quantity": 3,
"amount": 3000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 1000,
"subtotal_amount": 1000,
"product": {
"id": "prod_0df14b3a6ad8f282a8",
"source_id": "adv-mug",
"name": "Adventure Mug",
"metadata": {
"brand": "Adventure"
}
}
},
{
"object": "order_item",
"source_id": "adv-tshirt",
"related_object": "product",
"quantity": 3,
"amount": 6000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 2000,
"subtotal_amount": 4000,
"product": {
"id": "prod_0df14b684f58f282d4",
"source_id": "adv-tshirt",
"name": "Adventure T-shirt",
"metadata": {
"brand": "Adventure"
}
}
},
{
"object": "order_item",
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2,
"amount": 5000,
"price": 2500,
"subtotal_amount": 5000,
"product": {
"id": "prod_0df14b7e7d8975079d",
"source_id": "star-th-bottle",
"name": "Star Thermal Bottle",
"metadata": {
"brand": "Star"
},
"price": 2500
}
}
],
"metadata": {},
"customer": {
"id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"object": "customer"
},
"customer_id": "cust_1g637SqVZnkdPNdAIZ7Ra879",
"referrer_id": null,
"object": "order",
"redemptions": {
"r_0e141f8085ee43c0d5": {
"date": "2024-01-02T09:43:23.941Z",
"related_object_type": "redemption",
"related_object_id": "r_0e141f8085ee43c0d5",
"stacked": [
"r_0e141f80896e43c0d6",
"r_0e141f80896e43c0d7"
]
}
}
},
"inapplicable_redeemables": [],
"skipped_redeemables": []
}
```
## Data to be shown
Voucherify supports many different use cases. Once the data are mapped correctly, the data can be shown to end-customers in various contexts. The following sections contain snippets of JSON responses from the Voucherify API [redemption](/api-reference/redemptions/redeem-stackable-discounts) endpoint.
### Where to find required data?
The data to be shown is taken from the `order` object in a response. However, the response can have several `order` objects.
The `order` object to be used is in the root of the response. This `order` object shows the final order and it includes all the applied discounts. It is usually located towards the end of the response. See the response example in the [Response analysis](#response-analysis).
The `order` objects within the `redemptions` array show how the order changed when the discounts have been applied one by one. As a result, they can include only some of the applied discounts.
The `order` object used in the examples in the following sections is taken from the `redemptions` object. See the comments in the code below to find suggestions as to which data should be shown to an end-customer.
### Discounts
In the case of discounts, the end-customer can be shown the data as indicated in the code. This example covers any redeemed discount applied to the end-customer, whether it is applied from a discount coupon, cart promotion, gift card, or pay with points.
In this example, two discounts are applied:
* a discount that reduces each item subtotal by \$20 and covers only the products with `"brand": "Adventure"` metadata,
* a discount that reduces the cart's total price by \$25.
A Star thermal bottle is added as a reference item that is not covered by any discount.
```json Response theme={null}
"order": {
"id": "ord_tc4yusJRqAY87ybmvhnPkJ6u",
"source_id": null,
"created_at": "2024-01-01T11:11:11.533Z",
"updated_at": null,
"status": "PAID",
"amount": 14000, // The order amount before applying any discount. This should be shown to the end-customer.
"discount_amount": 2500, // The sum of all discount amounts which are applied to the whole cart only. This should be shown to the end-customer.
"applied_discount_amount": 2500, // The order-level discount applied in this particular request.
"items_discount_amount": 4000, // The sum of all discount amounts which are applied to specific products.
"total_discount_amount": 6500, // The sum of all order-level and all product-specific discounts. This should be shown to the end-customer.
"items_applied_discount_amount": 4000, // The sum up of all product-specific discounts applied in this particular request.
"total_applied_discount_amount": 6500, // The sum of all order-level and all product-specific discounts applied in this particular request.
"total_amount": 7500, // The order amount after applying all the discounts. This should be shown to the end-customer.
"items": [
{
"object": "order_item",
"source_id": "adv-mug",
"related_object": "product",
"quantity": 3, // The quantity of the particular item in the cart. This should be shown to the end-customer.
"amount": 3000, // The total amount of the order item, i.e. price * quantity. This should be shown to the end-customer.
"discount_amount": 2000, // The sum of all item-level discounts applied to this item.
"applied_discount_amount": 2000, // The item-level discount applied by all applicable redeemables. In this case, it is the $20 discount. This should be shown to the end-customer.
"price": 1000, // Unit price of an item. This should be shown to the end-customer.
"subtotal_amount": 1000, // Final order item amount after the applied item-level discount. This should be shown to the end-customer.
"product": {
"id": "prod_0df14b3a6ad8f282a8",
"source_id": "adv-mug",
"name": "Adventure Mug",
"metadata": {
"brand": "Adventure"
}
}
},
{
"object": "order_item", // The comments are the same as in the "adv-mug" item above.
"source_id": "adv-tshirt",
"related_object": "product",
"quantity": 3,
"amount": 6000,
"discount_amount": 2000,
"applied_discount_amount": 2000,
"price": 2000,
"subtotal_amount": 4000,
"product": {
"id": "prod_0df14b684f58f282d4",
"source_id": "adv-tshirt",
"name": "Adventure T-shirt",
"metadata": {
"brand": "Adventure"
}
}
},
{
"object": "order_item", // This order item is not covered by any discount. The response shows details for a typical order item.
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2, // The quantity of the particular item in the cart. This should be shown to the end-customer.
"amount": 5000, // The total amount of the order item, i.e. price * quantity. This should be shown to the end-customer.
"price": 2500, // Unit price of an item. This should be shown to the end-customer.
"subtotal_amount": 5000, // Here, "subtotal_amount" equals "amount" because this product is not covered by the Adventure brand discount.
"product": {
"id": "prod_0df14b7e7d8975079d",
"source_id": "star-th-bottle",
"name": "Star Thermal Bottle",
"metadata": {
"brand": "Star"
}
}
}
],
}
```
The image below shows an example of an order summary for the purchase shown in the response above. The order summary includes the data recommended in the comments.
### Free items
In the case of free item campaigns, there is additional data in the response which also can be shown to the end-customer, as indicated in the code. This example covers any type of campaign in which an item (here, an Adventure mug product) is added to the cart for free, whether it is applied from a voucher, cart promotion, gift card, or otherwise.
In this section, two cases are covered:
* the free item is already in the cart,
* the free item is not in the cart.
#### Free item already in the cart
In this example, the cart includes an Adventure mug and one mug is added for free. A Star thermal bottle is added as a reference item that is not covered by any discount.
Check the request tab for reference.
```json Response theme={null}
"order": {
"id": "ord_OJXfKGdC2pCpKVYm2BsSTgZ0",
"source_id": null,
"created_at": "2024-01-01T11:11:11.576Z",
"updated_at": null,
"status": "PAID",
"amount": 7000, // The order amount before applying any discount, including the free item. This should be shown to the end-customer.
"items_discount_amount": 1000, // The sum of all discount amounts which are applied to specific products. In this case, this is the full price for the free item.
"total_discount_amount": 1000, // The sum of all order-level and all product-specific discounts. In this case, this is this the full price for the free item. This should be shown to the end-customer.
"total_amount": 6000, // The order amount after applying all the discounts. This should be shown to the end-customer.
"items_applied_discount_amount": 1000, // The sum up of all product-specific discounts applied in this particular request.
"total_applied_discount_amount": 1000, // The sum of all order-level and all product-specific discounts applied in this particular request.
"items": [
{
"object": "order_item",
"source_id": "adv-mug",
"related_object": "product",
"quantity": 2, // The quantity of the particular item in the cart. This includes the free item. This should be shown to the end-customer.
"discount_quantity": 1, // Number of dicounted items. In this case, only one free mug is added. This should be shown to the end-customer.
"initial_quantity": 1, // Number of the items which the end-customer placed in the cart. This can be shown to the end-customer.
"amount": 2000, // The total amount of the order item, i.e. price * quantity. This should be shown to the end-customer.
"discount_amount": 1000, // The sum of all item-level discounts applied to this item. This equals the price of the free item.
"initial_amount": 1000, // This is the sum of amounts for the order items which the end-customer added to the cart.
"applied_discount_amount": 1000, // The item-level discount applied by all applicable redeemables. In this case, it equals the price of the free item. This should be shown to the end-customer.
"price": 1000, // Unit price of an item. This should be shown to the end-customer.
"subtotal_amount": 1000, // Final order item amount after the applied item-level discount. In this case, this equals the initial amount as no other discounts are applied. This should be shown to the end-customer.
"product": {
"id": "prod_0df14b3a6ad8f282a8",
"source_id": "adv-mug",
"name": "Adventure Mug",
"metadata": {
"brand": "Adventure"
}
}
},
{
"object": "order_item", // This order item is not covered by any discount. The response shows details for a typical order item.
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2, // The quantity of the particular item in the cart. This should be shown to the end-customer.
"amount": 5000, // The total amount of the order item, i.e. price * quantity. This should be shown to the end-customer.
"price": 2500, // Unit price of an item. This should be shown to the end-customer.
"subtotal_amount": 5000, // Here, "subtotal_amount" equals "amount" because this product is not covered by any discount.
"product": {
"id": "prod_0df14b7e7d8975079d",
"source_id": "star-th-bottle",
"name": "Star Thermal Bottle",
"metadata": {
"brand": "Star"
}
}
}
],
}
```
```json Request theme={null}
{
"customer": {
"source_id": "test_customer_id_2"
},
"redeemables": [ // In this case, the free mug is added with a voucher.
{
"object": "voucher",
"id": "Always-add-mugs"
}
],
"order": { // The end-customer ordered one Adventure mug and two Start thermal bottles.
"items": [
{
"source_id": "adv-mug",
"related_object": "product",
"price": 1000,
"quantity": 1,
"product": {
"metadata": {
"brand": "Adventure"
}
}
},
{
"source_id": "star-th-bottle",
"related_object": "product",
"price": 2500,
"quantity": 2,
"product": {
"metadata": {
"brand": "Star"
}
}
}
],
"metadata": {}
},
"metadata": {}
}
```
The image below shows an example of an order summary for the purchase shown in the response above.
#### Free item not in the cart
In this example, the cart does not include an Adventure mug, so one mug is added for free. A Star thermal bottle is added as a reference item that is not covered by any discount.
Check the request tab for reference.
```json Response theme={null}
"order": {
"id": "ord_nVg612IxXYkTmoFJuk5d1nyZ",
"source_id": null,
"created_at": "2024-01-01T11:11:11.111111Z",
"updated_at": null,
"status": "PAID",
"amount": 5000, // The order amount before applying any discount. This should be shown to the end-customer.
"total_amount": 5000, // The order amount after applying all the discounts. This should be shown to the end-customer.
"items": [
{
"object": "order_item", // This order item is not covered by any discount. The response shows details for a typical order item.
"source_id": "star-th-bottle",
"related_object": "product",
"quantity": 2, // The quantity of the particular item in the cart. This should be shown to the end-customer.
"amount": 5000, // The total amount of the order item, i.e. price * quantity. This should be shown to the end-customer.
"price": 2500, // Unit price of an item. This should be shown to the end-customer.
"subtotal_amount": 5000, // Here, "subtotal_amount" equals "amount" because this product is not covered by any discount.
"product": {
"id": "prod_0df14b7e7d8975079d",
"source_id": "star-th-bottle",
"name": "Star Thermal Bottle",
"metadata": {
"brand": "Star"
},
}
},
{
"object": "order_item", // This is the item added for free.
"product_id": "prod_0df14b3a6ad8f282a8",
"quantity": 1, // The quantity of the particular item in the cart. In this case, it is the quantity of items added for free. This should be shown to the end-customer.
"discount_quantity": 1, // Number of dicounted items. In this case, only one free mug is added. This should be shown to the end-customer.
"initial_quantity": 0, // Number of the items which the end-customer placed in the cart. In this case, it is 0 because the end-customer did not have any mugs in the cart. This can be shown to the end-customer.
"product": {
"id": "prod_0df14b3a6ad8f282a8",
"source_id": "adv-mug",
"name": "Adventure Mug"
}
}
]
}
```
```json Request theme={null}
{
"customer": {
"source_id": "test_customer_id_2"
},
"redeemables": [ // In this case, the free mug is added with a voucher.
{
"object": "voucher",
"id": "Always-add-mugs"
}
],
"order": { // The end-customer ordered only two Start thermal bottles. That is why there is no object for the Adventure mug in the request.
"items": [
{
"source_id": "star-th-bottle",
"related_object": "product",
"price": 2500,
"quantity": 2,
"product": {
"metadata": {
"brand": "Star"
}
}
}
],
"metadata": {}
},
"metadata": {}
}
```
The image below shows an example of an order summary for the purchase shown in the response above.
# Data synchronization
Source: https://docs.voucherify.io/guides/data-synchronization
Learn what kind of data you can synchronize with Voucherify and how you can do this
In Voucherify, you can synchronize the following data:
* [Customers](#customer-synchronization)
* [Products](#product-synchronization)
* [Orders](#order-synchronization)
When you have created your Voucherify account, you can import your existing data and then synchronize it for future use in campaigns.
* Learn why data synchronization is important
* Learn how to synchronize your data through data import and updates
Your data is synchronized with Voucherify.
## Customer synchronization
Voucherify can store and act on collected customer data. The most common customer data operation is to create customer segments based on customer attributes. Customer segments can be used to understand customer behavior, build promotion limits, or trigger automatic incentive delivery.
Voucherify uses the [customer object](/api-reference/customers/customer-activity-object) for [validation](/api-reference/validations/validation-object), [redemption](/api-reference/redemptions/redemption-object), and [distribution](/integrations/distributions-overview) purposes.
You don't need to store customer data in Voucherify before making a validation or redemption request. Voucherify can use the customer data from the request to create a new customer with a unique `id` field.
However, the customer data must exist in Voucherify before a distribution is made. You can also distribute based on customer attributes and send messages to customers in a given segment. If the customer data is not up to date, the distribution messages sent manually can reach the wrong audience.
If your data is to be synchronized based on the `source_id` of the customer, you need to import the `source_id` when the customer is uploaded for the first time. You will not be able to update `source_id` later on.
### Customer synchronization options
#### Upserting customers
If the customer does not exist in Voucherify, they are created automatically in a request that includes the customer object. If the customer exists, their data will be upserted. In this case, the response also includes the `updated_at` object.
The following actions upsert customer data:
* [Order creation](/api-reference/orders/create-order)
* [Stackable discount redemption](/api-reference/redemptions/redeem-stackable-discounts)
* [Stackable discount redemption (client side)](/api-reference/client-side/redeem-stackable-discounts-client-side)
* [Track custom event](/api-reference/events/track-custom-event)
* [Voucher publication](/api-reference/publications/create-publication)
#### Importing customers
You can import your customer database to Voucherify with a CSV file. If you use a CRM system, use its unique ID as a `source_id` field.
Read our [customer import guide](/prepare/customers#csv-import "How to import my customers?") to learn more.
#### Creating and updating customers with the API
If you want to keep your customers database up to date with Voucherify, create a customer in Voucherify every time a new user is added to your database. Use the [create customer](/api-reference/customers/create-customer) API endpoint to create customer data.
To update customer data, use the [update customer](/api-reference/customers/update-customer) API endpoint. The [create customer](/api-reference/customers/create-customer) API endpoint can be also used to update customer data.
#### Synchronizing with connectors
Customer data can be upserted with integrated platforms that support outbound traffic:
* [Bloomreach Engagement](/integrations/bloomreach-engagement "Voucherify-Bloomreach Engagement integration article")
* [Braze](/integrations/braze-overview "Voucherify-Braze integration article")
* [mParticle](/integrations/mparticle "Voucherify-mParticle integration article")
* [Salesforce](/integrations/salesforce "Voucherify-Salesforce integration article")
* [Segment](/integrations/segment "Voucherify-Segment integration article")
### Customer API endpoints
Go to the API reference to see the [customer endpoints](/api-reference/customers/customer-activity-object) that can be used to synchronize customer data.
## Product synchronization
Products can be stored in Voucherify but it is not required. The product validation takes place during the following actions:
* Qualification
* Validation
* Redemption
The product validation is based on the API payload and the data stored in Voucherify's product inventory.
However, if a product does not exist in Voucherify, the validation will use the product data included in the payload. Even if the product does exist in Voucherify, the payload data is used instead of those stored in the system. This method can be used to avoid frequent API calls to keep the product inventory up to date.
Unlike customer data, product data provided in the request payload alone do not create a new product in Voucherify. If you want to store products, create them manually in the dashboard or import them with a CSV file.
Also, even though Voucherify uses the payload data instead of the data stored in the system, the product data is not upserted through requests. Products can be updated through product edit function or by importing a CSV file.
To enable product updates through the payload, use the [override attribute](#overriding-product-data).
The products in Voucherify can be grouped into static or dynamic collections based on their parameters. Collections can be used in validation rules to model product-specific limits and loyalty-earning rules.
### Product synchronization options
#### Importing products
You can [import your product database](/prepare/products#import-products-skus "Import Products and SKUs by CSV") to Voucherify with a CSV file. This method can be also used to update the names of existing products.
#### Creating and updating products with the API
You can create and update your products with the following API endpoints:
* [Create product](/api-reference/products/create-product)
* [Update product](/api-reference/products/update-product)
#### Overriding product data
In a request payload, you can add an attribute `override` with value `true` to the product object.
The `override` attribute is used to enable storing the product data in Voucherify. If the product does not exist, it will be created with a `source_id`. If the product does exist, the provided values for the name, price, and metadata will replace those already stored in Voucherify.
## Order synchronization
Orders are synchronized with Voucherify automatically during redemption. They can be viewed through the [Orders view](/prepare/orders "How can I track customer orders?") in the dashboard.
If you want to synchronize the orders that have not been included in any redemption, you need to use the [import order](#import-orders) method.
### Order synchronization options
#### Create order
The [create order](/api-reference/orders/create-order) endpoint creates an [order object](/api-reference/orders/order-calculated-object) and triggers an order creation event.
The endpoint can be also used to upsert order data if the order `id` or `source_id` are provided.
#### Update order
The [update order](/api-reference/orders/update-order) endpoint updates the specified order with the values of the parameters in the payload.
#### Import orders
The [import orders](/api-reference/orders/import-orders) endpoint is used to import only historical orders into Voucherify. For on-going synchronization, the [create order](/api-reference/orders/create-order) and [update order](/api-reference/orders/update-order) endpoints should be used. Importing orders in bulk does not trigger distributions or earning rules.
# Development checklist
Source: https://docs.voucherify.io/guides/development
Learn what development steps you need to take to integrate with Voucherify
Voucherify offers a REST-based API and a web dashboard to create and manage promotional campaigns. Dedicated endpoints help you deliver personalized incentives to any channel, device, and e-commerce solution while keeping your data in secure and highly available environments. This is achieved with real-time data synchronization with CRM, product inventory, distribution channels, and other customer touchpoints.
## What are the development steps to integrate with Voucherify?
1. **[Authentication](/guides/authentication)**: get API keys to authorize Voucherify API requests.
2. **[Integration processes](/guides/integration-processes)**: learn key Voucherify processes and steps on how your customer's journey works with Voucherify in different use cases.
3. **[Data parsing](/guides/data-parsing)**: learn how to read and use the data returned by Voucherify's endpoints.
4. **[Metadata mapping](/guides/metadata-mapping)**: learn about custom attributes (metadata) and their use in Voucherify.
5. **[Data synchronization](/guides/data-synchronization)**: learn which of your data can be synchronized with Voucherify, when the synchronization is required, and what benefits it brings.
6. **[SDKs](/guides/sdks)** and **[API reference](/api-reference/introduction-api)**: choose your software development kit to integrate faster with Voucherify or use the Voucherify endpoints directly.
7. **Integration and connectors**: connect Voucherify with your CMS, CRM, CDP, CEP, distribution, or other platforms.
8. **[Webhooks](/api-reference/introduction-to-webhooks)**: learn more about using and configuring webhook notifications.
9. **[Limits](/guides/limits)**: learn more about the limits connected with API calls, webhooks, and distributions.
10. **[Fraud prevention mechanism](/optimize/fraud-prevention-best-practices)**: learn about fraud prevention mechanisms available in Voucherify.
11. **[Loyalty v2](/guides/loyalty-v2-overview)** (optional): if you integrate loyalty programs, orient on the `/v2/loyalties` API, then follow [Integrate loyalty v2](/guides/loyalty-v2-integrate).
## What's next?
* Explore the Voucherify [Postman Collection](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/collection/31663208-927de30f-b9ba-4723-a7ad-9984d835d939) to check API requests and responses.
* Join Voucherify [Community Slack](https://community.voucherify.io/) to get help and inspiration.
* Visit [the Voucherify roadmap](https://roadmap.voucherify.io/) to find out what Voucherify developers are currently working on or suggest improvements and vote for features you want to see in the platform.
* Contact [Voucherify support](https://www.voucherify.io/contact-support) if you have any further questions.
# Import legacy codes
Source: https://docs.voucherify.io/guides/import-codes
In Voucherify, you can import legacy coupon codes, for example when you migrate the codes from another tool. After a successful import, the uploaded codes will be recognized as valid and inherit the discount definition from a given campaign.
There are two ways to import codes into Voucherify:
* programmable,
* with the import tool in the Voucherify Dashboard.
## Programmable import through the API
The programmable mode supports both the JSON and CSV payloads. There are four endpoints that handle the import of:
* Generic (standalone) vouchers: [JSON](/api-reference/vouchers/import-vouchers), [CSV](/api-reference/vouchers/import-vouchers-using-csv).
* Vouchers assigned to a given campaign: [JSON](/api-reference/campaigns/import-vouchers-to-campaign), [CSV](/api-reference/campaigns/import-vouchers-to-campaign-by-csv).
You can upload up to 100,000 codes to a campaign, as a campaign can have up to 100,000 codes by default.
Also, the request can include up to **10 MB** of data; this means both JSON data or a CSV file.
Go to [Voucherify Postman workspace](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/) to test the import:
* [Import generic (standalone) vouchers with JSON](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/u2cln3f/import-vouchers?tab=overview)
* [Import generic (standalone) vouchers with CSV](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/z9qk64n/import-vouchers-using-csv)
* [Import vouchers to campaign with JSON](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/dci1n32/import-vouchers-to-campaign)
* [Import vouchers to campaign with CSV](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/2f3d8ef/import-vouchers-to-campaign-by-csv)
## Dashboard import tool mode
You can also import codes as generic codes or into campaigns through [the Voucherify dashboard](/build/discount-code-import).
# Integration processes
Source: https://docs.voucherify.io/guides/integration-processes
Integrate Voucherify with your system and apply different scenarios
## Introduction
To integrate Voucherify into your system, you need to incorporate Voucherify's API requests and handle the information that is returned in response. Voucherify is a promotion engine designed with both marketers and developers in mind, using an API-first approach. This lets you seamlessly exchange data between Voucherify and your system in real time.
Typically, the customer journey unfolds through the following key steps:
* **[Qualification](/api-reference/qualifications/check-eligibility)** – occasionally, you may want your customers see vouchers, promotions, and campaigns they qualify for, based on customer attributes and the current contents of their shopping cart. Voucherify's Qualifications API suggests relevant promotions and coupons within the specific customer and order context and offers filtering options based on campaign category and hierarchy.
* **[Publication](/api-reference/publications/create-publication)** – it involves associating a code with a specific customer. Typically, code distribution occurs through publications to your customers. Once the code is delivered to a customer, it becomes visible in their profile in Voucherify.
* **[Validation](/api-reference/validations/validate-stackable-discounts)** – it verifies the eligibility of the selected discounts and calculates the final price.
* **[Redemption](/api-reference/redemptions/redeem-stackable-discounts)** – it redeems a combination of vouchers, promotion tiers, and promotion stacks.
**The described process applies to any type of discount, regardless of the voucher type or discount effect.**
## Use cases
In this section, you will learn the most commonly used scenarios that involve the API calls mentioned above:
1. [Redeeming voucher codes](#redeeming-voucher-codes),
2. [Checking promotion eligibility during checkout,](#checking-promotion-discount-without-a-code-eligibility-during-checkout)
3. [Publishing a voucher code in a wandering customer scenario,](#publishing-a-voucher-code-in-a-wandering-customer-scenario)
4. [Rewarding customers with points for purchases](#rewarding-customers-with-points-for-purchases).
### Redeeming voucher codes
In this scenario, a customer will redeem voucher codes.
The customer is given voucher codes using different methods. You can use [Voucherify's Distributions](/integrations/distributions-overview) or a standalone voucher that the customer received in many different ways.
Code application can be different depending on the customer experience that you designed. This image shows an example of a customer experience:
**Step 1**: A typical scenario is presented where the customer browses products, adds them to their cart, and proceeds to checkout.
When the customer is shopping and adds products to or removes them from the cart, there is no need to send API requests to Voucherify. API requests are only needed if you want to verify whether a customer qualifies for the discount or to calculate the discount itself.
**Step 2**: Qualifications (optional) – you can choose to get a list of applicable discounts for the customer from Voucherify. If you do not choose this option, the customer has to input the codes by themselves.
The Qualifications request can return just the promotions or a combination of discount codes, campaigns, and promotion tiers according to the "options" from the Qualifications request.
**Step 3**: Apply the coupon codes. If you use the qualification request, you can show the discounts for the customer to choose from or apply some discounts automatically. You can also allow the customer to input code acquired from a different source.
**Step 4**: Validation – a validation request is sent to Voucherify to check whether codes are applicable and appropriate results are returned.
**Step 5**: The calculated discount is displayed to the customer and it is based on the combination of coupon codes validated on the order. The customer is expected to pay for the order.
**Step 6**: Redemption – when the customer pays for the order, Voucherify receives a redemption request and consumes the discount coupons.
The validation and redemption requests can validate and redeem a combination of different discount types and redeemables. You can verify with one request how promotion tiers and voucher codes affect the customer's cart.
Take a look at new Voucherify [Postman collection](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/folder/31663208-a4e501ba-0e14-48b7-94c3-b66893e26c5a) that will lead you through the entire process flow of a voucher (coupon code) in Voucherify.
### Checking promotion (discount without a code) eligibility during checkout
In this scenario, promotion eligibility is going to be verified during the checkout step. A customer did not receive any voucher codes beforehand. Instead, all discounts and promotions will be displayed on the checkout screen.
**Step 1**: A typical scenario is presented where the customer browses products, adds them to their cart, and proceeds to checkout.
When the customer is shopping and adds products to or removes them from the cart, there is no need to send API requests to Voucherify. API requests are only needed if you want to verify whether a customer qualifies for the discount or to calculate the discount itself.
**Step 2**: Qualifications (mandatory) – lists applicable discounts for the customer from Voucherify.
The Qualifications request can return just the promotions or a combination of discount codes, campaigns, and promotion tiers according to the "options" from the Qualifications request.
**Step 3**: You can decide whether discounts and promotions are applied automatically or let the customer choose themselves.
**Step 4**: Validation – a validation request is sent to Voucherify to check whether promotion tiers are applicable and appropriate results are returned.
**Step 5**: The calculated discount is displayed to the customer and it is based on the combination of promotions validated on the order. The customer is expected to pay for the order.
**Step 6**: Redemption – when the customer pays for the order, Voucherify receives a redemption request and consumes the discount coupons.
The validation and redemption requests can validate and redeem a combination of different discount types and redeemables. You can verify with one request how promotion tiers and voucher codes affect the customer's cart.
Take a look at new Voucherify [Postman collection](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/folder/31663208-d838a14e-5494-4206-b07a-0a667d6535e4) that will lead you through the entire process flow of a voucher and promotion redemption scenario in Voucherify.
### Publishing a voucher code in a wandering customer scenario
In this scenario, a customer is going to receive a voucher code during their visit to the store. The distribution will trigger after the specific action takes place.
**Step 1**: The customer visits the store and adds products to the cart but does not go to checkout for a while.
When the customer is shopping and adds products to or removes them from the cart, there is no need to send API requests to Voucherify. API requests are only needed if you want to verify whether a customer qualifies for the discount or to calculate the discount itself.
**Step 2**: Publication – the publication is triggered to give the customer the coupon code to encourage them to finish the purchase.
This step is triggered on demand.
**Step 3**: The customer uses the discount code that they have just received.
**Step 4**: Validation – a validation request is sent to Voucherify to check whether the code is applicable and appropriate results are returned.
**Step 5**: The effect of the coupon code is displayed to the customer. The customer is expected to pay for the order.
**Step 6**: Redemption – when the customer pays for the order, Voucherify receives a redemption request and consumes the discount coupon.
The validation and redemption requests can validate and redeem a combination of different discount types and redeemables. You can verify with one request how promotion tiers and voucher codes affect the customer's cart.
Take a look at new Voucherify [Postman collection](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/folder/31663208-94f1af65-f69b-4810-899e-8f5eeafa03f8) that will lead you through the entire process flow of a wandering customer scenario in Voucherify.
### Rewarding customers with points for purchases.
In this scenario, a customer will receive points for their purchase. The customer may, but does not have to, use discounts during the purchase. The redemption request will create an order in Voucherify but if the customer does not have any eligible discounts, you have to send an API request to synchronize the new order so that Voucherify can reward the customer with points. Voucherify can inform the customer how many points the customer earned.
**Step 1**: A typical scenario is presented where the customer browses products, adds them to their cart, and proceeds to checkout.
When the customer is shopping and adds products to or removes them from the cart, there is no need to send API requests to Voucherify. API requests are only needed if you want to verify whether a customer qualifies for the discount or to calculate the discount itself.
**Step 2**: The customer can be eligible for a discount.
**Step 3**: This step has two possible outcomes depending on previous choices:
* If the customer uses a discount – the Redemption API is used
* If the customer is not eligible for a discount – the Create order API is used
**Step 4**: The customer is rewarded with points. The points are calculated by Voucherify according to the Earning Rules.
**Step 5**: Optional – the marketing team can decide whether the customer should be informed about the earned points and which [distribution channel](/integrations/distributions-overview#channels) will be used.
**Step 6**: The customer receives a notification.
Take a look at new Voucherify [Postman collection](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/folder/31663208-d4e5ae80-049a-4502-9c6b-57cb5f504c03) that will lead you through the entire process flow of a rewarding customers with points for purchases scenario (loyalty program).
# Limits
Source: https://docs.voucherify.io/guides/limits
API calls limits and optimization
## Accessing the API use summary
Only the account owner can view and manage Team Settings. The account owner (by default) or users with proper access can manage Project Settings. The default Admin role can access Project Settings.
In Team Settings, go to the following tabs:
* Subscription to view a summary of API calls for each of your projects.
* API Usage to view a summary of API calls connected with a specific project.
## API limits
The following API limits apply to Business and Organization plans.
| **Limit** | **Value** |
| -------------------------------------------------------------- | -------------------------------------------- |
| API requests per minute | Business: 100
Organization: 2,000 |
| Total API requests per cycle | Business: 100,000
Organization: 300,000 |
| Client-side requests (e.g., validate) from a single IP address | 5 requests per 5 seconds |
To understand the basic limits of your account, go to Voucherify [Pricing](https://www.voucherify.io/pricing "Voucherify Pricing") and [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy "Voucherify Fair Use Policy").
## Enterprise plan
Users with an Enterprise plan have custom API request limits.
Contact [Voucherify Sales](https://www.voucherify.io/contact-sales) to learn more about the Enterprise plan.
## Notifications
You can receive notifications in your app and through email when you use a certain percentage of your redemptions, API calls, or bulk API calls. The account owner can configure these thresholds and notifications in the API Usage tab in the Project settings.
If you are the account owner, set this up as follows:
1. Click the bell icon in the left sidebar and go to Notifications Center to select Account Settings.
2. Alternatively, in the Team Settings, Subscription tab, click the pencil icon under one of the charts. This will take you directly to the API usage notification settings.
To get email notifications:
1. Go to Notifications Center and Account Settings.
2. Click Show details next to the notifications you want to activate.
3. Turn on the switch next to Email.
4. Set the percentage usage limit that will trigger the notification.
5. Click Add email to specify the email address where you want to receive notifications.
6. Save your settings.
For in-app notifications, toggle the switch next to "In app."
Voucherify sends webhook usage notifications if usage exceeds the hourly limit, even though it counts them in daily periods. As a result, you will be informed in advance about any suspicious user activity.
You cannot exceed the number of API calls (both hourly and monthly) defined in your pricing plan. Exceeding this limit will block your access to the API immediately.
## Buying additional API packages
If you expect to use more API calls than your usual limit, you can [purchase extra packages](/manage/voucherify-account#buy-extra-api-packages "Buying additional API call packages") to raise those limits. This lets you temporarily increase the number of API calls you can make per hour, per minute, or per cycle, providing a boost when needed.
Buying additional API packages will not raise the API call limits for the Sandbox project. The Sandbox project is set to a fixed limit of 100 API calls per hour.
## Webhooks
Webhook calls coming from integrations (third-party webhooks) are counted in separate daily buckets.
The size of the daily bucket is derived from the API request limit.
**Webhooks used per day:**
* Business: 144,000
* Organization: 288,000
Webhook calls are gathered in a queue, so their number per hour can exceed the API hourly limit, and they will still be processed. However, if their number exceeds the daily limit, they will get rejected.
The webhooks sent by Voucherify, which include the webhooks configured in the [Project Settings](/api-reference/introduction-to-webhooks#webhooks-available-in-project-settings) are not covered by any limit. The webhooks sent through [Distributions](/api-reference/introduction-to-webhooks#webhooks-available-in-distributions) are covered by [distribution limits](#distribution-limits).
## Distribution limits
Voucherify allows you to send messages using the Distribution Manager. According to the Voucherify [Anti-Spam](https://www.voucherify.io/legal/anti-spam-policy-v1-1) policy, you have to pass a few checks to unlock the full limits.
### Distribution message limits **without** the anti-spam check
These limits apply to all plans:
* 10 messages per day
* 10 messages per month
* 0 emails from Voucherify
### Distribution message limits **with** the anti-spam check
Limits for trial accounts:
* 10 messages per day.
* 100 messages per month.
All other accounts at the current pricing scheme:
* Unlimited messages.
All other accounts at the older pricing scheme (created before December 2021):
* Limited according to the plan parameters.
## Response headers
Each API response coming from the Voucherify platform has a couple of headers informing about the current status of the API limits.
These headers are:
* `X-Rate-Limit-Limit` - maximum API requests that can be made in a period (an hour or a minute)
* `X-Rate-Limit-Remaining` - number of API requests that can still be made in a current period
* `X-Rate-Limit-Retry` - the time when the next API request can be made, in Unix epoch format (in seconds)
* `Retry-After` - (optional) number of seconds left before the next API request can be made, shown after a limit is reached
* `X-Rate-Limit-Type` - (optional) type of API limit that was reached, possible values: api\_calls / bulk\_api\_calls/ api\_calls\_cycle / webhook\_calls
# Locking validation session
Source: https://docs.voucherify.io/guides/locking-validation-session
Temporarily lock the voucher's usage until redemption is successful.
The validation and redemption mechanisms always work in a transactional way. As a result, the voucher's usage is registered permanently once redemption is successful. By using the session feature, you can temporarily record (lock) the voucher usage after the voucher has been validated.
The established session is released when one of the following events happens:
* Expiration time passes
* Redemption is being registered for the session
* Manual release using a dedicated API endpoint (for vouchers only: [Release Validation Session](/api-reference/vouchers/release-validation-session))
* Manual release using the [Validations Manager in the Dashboard](/optimize/validations-and-redemptions#sessions) to unlock sessions.
Once the session is established, the API returns a unique session key. The key must be used with each of the following validation or redemption requests to clearly identify the session. Multiple requests with the same key will always override existing session values.
By default, the number of available validation sessions is equal to the Code redemption limit set in the campaign manager. For example:
* If the code redemption limit is set to `4`, Voucherify will be able to lock up to four sessions. Next sessions will result in the `quantity_exceeded` error.
* If the code redemption limit is set to `unlimited`, Voucherify will allow any number of sessions.
## How to lock code usage
### Step 1: Validate code with session key
You can establish the locking session while validating the code. Put the `session` object in your request by following the session object reference.
| **Parameter** | **Description** | **Example** |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| session.type`string`**required** | Type of the session. Required to establish a new session.Supported session types are listed in the table at the end of this guide. | "session":\{"type": "LOCK"} |
| session.key`string`**optional** | Unique session identifier. | "session": \{"key": "ssn\_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts","type": "LOCK"} |
| session.ttl\_unit`string`**optional** Default value for session is 7 days | Defines the type of unit for session time. Allowed values: `DAYS`, `HOURS`, `MICROSECONDS`, `MILLISECONDS`, `MINUTES`, `NANOSECONDS`, `SECONDS` | "session": \{"type": "LOCK","ttl": 7,"ttl\_unit": "DAYS"} |
| session.ttl`number`**optional** Default value for session is 7 days | Value for the period of time that the session is active. Units for this parameter are defines by session.ttl\_unit | "session": \{"type": "LOCK","ttl": 7,"ttl\_unit": "DAYS"} |
To link a request with the given session, always use the same session key for session-related validation and redemption requests. You can use your own session key or the system will generate one for you once the session option is enabled with the request.
#### Example validation request
```json Validation request theme={null}
{
"customer": {
"source_id": "[email protected]"
},
"options": {
"include_orders": true,
"extended_redemptions": false
},
"redeemables": [
{
"object": "voucher",
"id": "dBj56oqJ",
"gift": {
"credits": 100
}
},
{
"object": "voucher",
"id": "39vnjyS8"
},
{
"object": "promotion_tier",
"id": "promo_wtS1aPOs3k2majiBJv3yfbSM"
}
],
"order": {
"amount": 200000
},
"session": {
"type": "LOCK"
}
}
```
```json Response theme={null}
{
"valid": true,
"redeemables": [
{
"status": "APPLICABLE",
"id": "wTzxDoOk",
"object": "voucher",
"order": {
"amount": 200000,
"discount_amount": 40000,
"total_discount_amount": 40000,
"total_amount": 160000,
"applied_discount_amount": 40000,
"total_applied_discount_amount": 40000,
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"result": {
"discount": {
"type": "PERCENT",
"effect": "APPLY_TO_ORDER",
"percent_off": 20
}
}
}
],
"order": {
"amount": 200000,
"discount_amount": 40000,
"total_discount_amount": 40000,
"total_amount": 160000,
"applied_discount_amount": 40000,
"total_applied_discount_amount": 40000,
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"tracking_id": "track_e6YkMFU+7zj7ra2btFgSm1T9pRSZw/LawvdybWhgdmY=",
"session": {
"key": "ssn_jSzpiExs0LUPN3NuKFxXsZeKMhUJ01iJ",
"type": "LOCK",
"ttl": 7,
"ttl_unit": "DAYS"
}
}
```
If you do not establish a session time frame by passing the `session.ttl` and `session.ttl_unit`, it will be active for 7 days.
### Step 2: Redeem the code with the session key
Usage of the code is locked and allowed only with the returned session key that identifies the session. Note that multiple requests with the same key will always override existing session values.
When redeeming the code, the session object needs to define `session.type` and `session.key`.
```json Redemption request theme={null}
{
"customer": {
"source_id": "[email protected]"
},
"options": {
"include_orders": true,
"extended_redemptions": false
},
"redeemables": [
{
"object": "voucher",
"id": "wTzxDoOk"
}
],
"order": {
"amount": 200000
},
"session": {
"type": "LOCK",
"key": "ssn_jSzpiExs0LUPN3NuKFxXsZeKMhUJ01iJ"
}
}
```
```json Response theme={null}
{
"redemptions": [
{
"id": "r_ChvVmYqjr8pPHBg5qx0nLycF",
"customer_id": "cust_FRA887OGB6GMJ6zW6U0QibZV",
"tracking_id": "track_e6YkMFU+7zj7ra2btFgSm1T9pRSZw/LawvdybWhgdmY=",
"date": "2022-01-17T08:03:25.029Z",
"order": {
"id": "ord_XGcGm0SnaM97urUv12afKucX",
"source_id": null,
"status": "PAID",
"customer_id": "cust_FRA887OGB6GMJ6zW6U0QibZV",
"referrer_id": null,
"amount": 200000,
"discount_amount": 40000,
"applied_discount_amount": 40000,
"total_discount_amount": 40000,
"total_applied_discount_amount": 40000,
"total_amount": 160000,
"object": "order"
},
"customer": {
"id": "cust_FRA887OGB6GMJ6zW6U0QibZV",
"name": null,
"email": null,
"source_id": "[email protected]",
"object": "customer"
},
"result": "SUCCESS",
"voucher": {
"id": "v_cgZj8kWiKTk12NnEsNN0LILHrUM16due",
"code": "wTzxDoOk",
"discount": {
"type": "PERCENT",
"percent_off": 20,
"effect": "APPLY_TO_ORDER"
},
"type": "DISCOUNT_VOUCHER",
"campaign": "20% off",
"campaign_id": "camp_6IkkrYF2s6Bv8EunjjVT8ETm",
"is_referral_code": false,
"holder_id": "cust_DqubjWlroec0v7te2fVBPcby"
}
}
],
"order": {
"id": "ord_XGcGm0SnaM97urUv12afKucX",
"source_id": null,
"created_at": "2022-01-17T08:03:24.908Z",
"updated_at": null,
"status": "PAID",
"amount": 200000,
"discount_amount": 40000,
"total_discount_amount": 40000,
"total_amount": 160000,
"applied_discount_amount": 40000,
"total_applied_discount_amount": 40000,
"customer": {
"id": "cust_FRA887OGB6GMJ6zW6U0QibZV",
"object": "customer"
},
"customer_id": "cust_FRA887OGB6GMJ6zW6U0QibZV",
"referrer_id": null,
"object": "order",
"redemptions": {
"r_ChvVmYqjr8pPHBg5qx0nLycF": {
"date": "2022-01-17T08:03:25.029Z",
"related_object_type": "voucher",
"related_object_id": "v_cgZj8kWiKTk12NnEsNN0LILHrUM16due",
"related_object_parent_id": "camp_6IkkrYF2s6Bv8EunjjVT8ETm"
}
}
}
}
```
### Step 3: Track redemption
If the redemption request includes a proper `session.key` value, the request is validated and the redemption is executed. When Voucherify registers a new redemption for the locked resource, the session is automatically released.
If you need to remove an established session manually, use the [Release Validation Session](/api-reference/vouchers/release-validation-session) endpoint.
Registering a session will record a temporary usage for the specified time frame. This means it will influence other incoming validation and redemption requests until the session is released.
Once redemption is successful the session is removed automatically.
## Session keys
The following table presents the type of sessions that can be established.
| **Session Type** | **Behaviour** |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| LOCK | Locks the following parameters within the session: - redemption quantity by 1 - redemption gift credits specified with the requests - redemption loyalty points specified with the request |
You can always release established sessions by calling [Release Validation Session](/api-reference/vouchers/release-validation-session) endpoint.
Go to [Voucherify Postman Collection](https://www.postman.com/voucherify/workspace/voucherify-s-public-workspace/folder/31663208-fae2e349-67d4-4d5f-a5aa-1414871197b5), where you can test the Locking Validation Session mechanism.
# Integrate loyalty v2
Source: https://docs.voucherify.io/guides/loyalty-v2-integrate
Learn how to integrate with Voucherify's new loyalty v2 API
To integrate Voucherify's loyalty v2 with your platform, you'll need to complete several steps. You'll have to prepare your customer data, build the loyalty program with required modules, and create the loyalty member journey.
Loyalty v2 has a modular structure, so you can start small and scale your program up as it grows with your members. The modular structure also helps you to optimize your loyalty program with your other incentives, like discount coupons or gift cards.
For a map of the `/v2/loyalties` API surface, core identifiers, and how this guide fits with the rest of the docs, start with the [Loyalty v2 developer overview](/guides/loyalty-v2-overview). For endpoint groups and schemas, see [Loyalty v2: Overview](/api-reference/loyalty-v2-api-overview).
## Preparation
Prepare your Voucherify account for a functional loyalty v2 integration.
Prepare your test environment in Voucherify, for example the Sandbox project.
Use an existing API key/token or create a new pair. Go to **Project settings** > **Application keys** to get `X-App-Id` and `X-App-Token`. Keep these keys on the server side only. See [Authentication](/guides/authentication) and [Security](/guides/security).
Make sure the API key can call loyalty, campaign, voucher, customer, product, and order endpoints used by your integration.
Choose the correct regional API base URL from [API overview](/guides/api-overview#choose-the-right-api-endpoint) (Europe, United States, or Asia).
User guides
Follow [Tutorial – Create basic program](/build/create-loyalty-program) for a step-by-step dashboard setup. Read the [Loyalty v2 overview](/build/loyalty-overview) for the program model and rollout context.
Create the loyalty v2 program by going to **Loyalty hub** > **Programs**.
Design there the program architecture. You can start with a small program for earning and spending points. The required components are the point wallet (card definition) and an earning rule.
Copy your v2 program ID (`lprg_...`). This is required for all member-related API calls.
Set the program status to `ACTIVE`.
Once the program is active, you can experiment with additional earning rules, benefits, and rewards. However, you can't add or edit point wallets or add tier structures.
Your loyalty program members must first exist as customers in Voucherify to have a Voucherify customer ID (`cust_...`).
You can:
* Import your customer base with the [Customer import](/prepare/customers#data-import-and-synchronization) or [POST Import and Update Customers using CSV](/api-reference/customers/import-and-update-customers-using-csv) API endpoint.
* Use a CDP or CRM tool to synchronize your customers with Voucherify.
If you plan to use products as loyalty program rewards, you have to create them in Voucherify first.
You can:
* Import your product database with the [Product import](/prepare/products#bulk-import-with-csv) in the Voucherify dashboard.
* Use the API with [POST Import Products using CSV](/api-reference/products/import-products-using-csv) and [POST Update products in bulk](/api-reference/products/update-products-in-bulk) endpoints.
If you're going to combine the loyalty v2 program with metadata (custom attributes for point wallets, loyalty members, and more) or custom events (for example, to trigger when points are earned), you'll have to create relevant schemas.
Read more about creating [metadata schemas](/prepare/metadata#define-new-metadata-schema) and [custom events](/prepare/custom-events#define-new-custom-event).
## Acquisition
Use the [POST Create member](/api-reference/programs/create-program-member) or [POST Create member in batch](/api-reference/programs/batch-create-program-members) (asynchronous action) with the Voucherify customer ID to add the customer as a member to a loyalty v2 program.
By default, the customer is added as an `ACTIVE` member, who can immediately earn points and fully participate in the loyalty program.
Optionally, you can add the customer as an `INACTIVE` member. An inactive member will have to be activated later with the [POST Activate member](/api-reference/programs/activate-program-member) endpoint to participate in the loyalty program.
```json Basic create member request lines theme={null}
{
"customer_id": "cust_V0uCh3r1fyId"
}
```
```json Create inactive member request lines theme={null}
{
"customer_id": "cust_V0uCh3r1fyId",
"status": "INACTIVE"
}
```
```json Create member in batch request lines theme={null}
[
{
"customer_id": "cust_V0uCh3r1fyId01"
},
{
"customer_id": "cust_V0uCh3r1fyId02"
},
{
"customer_id": "cust_V0uCh3r1fyId03"
}
]
```
The response for creating an individual member will return (see the lines in the example below):
* Loyalty program member ID with a unique member ID (`lmbr_...`) (line 2).
* The loyalty card(s) generated for the member with a unique loyalty card ID (`lcrd_...`) and the card definition (point wallet) ID. If your program uses multiple point wallets, the member will automatically receive a separate card for each card definition (`cards[].card.id` and `cards[].card.card_definition_id` in lines 16, 17, 54, and 55).
The response for creating a batch of new members returns an ID of an asynchronous action. Use the ID in the [GET Get async action](/api-reference/async-actions/get-async-action) endpoint to check the processing status of the action.
Handle loyalty card code latency
Make sure your UI can handle `null` for the `cards[].card.code` property. The `code` property is generated asynchronously after member creation (lines 19 and 57).
In this response example, the loyalty program member receives two loyalty cards for two separate point wallets (card definitions).
```json POST Create member: response example lines highlight={2,16,17,19,54,55,57} expandable theme={null}
{
"id": "lmbr_V0uCh3r1fyId1",
"customer_id": "cust_V0uCh3r1fyId2",
"program_id": "lprg_V0uCh3r1fyId3",
"status": "ACTIVE",
"metadata": {},
"created_at": "2026-06-06T06:06:06.006Z",
"updated_at": null,
"object": "member",
"cards": [
{
"member_role": "OWNER",
"created_at": "2026-06-06T06:06:06.006Z",
"tier_progress": null,
"card": {
"id": "lcrd_V0uCh3r1fyId4",
"card_definition_id": "lcdef_V0uCh3r1fyId5",
"card_type": "INDIVIDUAL",
"code": null,
"lifetime_bucket": {
"points": {
"total": 0,
"earned": 0,
"added": 0,
"subtracted": 0,
"expired": 0,
"spent": 0,
"refunded": 0,
"returned": 0,
"locked": 0,
"unlocked": 0
},
"pending_points": {
"total": 0,
"activated": 0,
"canceled": 0
}
},
"balance": {
"points": 0,
"pending_points": 0
},
"next_expiration": null,
"next_activation": null,
"object": "card"
},
"object": "member_card"
},
{
"member_role": "OWNER",
"created_at": "2026-06-06T06:06:06.006Z",
"tier_progress": null,
"card": {
"id": "lcrd_V0uCh3r1fyId6",
"card_definition_id": "lcdef_V0uCh3r1fyId7",
"card_type": "INDIVIDUAL",
"code": null,
"lifetime_bucket": {
"points": {
"total": 0,
"earned": 0,
"added": 0,
"subtracted": 0,
"expired": 0,
"spent": 0,
"refunded": 0,
"returned": 0,
"locked": 0,
"unlocked": 0
},
"pending_points": {
"total": 0,
"activated": 0,
"canceled": 0
}
},
"balance": {
"points": 0,
"pending_points": 0
},
"next_expiration": null,
"next_activation": null,
"object": "card"
},
"object": "member_card"
}
]
}
```
```json Batch create member: response lines wrap theme={null}
{
"async_action_id": "aa_abc123def456"
}
```
## Discovery
Once you enroll your members, use the following endpoints so the members can learn more about your loyalty program: How they can earn and spend their points.
### Examine earning rules
Use the [POST Examine earning rules](/api-reference/examine/examine-earning-rules) endpoint to estimate how many points a customer will earn in a given scenario. This simulation calculates the precise number of points and material or digital benefits a customer can earn based on specific operational business triggers. Because this evaluation is a dry-run execution, Voucherify calculates these opportunities dynamically without writing transactions to card balances or modifying customer states.
The POST Examine earning rules endpoint is an estimation of points to be earned. It doesn't take into account additional earning rule triggers that may occur. For example, this can happen when a member pays for an order, earns points, and reaches a higher loyalty tier that will trigger additional points.
You can configure the simulation engine using two distinct trigger modes:
* `ALL` mode: Simulates a parallel "what-if" scenario across all active earning rule configurations simultaneously.
* `SPECIFIC` mode: Limits evaluation to one event context, like order paid, segment entered, or custom event.
#### ALL trigger
Use the trigger type `ALL` mode to create "Ways to earn" loyalty portals or customer dashboards. This option displays all available marketing paths to your customer simultaneously.
When you pass the type `ALL`, Voucherify sets the top-level `event` parameter value to `null` (response line 2). Voucherify processes every earning rule active within the customer's program.
The simulation lists all earning rules (in the response example, the `earning_rules` array in lines 9–40) across distinct card definitions (the `memberships[].cards` array in lines 56–128, loyalty cards with names `AnnualTime`, `AutumnTime`, `SummerTime`). The response displays the total number of points to be earned on a card (`points_estimation` in line 65) and for individual earning rules that trigger the earning (`points_estimation` in lines 72 and 80). Voucherify also lists material rewards, such as the "Coffee sample Ethiopia" item, which is a `MATERIAL` benefit type (`benefits[].benefit` in lines 130–136).
Order paid earning rules with proportional calculation
To return an estimation for order paid earning rules which calculate points proportionally, you need to pass the `customer_order_paid` object with required data, like `order.items` array.
```json Trigger: All request lines wrap expandable theme={null}
{
"trigger": {
"type": "ALL"
},
"customer_identification": {
"type": "member_id",
"member_id": "lmbr_128f962dbc8c4ba5dc"
},
"customer_order_paid": {
"order": {
"items": [
{
"quantity": 1,
"price": 1000,
"amount": 1000,
"source_id": "vchrf-trckr-cp",
"name": "Voucherify trucker cap",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "cobalt",
"category": "cap"
}
}
},
{
"quantity": 1,
"price": 15000,
"amount": 15000,
"source_id": "vchrf-tshrt",
"name": "Voucherify T-shirt",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "ultramarine",
"category": "t-shirt"
}
}
},
{
"quantity": 1,
"price": 6500,
"amount": 6500,
"source_id": "vchrf-hd",
"name": "Voucherify hoodie",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "regal crimson",
"category": "hoodie"
}
}
},
{
"quantity": 2,
"price": 1500,
"amount": 3000,
"source_id": "vchrf-vncnt-plsh",
"name": "Voucherify Vincent plushie",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "cobalt",
"category": "plushie"
}
}
}
]
}
},
"customer_segment_entered": {
"customer": {
"metadata": {
"VIP": false
}
}
},
"customer_custom_event": {
"type": "SPECIFIC",
"all": null,
"specific": {
"custom_event": {
"schema_id": "ms_oX8au6DostTnHdWBAVVFnTLP"
}
}
}
}
```
```json Trigger: All response lines wrap expandable highlight={2,9-40,56-128,130-136} theme={null}
{
"event": null,
"customer": {
"id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"source_id": "lx-rdmptr",
"metadata": {},
"object": "customer"
},
"earning_rules": [
{
"id": "lern_128f48ee44cc4bec34",
"name": "EarningRule-OrderPaid",
"metadata": {},
"object": "earning_rule"
},
{
"id": "lern_128f577bd4d47c8e12",
"name": "EnterVipSegment",
"metadata": {},
"object": "earning_rule"
},
{
"id": "lern_128f5822398c4bf78f",
"name": "AutumnPaid",
"metadata": {},
"object": "earning_rule"
},
{
"id": "lern_128f5834b30c4bf7a3",
"name": "SummerPaid",
"metadata": {},
"object": "earning_rule"
},
{
"id": "lern_128f57ec40cc4bf762",
"name": "Autumn Ethiopia",
"metadata": {},
"object": "earning_rule"
}
],
"memberships": [
{
"member": {
"id": "lmbr_128f962dbc8c4ba5dc",
"customer_id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"program_id": "lprg_128f58429f4c4bf7b2",
"metadata": {},
"object": "member"
},
"program": {
"id": "lprg_128f58429f4c4bf7b2",
"name": "AnnualProgram",
"metadata": {},
"object": "program"
},
"cards": [
{
"card": {
"id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"code": "AnnualTime-7M7ShPGfme",
"object": "card"
},
"points_estimation": 25650,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f48ee44cc4bec34",
"object": "earning_rule"
},
"points_estimation": 25500,
"object": "earning_rule_estimation"
},
{
"earning_rule": {
"id": "lern_128f577bd4d47c8e12",
"object": "earning_rule"
},
"points_estimation": 150,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
},
{
"card": {
"id": "lcrd_128f962dbd8c4ba5e0",
"card_definition_id": "lcdef_128f49963c0c4becb7",
"card_type": "INDIVIDUAL",
"code": "AutumnTime-R02hVARx33",
"object": "card"
},
"points_estimation": 10,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f5822398c4bf78f",
"object": "earning_rule"
},
"points_estimation": 10,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
},
{
"card": {
"id": "lcrd_128f962dbd8c4ba5df",
"card_definition_id": "lcdef_128f495f720c4bec8c",
"card_type": "INDIVIDUAL",
"code": "SummerTime-7z8dWawICd",
"object": "card"
},
"points_estimation": 10,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f5834b30c4bf7a3",
"object": "earning_rule"
},
"points_estimation": 10,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
}
],
"benefits": [
{
"benefit": {
"id": "linc_128f4bba81947c8542",
"name": "Coffee sample Ethiopia",
"type": "MATERIAL",
"object": "benefit"
},
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f57ec40cc4bf762",
"object": "earning_rule"
},
"object": "earning_rule_estimation"
}
],
"object": "benefit_estimation"
}
],
"object": "member_earnings_opportunity"
}
],
"object": "earnings_examine_result"
}
```
#### SPECIFIC trigger: Order paid
Use the `SPECIFIC` trigger type `customer.order.paid` inside digital shopping carts to estimate customer point collection right before final billing.
The simulation isolates rules linked directly to `PAID` transaction states. Voucherify processes the order details from your request context, including items, metadata, catalog categories, and amount values.
In the example, Voucherify resolves the `EarningRule-OrderPaid` rule (response example, `earning_rules` array, first object in lines 10–15) and returns an explicit balance projection of 25500 points for the primary `AnnualTime` loyalty card (`memberships[].cards[].points_estimation` in line 53). Also, the response lists earnings for `AutumnPaid` and `SummerPaid` earning rules (`earning_rules` array, objects in lines 16–27) that are used for the `AutumnTime` and `SummerTime` loyalty cards (`memberships[].cards[].points_estimation` in lines 74 and 95). The calculation reflects the current shopping cart properties without adding points to the active card yet.
```json Trigger: Order paid request lines wrap expandable theme={null}
{
"trigger": {
"type": "SPECIFIC",
"specific": {
"event": "customer.order.paid"
}
},
"customer_identification": {
"type": "member_id",
"member_id": "lmbr_128f962dbc8c4ba5dc"
},
"customer_order_paid": {
"order": {
"items": [
{
"quantity": 1,
"price": 1000,
"amount": 1000,
"source_id": "vchrf-trckr-cp",
"name": "Voucherify trucker cap",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "cobalt",
"category": "cap"
}
}
},
{
"quantity": 1,
"price": 15000,
"amount": 15000,
"source_id": "vchrf-tshrt",
"name": "Voucherify T-shirt",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "ultramarine",
"category": "t-shirt"
}
}
},
{
"quantity": 1,
"price": 6500,
"amount": 6500,
"source_id": "vchrf-hd",
"name": "Voucherify hoodie",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "regal crimson",
"category": "hoodie"
}
}
},
{
"quantity": 2,
"price": 1500,
"amount": 3000,
"source_id": "vchrf-vncnt-plsh",
"name": "Voucherify Vincent plushie",
"related_object": "product",
"product": {
"metadata": {
"brand": "Voucherify",
"colour": "cobalt",
"category": "plushie"
}
}
}
]
}
}
}
```
```json Trigger: Order paid response lines wrap expandable highlight={10-27,53,74,95} theme={null}
{
"event": "customer.order.paid",
"customer": {
"id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"source_id": "lx-rdmptr",
"metadata": {},
"object": "customer"
},
"earning_rules": [
{
"id": "lern_128f48ee44cc4bec34",
"name": "EarningRule-OrderPaid",
"metadata": {},
"object": "earning_rule"
},
{
"id": "lern_128f5822398c4bf78f",
"name": "AutumnPaid",
"metadata": {},
"object": "earning_rule"
},
{
"id": "lern_128f5834b30c4bf7a3",
"name": "SummerPaid",
"metadata": {},
"object": "earning_rule"
}
],
"memberships": [
{
"member": {
"id": "lmbr_128f962dbc8c4ba5dc",
"customer_id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"program_id": "lprg_128f58429f4c4bf7b2",
"metadata": {},
"object": "member"
},
"program": {
"id": "lprg_128f58429f4c4bf7b2",
"name": "AnnualProgram",
"metadata": {},
"object": "program"
},
"cards": [
{
"card": {
"id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"code": "AnnualTime-7M7ShPGfme",
"object": "card"
},
"points_estimation": 25500,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f48ee44cc4bec34",
"object": "earning_rule"
},
"points_estimation": 25500,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
},
{
"card": {
"id": "lcrd_128f962dbd8c4ba5e0",
"card_definition_id": "lcdef_128f49963c0c4becb7",
"card_type": "INDIVIDUAL",
"code": "AutumnTime-R02hVARx33",
"object": "card"
},
"points_estimation": 10,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f5822398c4bf78f",
"object": "earning_rule"
},
"points_estimation": 10,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
},
{
"card": {
"id": "lcrd_128f962dbd8c4ba5df",
"card_definition_id": "lcdef_128f495f720c4bec8c",
"card_type": "INDIVIDUAL",
"code": "SummerTime-7z8dWawICd",
"object": "card"
},
"points_estimation": 10,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f5834b30c4bf7a3",
"object": "earning_rule"
},
"points_estimation": 10,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
}
],
"benefits": [],
"object": "member_earnings_opportunity"
}
],
"object": "earnings_examine_result"
}
```
#### SPECIFIC trigger: Customer entered segment
Prerequisite: Customer segment
This scenario requires an earning rule that uses a customer segment as a trigger.
Read the [Customer segments](/prepare/customer-segments) guide to learn more about customer segments.
Use the `SPECIFIC` trigger type `customer.segment.entered` to forecast reward outcomes when a member moves into a high-tier profile segment, like a VIP club. You can display this as an achievable milestone in the member profile.
The evaluation matches metadata configurations in the customer reference object. In this case, passing the metadata key-value pair `"VIP": true` simulates a segment transition (request example, `customer_segment_entered.customer.metadata` in line 15).
Voucherify identifies the `EnterVipSegment` rule schema (response example, the `earning_rules` array, first object in lines 12–17). The response isolates the member's `AnnualTime` loyalty card and lists a milestone award valuation of 150 points (`memberships[].cards[].points_estimation` in line 43). Other purchase-dependent rules are omitted from the calculation automatically.
```json Trigger: Customer entered segment request lines wrap expandable highlight={15} theme={null}
{
"trigger": {
"type": "SPECIFIC",
"specific": {
"event": "customer.segment.entered"
}
},
"customer_identification": {
"type": "member_id",
"member_id": "lmbr_128f962dbc8c4ba5dc"
},
"customer_segment_entered": {
"customer": {
"metadata": {
"VIP": true
}
}
}
}
```
```json Trigger: Customer entered segment response lines wrap expandable highlight={12-17,43} theme={null}
{
"event": "customer.segment.entered",
"customer": {
"id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"source_id": "lx-rdmptr",
"metadata": {
"VIP": true
},
"object": "customer"
},
"earning_rules": [
{
"id": "lern_128f577bd4d47c8e12",
"name": "EnterVipSegment",
"metadata": {},
"object": "earning_rule"
}
],
"memberships": [
{
"member": {
"id": "lmbr_128f962dbc8c4ba5dc",
"customer_id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"program_id": "lprg_128f58429f4c4bf7b2",
"metadata": {},
"object": "member"
},
"program": {
"id": "lprg_128f58429f4c4bf7b2",
"name": "AnnualProgram",
"metadata": {},
"object": "program"
},
"cards": [
{
"card": {
"id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"code": "AnnualTime-7M7ShPGfme",
"object": "card"
},
"points_estimation": 150,
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f577bd4d47c8e12",
"object": "earning_rule"
},
"points_estimation": 150,
"object": "earning_rule_estimation"
}
],
"object": "card_estimation"
}
],
"benefits": [],
"object": "member_earnings_opportunity"
}
],
"object": "earnings_examine_result"
}
```
#### SPECIFIC trigger: Custom event
Prerequisite: Custom event schema
This scenario requires an earning rule that uses a custom event as a trigger.
Read the [Custom events](/prepare/custom-events) guide to learn more about custom events.
Use the `SPECIFIC` trigger type `customer.custom_event` to evaluate custom behaviors outside standard purchase workflows, such as writing product reviews, bringing reusable cups to a coffee shop, or using mobile apps.
The calculation evaluates rules that trigger on unique business schemas rather than order parameters or segment fields. The custom event is passed as a `schema_id` inside the `customer_custom_event` object (request example, `customer_custom_event.specific.custom_event.schema_id` in line 16).
In the example below, the earning rule (response example, the object in the `earning_rules` array, lines 10–15) awards a benefit rather than loyalty points on a card. As a result, the simulation bypasses regular point cards completely, meaning the `cards` array returns empty (line 32). Instead, the response fills the `benefits` array, which shows that once this action is completed, the member will receive the "Coffee sample Ethiopia" product (lines 34–40).
"ALL" type for custom events
In the `customer_custom_event` you can pass `"type": "ALL"` to return a point estimation for all earning rules that are based on custom events. Use this type if your program runs many earnings that trigger when a member performs an action based on a custom event.
```json Trigger: Custom event request lines wrap expandable highlight={16} theme={null}
{
"trigger": {
"type": "SPECIFIC",
"specific": {
"event": "customer.custom_event"
}
},
"customer_identification": {
"type": "member_id",
"member_id": "lmbr_128f962dbc8c4ba5dc"
},
"customer_custom_event": {
"type": "SPECIFIC",
"specific": {
"custom_event": {
"schema_id": "ms_oX8au6DostTnHdWBAVVFnTLP"
}
}
}
}
```
```json Trigger: Custom event response lines wrap expandable highlight={10-15,32,34-40} theme={null}
{
"event": "customer.custom_event",
"customer": {
"id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"source_id": "lx-rdmptr",
"metadata": {},
"object": "customer"
},
"earning_rules": [
{
"id": "lern_128f57ec40cc4bf762",
"name": "Autumn Ethiopia",
"metadata": {},
"object": "earning_rule"
}
],
"memberships": [
{
"member": {
"id": "lmbr_128f962dbc8c4ba5dc",
"customer_id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"program_id": "lprg_128f58429f4c4bf7b2",
"metadata": {},
"object": "member"
},
"program": {
"id": "lprg_128f58429f4c4bf7b2",
"name": "AnnualProgram",
"metadata": {},
"object": "program"
},
"cards": [],
"benefits": [
{
"benefit": {
"id": "linc_128f4bba81947c8542",
"name": "Coffee sample Ethiopia",
"type": "MATERIAL",
"object": "benefit"
},
"earning_rules": [
{
"earning_rule": {
"id": "lern_128f57ec40cc4bf762",
"object": "earning_rule"
},
"object": "earning_rule_estimation"
}
],
"object": "benefit_estimation"
}
],
"object": "member_earnings_opportunity"
}
],
"object": "earnings_examine_result"
}
```
### Examine rewards
Prerequisite: Create and add rewards to point wallets
Created rewards must be added to relevant point wallets to be redeemable by your members. When you add the reward to a point wallet, you also define its price in points.
You can create rewards through the dashboard or the API.
Use the [POST Examine rewards](/api-reference/examine/examine-rewards) endpoint to verify which benefits, digital discount coupons or gift card credits, and material rewards are available to a member across their active loyalty program memberships. This simulation calculates the precise point costs using specific spending rules and evaluates stock availability in real time. Because this evaluation is a dry-run execution, the Voucherify engine processes these opportunities without writing transactions to card balances.
You can use this endpoint in your user interface to build dynamic reward catalogs or member portals that show customers exactly what rewards they can unlock with their current point balance, as well as the specific actions required to unlock restricted rewards.
The Voucherify simulation engine evaluates every reward assignment and classifies the reward under one of two distinct operational states within the `rewards` array. The endpoint returns only active rewards (response example, lines 8–30) and draft rewards are ignored.
#### AVAILABLE status
When a reward returns an `AVAILABLE` status, the loyalty program member meets all eligibility criteria for reward redemption. This status guarantees that:
* The member has an active loyalty card belonging to the required card definition.
* The current point balance on that specific loyalty card is equal to or greater than the resolved point cost.
* The reward assignment has sufficient stock and is currently active.
In the response example below, the loyalty card `AnnualTime-7M7ShPGfme` contains two `AVAILABLE` reward opportunities: the "Free item coupon" (requiring 300 points; the `memberships[].cards[].card.rewards` object lines 91–102) and the "Minas Gerais 500" material reward (requiring 150 points; the `memberships[].cards[].card.rewards` object in lines 103–114).
#### UNAVAILABLE status
When a reward returns an `UNAVAILABLE` status, the member can't redeem it at that moment. To prevent integration guesswork and support frontend user guidance, the Voucherify API provides a structured `unavailability_reasons` array detailing the exact failure point.
The evaluation engine identifies five primary reasons for reward unavailability:
* `insufficient_balance`: The loyalty card balance is lower than the required reward cost. The API returns explicit context in the `details` object showing `required`, `available`, and `missing` point values.
* `out_of_stock`: The reward assignment stock is depleted.
* `no_matching_cost`: No applicable point cost configuration is found or the cost configuration is locked.
* `no_card_for_cost`: The member profile lacks an active card for the required card definition.
* `reward_inactive`: The parent reward object is paused or inactive.
In the response example below, the "Carioca cap" reward on the loyalty card `SummerTime-7z8dWawICd` is marked `UNAVAILABLE` (line 61) due to `insufficient_balance` because the member possesses only 50 points out of the required 250 points (the `memberships[].cards[].card.rewards.unavailability_reasons` object in lines 66–75).
UX best practice
Use the `missing` property inside the `insufficient_balance` details object to calculate and display progress bars or "points needed" callouts directly on your e-commerce checkout page or mobile application.
#### Examine rewards: Example request and response
Check the following request and response payloads to learn how `AVAILABLE` and `UNAVAILABLE` rewards are returned.
```json Examine rewards request lines wrap theme={null}
{
"customer_identification": {
"type": "member_id",
"member_id": "lmbr_128f962dbc8c4ba5dc"
}
}
```
```json Examine rewards response lines wrap highlight={8-30,61,66-75,91-114} expandable theme={null}
{
"customer": {
"id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"source_id": "lx-rdmptr",
"metadata": {},
"object": "customer"
},
"rewards": [
{
"id": "lrew_128f4cefbad47c863e",
"name": "Carioca cap",
"type": "MATERIAL",
"metadata": {},
"object": "reward"
},
{
"id": "lrew_128f4cab04147c8608",
"name": "Free item coupon",
"type": "DIGITAL",
"metadata": {},
"object": "reward"
},
{
"id": "lrew_128f4c6710947c85d1",
"name": "Minas Gerais 500",
"type": "MATERIAL",
"metadata": {},
"object": "reward"
}
],
"memberships": [
{
"member": {
"id": "lmbr_128f962dbc8c4ba5dc",
"customer_id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"program_id": "lprg_128f58429f4c4bf7b2",
"metadata": {},
"object": "member"
},
"program": {
"id": "lprg_128f58429f4c4bf7b2",
"name": "AnnualProgram",
"metadata": {},
"object": "program"
},
"cards": [
{
"card": {
"id": "lcrd_128f962dbd8c4ba5df",
"card_definition_id": "lcdef_128f495f720c4bec8c",
"card_type": "INDIVIDUAL",
"code": "SummerTime-7z8dWawICd",
"object": "card"
},
"rewards": [
{
"reward": {
"id": "lrew_128f4cefbad47c863e",
"object": "reward"
},
"status": "UNAVAILABLE",
"cost": {
"points": 250,
"object": "reward_cost"
},
"unavailability_reasons": [
{
"reason": "insufficient_balance",
"details": {
"required": 250,
"available": 50,
"missing": 200
},
"object": "reward_unavailability_reason"
}
],
"object": "reward_estimation"
}
],
"object": "card_estimation"
},
{
"card": {
"id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"code": "AnnualTime-7M7ShPGfme",
"object": "card"
},
"rewards": [
{
"reward": {
"id": "lrew_128f4cab04147c8608",
"object": "reward"
},
"status": "AVAILABLE",
"cost": {
"points": 300,
"object": "reward_cost"
},
"object": "reward_estimation"
},
{
"reward": {
"id": "lrew_128f4c6710947c85d1",
"object": "reward"
},
"status": "AVAILABLE",
"cost": {
"points": 150,
"object": "reward_cost"
},
"object": "reward_estimation"
}
],
"object": "card_estimation"
}
],
"object": "member_rewards_opportunity"
}
],
"object": "rewards_examine_result"
}
```
## Activity
Your customers need to perform activities to meet earning rules and earn points or other benefits.
### Create order
If your customers earn points or benefits when they finalize transaction in your system (`customer.order.paid` event), Voucherify relies on the condition that the [POST Create order](/api-reference/orders/create-order) request has the `status` field set to `PAID`.
When the Order API processes a payload with `status` set to `PAID` (line 3), the loyalty engine evaluates the line items and order amount to add points or benefits. Submitting orders with other statuses (such as `CREATED` or `FULFILLED`) will fail to activate the earnings.
```json Order paid request payload lines highlight={3} expandable theme={null}
{
"source_id": "coffee_order_77129",
"status": "PAID",
"amount": 3500,
"customer": {
"source_id": "cust_espresso_fan_99",
"email": "customer@coffeeclub.com"
},
"items": [
{
"source_id": "prod_colombian_supremo_1kg",
"related_object": "product",
"quantity": 1,
"price": 3500,
"amount": 3500,
"product": {
"name": "Colombian Supremo Coffee Beans",
"metadata": {
"roast": "medium",
"origin": "Colombia"
}
}
}
]
}
```
### Custom events
If your members earn points or benefits when performing specific custom activities, like subscribing to a newsletter, leaving a review, or unlocking a daily perk, use the [POST Track custom event](/api-reference/events/track-custom-event) endpoint (`/v1/events`).
The request payload must include:
* `customer.id` and/or `customer.source_id` (lines 3 and 4) to link the event to a specific customer in Voucherify database. The customer must be a member in the loyalty program.
* Name of the custom event that triggers the earning rule passed as the value of the `event` property (line 6).
```json Track custom event request payload lines wrap highlight={3,4,6} theme={null}
{
"customer": {
"id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"source_id": "lx-rdmptr"
},
"event": "example_custom_event_name"
}
```
When Voucherify registers the custom event, the earning rule will trigger and issue points or benefit to the member as defined in its earnings.
### Enter segment
Read the [Customer segments](/prepare/customer-segments) article to learn more about customer segments and how to create them.
If your members earn points or benefits when they join a segment of VIP customers, for example, you don't have to send any specific API requests.
The earning rule triggers automatically when Voucherify registers the member has joined the defined dynamic customer segment.
Customer segment suggestions
You can define segments on the basis of various customer properties, like total amount of all orders, birth date, or your own custom attributes (metadata). Here are some ideas for customer segments:
* Customers who haven't placed an order for more than 90 days.
* Customers who have birthday today.
* VIP customers who spent more than \$1000 USD in your store.
* Customers with a defined metadata `"pet_owner": true`.
* Customers who performed an activity "Collect June badge" defined as a custom event less than 5 days ago.
## Retention
Use the following endpoints and data to build a member profile view, which helps retaining your member base and keeps them engaged.
### Get program membership
Use the [GET program membership](/api-reference/programs/get-program-membership) endpoint (GET `/v2/loyalties/programs/{programId}/memberships/{customerId}?identification_type=member_id`) to create a member profile that will show:
* The member's identity and status in the program.
* All loyalty cards the member has in the program.
* Current point balance, pending points, and other life time point data.
* Dates for point expiration and activation.
* Current progress in the tier structure.
The response is a `membership` object that groups three top-level fields:
* `member`: The member's profile in the program (lines 3–10).
* `program`: A summary of the loyalty program the member belongs to (lines 13–17). This is useful when your integration handles several programs and needs to identify the program referred to in the response.
* `cards`: The list of loyalty cards issued to the member (starting at line 19), used to render points and tier progress.
Similar endpoints
The Get membership endpoint works in a similar way to [Get member](/api-reference/programs/get-program-member). Get member returns member details in the context of a loyalty program. It uses only the member ID as the path parameter and it doesn't return `tier_progress` data.
If your program runs loyalty tiers, use the Get membership endpoint.
Check the documentation of these endpoints to learn more about their differences and similarities.
The response example is used in the *Member*, *Points*, and *Tiers* sections below.
```json Get membership response wrap lines expandable highlight={3-10,13-17,19,29-47,50,51,54,55,58-60,115-151} theme={null}
{
"member": {
"id": "lmbr_128f962dbc8c4ba5dc",
"customer_id": "cust_6onRrs4kCnvSVrTs5YtDPFBG",
"program_id": "lprg_128f58429f4c4bf7b2",
"status": "ACTIVE",
"metadata": {},
"created_at": "2026-06-11T15:59:41.298Z",
"updated_at": null,
"object": "member"
},
"program": {
"id": "lprg_128f58429f4c4bf7b2",
"name": "AnnualProgram",
"status": "ACTIVE",
"metadata": {},
"object": "program"
},
"cards": [
{
"member_role": "OWNER",
"created_at": "2026-06-11T15:59:41.303Z",
"card": {
"id": "lcrd_128f962dbd8c4ba5df",
"card_definition_id": "lcdef_128f495f720c4bec8c",
"card_type": "INDIVIDUAL",
"code": "SummerTime-7z8dWawICd",
"lifetime_bucket": {
"points": {
"total": 740,
"earned": 40,
"added": 700,
"purchased": 0,
"purchased_reversed": 0,
"subtracted": 30,
"expired": 300,
"spent": 250,
"refunded": 0,
"returned": 0,
"locked": 250,
"unlocked": 250
},
"pending_points": {
"total": 50,
"activated": 40,
"canceled": 0
}
},
"balance": {
"points": 160,
"pending_points": 10
},
"next_expiration": {
"points": 160,
"date": "2026-08-08"
},
"next_activation": {
"points": 10,
"type": "PERIOD_BASED",
"date": "2026-07-20"
},
"object": "card"
},
"object": "member_card"
},
{
"member_role": "OWNER",
"created_at": "2026-06-11T15:59:41.303Z",
"card": {
"id": "lcrd_128f962dbd8c4ba5e0",
"card_definition_id": "lcdef_128f49963c0c4becb7",
"card_type": "INDIVIDUAL",
"code": "AutumnTime-R02hVARx33",
"lifetime_bucket": {
"points": {
"total": 50,
"earned": 0,
"added": 50,
"purchased": 0,
"purchased_reversed": 0,
"subtracted": 0,
"expired": 0,
"spent": 0,
"refunded": 0,
"returned": 0,
"locked": 0,
"unlocked": 0
},
"pending_points": {
"total": 50,
"activated": 0,
"canceled": 0
}
},
"balance": {
"points": 50,
"pending_points": 50
},
"next_expiration": {
"points": 50,
"date": "2026-12-23"
},
"next_activation": {
"points": 50,
"type": "FIXED_DATES",
"date": "2026-12-23"
},
"object": "card"
},
"object": "member_card"
},
{
"member_role": "OWNER",
"created_at": "2026-06-11T15:59:41.303Z",
"tier_progress": {
"current": {
"id": "lt_128f4b46400c4bedfb",
"name": "Bronze",
"activated_at": "2026-07-13T17:22:22.626Z",
"expires_at": null,
"points": {
"current": 0,
"min": 0,
"max": 99
}
},
"deferred": [],
"tier_structure": {
"id": "lts_128f4b460e4c4bedf6",
"object": "tier_structure"
},
"risks": [],
"opportunities": [
{
"valid_until": null,
"tier_id": "lt_128f4b46558c4bedff",
"points": 100
},
{
"valid_until": null,
"tier_id": "lt_128f4b466a0c4bee03",
"points": 200
},
{
"valid_until": null,
"tier_id": "lt_128f4b46808c4bee07",
"points": 300
}
],
"object": "member_tier_progress"
},
"card": {
"id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"code": "AnnualTime-7M7ShPGfme",
"lifetime_bucket": {
"points": {
"total": 1250,
"earned": 250,
"added": 1000,
"purchased": 0,
"purchased_reversed": 0,
"subtracted": 1000,
"expired": 0,
"spent": 150,
"refunded": 0,
"returned": 0,
"locked": 10,
"unlocked": 10
},
"pending_points": {
"total": 300,
"activated": 250,
"canceled": 0
}
},
"balance": {
"points": 100,
"pending_points": 50
},
"next_expiration": null,
"next_activation": {
"points": 50,
"type": "PERIOD_BASED",
"date": "2026-07-20"
},
"object": "card"
},
"object": "member_card"
}
],
"object": "membership"
}
```
#### Member
The `member` object (lines 2–11 of the response above) holds the profile data you use to identify the member in your system and reflect their status in the program:
* `id`: The loyalty member ID assigned by Voucherify (line 3). Store it alongside your own customer record and pass it back on subsequent calls to this endpoint.
* `customer_id`: Links the member to a Voucherify customer (line 4), which you can use to correlate loyalty activity with the customer profile in your CRM.
* `program_id`: Identifies the loyalty program the member belongs to (line 5). Combined with the top-level `program` object, this lets you support integrations that manage several programs at once.
* `status`: Shows whether the member is `ACTIVE` or `INACTIVE` (line 6). Use it to gate loyalty features in your UI. For example, hide the "Redeem points" action for inactive members.
* `metadata`: Returns any custom attributes you added to the member (line 7), such as an internal loyalty tier from another system or the enrollment channel.
* `created_at` and `updated_at` are timestamps for when the member was created and last modified (lines 8, 9).
#### Points
With the Get membership endpoint you can create a member profile that lists points available to a member. Each of the member's loyalty cards is returned in the `cards` array (starting at line 19). The details regarding points are stored in the following objects (referenced here from the first card, `SummerTime-7z8dWawICd`):
* `lifetime_bucket`: Stores historical details regarding `points` and `pending_points` (lines 29–47). For example, you can use the data to show how many points were `earned`, `spent`, `expired`, and so on.
* `balance`: Stores the details about the current number of available points (`balance.points`) for spending and the current number of `pending_points` (lines 50, 51).
* `next_expiration`: Stores the details about the number of points that are about to expire and the nearest date (lines 54, 55). If you configured point expiration, you can use this data to nudge your members to spend the points before they expire.
* `next_activation`: Stores the details about the date and number of points that are about to be activated from the pending state as well as the type of the activation (lines 58–60).
#### Tiers
If your program runs loyalty tiers, you can also use the Get membership endpoint to return the details about the current tier progress for a given loyalty card.
Use the data from the `tier_progress` object on the relevant card in the `cards` array (lines 115–151 of the response above, on the third card `AnnualTime-7M7ShPGfme`) to build a member profile that will display the active tier, and also risks and opportunities:
* `current`: Returns the loyalty tier the member is currently on, including the tier ID, name, when the member achieved it and the point range (lines 116–126).
* `risks`: Returns data for tier expiration and downgrade (line 132). In this example the array is empty, meaning the member is not scheduled to lose their current tier.
* `opportunities`: Returns the number of points the member must earn to reach higher tiers (lines 133–149).
### List transactions
Use the [GET List transactions](/api-reference/programs/list-card-transactions) endpoint to extend the member profile in your system with details about all point movements on a member's card. If your loyalty program uses several card definitions (point wallets), create a separate transaction list for each card that's governed by a given wallet.
The list card transactions endpoint lists many types (`type`) of transactions to match your business case. The transactions list the date of occurrence (`created_at`), number of points affected (`points` object), and other details. In a simple loyalty program, the key transactions types are:
* `POINTS_SPENT_ON_REWARD`: Points spent to buy a reward. The `details` object lists the number of points and the `reward.id` (lines 11–24)
* `PENDING_POINTS_ACTIVATED`: Points that were in a pending state, but they were activated manually or automatically as set in the card definition configuration (the `details` object in lines 38–47).
* `PENDING_POINTS_ADDED`: Pending points that were added to the loyalty card under the point wallet settings (the `details` object in lines 61–76).
* `POINTS_EXPIRED`: Points that expired under the card definition settings (the `details` object in lines 90–108).
* `POINTS_EARNED`: Points earned and instantly added to the loyalty card (the `details` object in the Point earned example, line 11–24).
```json List card transactions response wrap expandable lines highlight={11-24,38-47,61-76,90-108} theme={null}
{
"data": [
{
"id": "lctx_129748dbafe65ae86d",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"type": "POINTS_SPENT_ON_REWARD",
"details": {
"reason": "Points spent on reward",
"rejection": null,
"metadata": {},
"points": {
"total": 150
},
"reward": {
"id": "lrew_128f4c6710947c85d1"
},
"reward_transaction": {
"id": "lrtx_129748dbafe65ae86e"
}
},
"status": "APPROVED",
"created_at": "2026-06-17T15:29:43.104Z",
"updated_at": "2026-06-17T15:29:45.622Z",
"object": "card_transaction"
},
{
"id": "lctx_128f9a03c6cc4ba8e7",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"type": "PENDING_POINTS_ACTIVATED",
"details": {
"reason": "Manual points activation",
"rejection": null,
"metadata": {},
"points": {
"total": 400,
"date": "2026-06-21",
"type": "PERIOD_BASED"
}
},
"status": "APPROVED",
"created_at": "2026-06-11T16:16:26.907Z",
"updated_at": "2026-06-11T16:16:27.291Z",
"object": "card_transaction"
},
{
"id": "lctx_128f9821be4fd14efd",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_type": "INDIVIDUAL",
"type": "PENDING_POINTS_ADDED",
"details": {
"reason": "AnnualProgram / EarningRule-OrderPaid",
"rejection": null,
"metadata": {
"event_id": "evcus_128f981fced47cbe9b",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"program_id": "lprg_128f58429f4c4bf7b2",
"earning_item_id": "lernei_128f48ee3fcc4bec33",
"earning_rule_id": "lern_128f48ee44cc4bec34"
},
"points": {
"total": 400,
"date": "2026-06-21",
"type": "PERIOD_BASED"
}
},
"status": "APPROVED",
"created_at": "2026-06-11T16:08:13.305Z",
"updated_at": "2026-06-11T16:08:14.170Z",
"object": "card_transaction"
},
{
"id": "lctx_129a515e9aa3f9dd93",
"card_id": "lcrd_128f962dbd8c4ba5df",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_definition_id": "lcdef_128f495f720c4bec8c",
"card_type": "INDIVIDUAL",
"type": "POINTS_EXPIRED",
"details": {
"reason": "Points expired automatically",
"rejection": null,
"metadata": {},
"points": {
"total": 50
},
"date": "2026-06-09",
"buckets": [
{
"id": "lcpeb_1299ec455b625c31e1",
"points": {
"total": 50
},
"expiration_date": "2026-06-09",
"expiration_type": "ROLLING_EXPIRATION"
}
]
},
"status": "APPROVED",
"created_at": "2026-06-10T00:02:20.906Z",
"updated_at": "2026-06-10T00:02:20.975Z",
"object": "card_transaction"
}
],
"cursor": {
"next": "lcrsctx_12989e71c62b6d5baf",
"expires_at": "2026-06-18T16:32:07.896Z"
},
"object": "list"
}
```
```json Point earned response wrap lines expandable highlight={11-25} theme={null}
{
"data": [
{
"id": "lctx_1298a2ae5ba25c6454",
"card_id": "lcrd_1298a287482b6d5e90",
"program_id": "lprg_1298a2068ad09df2dc",
"member_id": "lmbr_1298a28746eb6d5e8d",
"card_definition_id": "lcdef_1298a22790509df2f8",
"card_type": "INDIVIDUAL",
"type": "POINTS_EARNED",
"details": {
"reason": "Pointexpire / EXPIRE_EARNING_RULE",
"rejection": null,
"metadata": {
"event_id": "evcus_1298a2abb06b6d5ec2",
"member_id": "lmbr_1298a28746eb6d5e8d",
"program_id": "lprg_1298a2068ad09df2dc",
"earning_item_id": "lernei_1298a23b9f509df311",
"earning_rule_id": "lern_1298a23baf509df312"
},
"points": {
"total": 50,
"expiration_date": "2026-06-19"
}
},
"status": "APPROVED",
"created_at": "2026-06-18T16:40:38.510Z",
"updated_at": "2026-06-18T16:40:39.402Z",
"object": "card_transaction"
}
],
"cursor": null,
"object": "list"
}
```
### List reward purchases
Use the [GET List reward purchases](/api-reference/programs/list-member-reward-purchases) endpoint to show your members the rewards they have purchased. This endpoint lists purchases for all cards the member has.
The `details` (lines 12–33 and 47–68) object lists more information about the reward purchase, like the number of points spent or the reward `type`.
```json List reward purchases response lines wrap highlight={12-33,47-68} theme={null}
{
"data": [
{
"id": "lrtx_1299a9ded817f57b90",
"card_id": "lcrd_128f962dbd8c4ba5df",
"card_transaction_id": "lctx_1299a9ded817f57b8f",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"reward_id": "lrew_128f4cefbad47c863e",
"status": "APPROVED",
"type": "PURCHASE",
"details": {
"reason": "Points spent on reward",
"rejection": null,
"metadata": {},
"points": {
"total": 250
},
"result": {
"reward": {
"id": "lrew_128f4cefbad47c863e",
"type": "MATERIAL"
},
"quantity": 1,
"material": {
"type": "PRODUCT",
"product": {
"id": "prod_128f4cd0a94c4bef25"
}
},
"digital": null
}
},
"created_at": "2026-06-19T11:50:32.033Z",
"updated_at": "2026-06-19T11:50:33.387Z",
"object": "reward_transaction"
},
{
"id": "lrtx_129748dbafe65ae86e",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"card_transaction_id": "lctx_129748dbafe65ae86d",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"reward_id": "lrew_128f4c6710947c85d1",
"status": "APPROVED",
"type": "PURCHASE",
"details": {
"reason": "Points spent on reward",
"rejection": null,
"metadata": {},
"points": {
"total": 150
},
"result": {
"reward": {
"id": "lrew_128f4c6710947c85d1",
"type": "MATERIAL"
},
"quantity": 1,
"material": {
"type": "PRODUCT",
"product": {
"id": "prod_128f4c2edf547c859e"
}
},
"digital": null
}
},
"created_at": "2026-06-17T15:29:43.104Z",
"updated_at": "2026-06-17T15:29:44.542Z",
"object": "reward_transaction"
}
],
"cursor": null,
"object": "list"
}
```
### Aggregated reports
For dashboards and reconciliation, use the Loyalty v2 [Reports](/api-reference/loyalty-v2-reports-overview) endpoints instead of reconstructing totals from transaction lists. Program reports cover spending, points earnings, tier movements, and earning-rule evaluations (daily and all-time summary). Member reports cover daily points on a card and daily usage of a specific earning rule.
However, the report endpoints are recommended for internal reporting rather than building external, member-facing dashboards.
## Fulfillment
Your loyalty program needs a way for your members to spend the loyalty points they've earned. In a typical loyalty program, members can spend points to:
* Use the points as currency to pay for their orders.
* Purchase rewards.
### Pay with points
Prerequisite: Settings of pay with points in the point wallet
The point-to-currency exchange ratio is defined in the point wallet that governs the behavior of the loyalty card.
To allow your members to use points as currency and pay for their purchases, you'll need two endpoints:
* [POST Create order](/api-reference/orders/create-order "Create order API reference page") to create an order in Voucherify.
* [POST Pay for order with points](/api-reference/programs/pay-for-order-with-points "Pay for an order with points API reference") to use the existing order ID in this endpoint.
Qualifying, validating, and redeeming incentives
If you want to combine your loyalty program with [qualification](/api-reference/qualifications/check-eligibility), [validation](/api-reference/validations/validate-stackable-discounts), and [redemption](/api-reference/redemptions/redeem-stackable-discounts) of incentives, these should happen before the POST Pay with points endpoint is used.
If you use the redemption endpoint (POST `v1/redemptions`), it can create an order in Voucherify if an `order` object is passed. You can then skip the POST Create order endpoint, but you'll need to retrieve the order ID from the `v1/redemptions` response.
The POST Pay for an order with points endpoint has:
* Two required fields:
* The `card_id` string of the loyalty card (`lcrd_...`) whose points will be used in the transaction (line 2 in the examples).
* The `order` object that contains the `id` or `source_id` of the order to be paid (line 4).
* Two optional fields:
* The `mode` string that defines if the request is used to simulate the transaction or to actually pay for the order (line 6). Pass the following values:
* `DRY_RUN` to perform a simulation of the transaction. No points are spent from the member loyalty card and no transaction records are created.
* `TRANSACTION` to create an actual transaction. Points are spent to lower the total amount of the order.
* The `payment_limit` object that defines a limit on the transaction by providing a `type` (line 6):
* `CARD_BALANCE`: Default setting that allows the automatic payment up to the maximum of the total balance of the loyalty card. This setting is used when no `payment_limit` object is sent.
* `POINTS_LIMIT`: Uses the `points_limit` object to define how many points will be spent in the transaction. In the example below, the amount to be spent equals `100` points (line 10). If the card has fewer points than the set value for `max`, all available points will be used.
* `AMOUNT_LIMIT`: Uses the `amount_limit` object to define how much of the order amount can be paid for with points. The `max` value is defined in the smallest currency amount (line 10), so `100` means \$1, for example.
See the request examples below.
```json Pay with points request: Card balance limit lines wrap expandable highlight={2,4,6,8} theme={null}
{
"card_id": "lcrd_128f962dbd8c4ba5e1",
"order": {
"id": "ord_12b4cdf5f30c158825"
},
"mode": "TRANSACTION",
"payment_limit": {
"type": "CARD_BALANCE"
}
}
```
```json Pay with points request: Point limit lines wrap expandable highlight={2,4,6,8,10} theme={null}
{
"card_id": "lcrd_128f962dbd8c4ba5e1",
"order": {
"id": "ord_12b4cdf5f30c158826"
},
"mode": "TRANSACTION",
"payment_limit": {
"type": "POINTS_LIMIT",
"points_limit": {
"max": 100
}
}
}
```
```json Pay with points request: Amount limit lines wrap expandable highlight={2,4,6,8,10} theme={null}
{
"card_id": "lcrd_128f962dbd8c4ba5e1",
"order": {
"id": "ord_12b4cdf5f30c158827"
},
"mode": "TRANSACTION",
"payment_limit": {
"type": "AMOUNT_LIMIT",
"amount_limit": {
"max": 2000
}
}
}
```
The response differs depending on the `mode` used:
* `200` for the `DRY_RUN` mode.
* `202` for the `TRANSACTION` mode. Usually, returns a `PENDING` transaction to be processed asynchronously.
The table below describes how individual schema properties differ between the two execution response structures.
| JSON Property | `DRY_RUN` mode (simulation) | `TRANSACTION` mode (live) | Notes |
| :-------------------------------- | :---------------------------------------------- | :-------------------------------------- | :---------------------------------------------------------------------------------- |
| `status` | `"DRY_RUN"` | `"TRANSACTION_CREATED"` | Indicates the processing method used by Voucherify. |
| `message` | `"Dry run mode. No transaction was created..."` | `"Pay with points transaction created"` | Returns a mode-specific descriptive system notification. |
| `transaction.id` | *Omitted* | `"lotx_12b8dbf787c67de367"` | Unique identifier generated only for live, persistent records. |
| `transaction.card_transaction_id` | `null` | `"lctx_12b8dbf787c67de366"` | Populates with a tracking ID during live balance changes. |
| `transaction.status` | `"SIMULATED"` | `"PENDING"` | Reflects workflow state tracking (mock engine vs. active processing queue). |
| `transaction.created_at` | *Omitted* | `"2026-07-13T17:22:19.296Z"` | Generated exclusively when the state transaction object is written to the database. |
The transaction details regarding the point or amount limit and the actual number of points spent (or to be spent for the `DRY_RUN`) are returned in the `details.payment` object (lines 18–22).
```json Pay with points response: Card balance type lines wrap expandable highlight={16-21} theme={null}
{
"transaction": {
"id": "lotx_12b8861fdd0dd35462",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_transaction_id": "lctx_12b8861fdd0dd35461",
"order_id": "ord_12b4cdf5f30c158825",
"status": "PENDING",
"type": "PAY_WITH_POINTS",
"details": {
"reason": "Points spent on order payment",
"rejection": null,
"metadata": {},
"payment": {
"amount": 200,
"points_spent": 200,
"exchange_ratio": 1
}
},
"created_at": "2026-07-13T11:07:16.212Z",
"updated_at": null,
"object": "order_transaction"
},
"status": "TRANSACTION_CREATED",
"message": "Pay with points transaction created"
}
```
```json Pay with points response: Point limit type lines wrap expandable highlight={18-22} theme={null}
{
"transaction": {
"id": "lotx_12b884c72b0dd352b9",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_transaction_id": "lctx_12b884c72b0dd352b8",
"order_id": "ord_12b4cdf5f30c158826",
"status": "PENDING",
"type": "PAY_WITH_POINTS",
"details": {
"reason": "Points spent on order payment",
"rejection": null,
"metadata": {
"points_limit": 12
},
"payment": {
"amount": 12,
"points_spent": 12,
"exchange_ratio": 1
}
},
"created_at": "2026-07-13T11:01:23.245Z",
"updated_at": null,
"object": "order_transaction"
},
"status": "TRANSACTION_CREATED",
"message": "Pay with points transaction created"
}
```
```json Pay with points response: Amount limit type lines wrap expandable highlight={18-22} theme={null}
{
"transaction": {
"id": "lotx_12b8939fd78dd3657f",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"card_definition_id": "lcdef_128f4a88414c4bed69",
"card_transaction_id": "lctx_12b8939fd78dd3657e",
"order_id": "ord_12b4cdf5f30c158827",
"status": "PENDING",
"type": "PAY_WITH_POINTS",
"details": {
"reason": "Points spent on order payment",
"rejection": null,
"metadata": {
"amount_limit": 2000
},
"payment": {
"amount": 2000,
"points_spent": 2000,
"exchange_ratio": 1
}
},
"created_at": "2026-07-13T12:06:15.135Z",
"updated_at": null,
"object": "order_transaction"
},
"status": "TRANSACTION_CREATED",
"message": "Pay with points transaction created"
}
```
If the loyalty card has no points, Voucherify returns error code `423` – "Card balance is zero".
```json Pay with points response: No balance – error 423 lines wrap expandable highlight={} theme={null}
{
"code": 423,
"key": "zero_card_balance",
"message": "Card balance is zero",
"details": "Operation requires a positive card balance",
"request_id": "v-12b8894b3ec1a59873"
}
```
### Purchase reward
Use the [POST Purchase reward with points](/api-reference/programs/purchase-reward-with-points) endpoint to create a store where your loyalty program members can buy rewards.
In the request body, send the reward ID (`reward_id`) to be purchased. Since rewards are assigned to specific card definitions, Voucherify will subtract the required number of points from a loyalty card that's governed by the card definition.
Use the `details` object (response lines 11–19) to display how many points were spent on the reward purchase. If the loyalty program uses several card definitions, use the `card_id` (line 4) to tie the purchase to a specific loyalty card.
```json Purchase reward: Request lines wrap theme={null}
{
"reward_id": "lrew_128f4cefbad47c863e"
}
```
```json Purchase reward: Response lines wrap expandable highlight={4,11-19} theme={null}
{
"transaction": {
"id": "lrtx_1299a9ded817f57b90",
"card_id": "lcrd_128f962dbd8c4ba5df",
"card_transaction_id": "lctx_1299a9ded817f57b8f",
"program_id": "lprg_128f58429f4c4bf7b2",
"member_id": "lmbr_128f962dbc8c4ba5dc",
"reward_id": "lrew_128f4cefbad47c863e",
"status": "PENDING",
"type": "PURCHASE",
"details": {
"reason": "Points spent on reward",
"rejection": null,
"metadata": {},
"points": {
"total": 250
},
"result": null
},
"created_at": "2026-06-19T11:50:32.033Z",
"updated_at": null,
"object": "reward_transaction"
},
"status": "TRANSACTION_CREATED",
"message": "Reward purchase transaction created"
}
```
## Cancellation
Your loyalty program should also support situations when a member wants to stop participating in the program, have their member profile deleted altogether, or cases when you need to temporarily suspend member activity when suspecting program fraud.
### Deactivate
Use the [POST Deactivate member](/api-reference/programs/deactivate-program-member) endpoint to suspend a member's participation in the program.
A suspended member can't earn points or spend them on rewards or orders.
Activating member again
If you need to reactivate the member, so that they can participate in the loyalty program again, use the [POST Activate member](/api-reference/programs/activate-program-member) endpoint.
### Delete
If you need a mechanism for deleting member data, use the [DELETE Member](/api-reference/programs/delete-program-member) endpoint to soft-delete the member and all their associated cards within the program.
Customer data in Voucherify
The DELETE Member endpoint deletes only the data regarding the member profile. However, the member still has a customer profile in Voucherify.
Read how to [delete customer](/prepare/customers#delete-customers) data from Voucherify.
# Loyalty v2 developer overview
Source: https://docs.voucherify.io/guides/loyalty-v2-overview
Learn basics about your loyalty v2 integration: API surface, core objects, and the member journey
If you build loyalty v2 flows against `/v2/loyalties`, connect ecommerce, POS, CRM, or CDP systems, or need a map of endpoints and identifiers before diving into reference docs, this overview is for you.
## Documentation highlights
If you're looking for specific information, start with the resources below.
| Goal | Start here |
| -------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Understand the program model, roadmap, and differences from legacy loyalty | [Loyalty program overview](/build/loyalty-overview) |
| Learn terms: point wallets, earning rules, rewards, tiers, benefits | [Loyalty key concepts](/build/loyalty-key-concepts) |
| Integrate the member journey with request and response examples | [Integrate loyalty v2](/guides/loyalty-v2-integrate) |
| Move from Sandbox to production and troubleshoot common errors | [Take loyalty v2 to production](/guides/loyalty-v2-take-to-production) |
| Look up methods, schemas, and parameters | [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) |
Legacy `/v1/loyalties` remains in maintenance mode. For new integrations, use loyalty v2. See [Legacy loyalty API](/api-reference/loyalties/introduction-to-legacy-loyalty).
## Integration journey
A typical loyalty v2 integration follows the member journey. Each stage has dedicated endpoints; many stages also depend on shared platform APIs such as customers, orders, and custom events.
| Stage | What your system does | Primary API areas |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Preparation** | Authenticate, choose region, create an `ACTIVE` program, sync customers and products, define metadata and custom event schemas | Auth, programs, customers, products, metadata, events |
| **Acquisition** | Enroll customers as members; handle inactive enrollment and batch create | [Members](/api-reference/programs/create-program-member) |
| **Discovery** | Estimate earnings and reward availability without writing balances | [Examine earning rules](/api-reference/examine/examine-earning-rules), [Examine rewards](/api-reference/examine/examine-rewards) |
| **Activity** | Trigger earnings through paid orders, custom events, or segment entry | [Create order](/api-reference/orders/create-order), [Track custom event](/api-reference/events/track-custom-event) |
| **Retention** | Render member profile, balances, tiers, transactions, purchase history, and aggregated reports | [Get membership](/api-reference/programs/get-program-membership), [List card transactions](/api-reference/programs/list-card-transactions), [Reports overview](/api-reference/loyalty-v2-reports-overview) |
| **Fulfillment** | Spend points on orders or purchase rewards | [Pay for order with points](/api-reference/programs/pay-for-order-with-points), [Purchase reward with points](/api-reference/programs/purchase-reward-with-points) |
| **Cancellation** | Suspend or soft-delete members | [Deactivate member](/api-reference/programs/deactivate-program-member), [Delete member](/api-reference/programs/delete-program-member) |
Work through these stages in detail in [Integrate loyalty v2](/guides/loyalty-v2-integrate).
## Core objects and identifiers
Loyalty v2 uses program-scoped resources. Store these IDs in your system and pass the correct type on each call.
| Object | ID prefix | Role in the integration |
| ------------------------------ | -------------- | ---------------------------------------------------------- |
| Program | `lprg_` | Parent container for wallets, rules, rewards, and members |
| Card definition (point wallet) | `lcdef_` | Defines how points behave on cards issued from that wallet |
| Member | `lmbr_` | Program-specific enrollment of a Voucherify customer |
| Loyalty card | `lcrd_` | Point balance for one wallet on one member |
| Earning rule | `lern_` | Trigger and effects that grant points or benefits |
| Reward | `lrew_` | Catalog item members can purchase with points |
| Benefit | `lben_` | Automatic grant (material or digital) from an earning rule |
| Tier structure / tier | `lts_` / `lt_` | Levels and progress tied to a point wallet |
| Customer (shared) | `cust_` | Must exist before enrollment; not loyalty-specific |
Do not interchange `cust_…` and `lmbr_…`. Member endpoints expect a member ID. Membership lookup can use a customer ID with the correct identification type. Mixing IDs is a common cause of `404` responses. See [Take loyalty v2 to production](/guides/loyalty-v2-take-to-production#troubleshooting).
A member can hold multiple loyalty cards when the program uses multiple point wallets. Card codes (`cards[].card.code`) can be `null` right after enrollment because code generation is asynchronous. Prefer `lcrd_…` and `lmbr_…` for follow-up calls.
## API surface
The Loyalty v2 API lives under `/v2/loyalties`. Use the groups below as a map into the reference.
Create and manage programs, and assign wallets, earning rules, tiers, and rewards.
Enroll members, read memberships, adjust points, list transactions, pay with points, and purchase rewards.
Dry-run earning and reward evaluation for member portals and checkout previews.
Configure point wallets: pending points, expiration, limits, and pay-with-points exchange.
Define triggers and earnings for orders, custom events, and segment entry.
Build the reward catalog members can purchase with points.
Define automatic material or digital grants from earning rules.
Configure tier levels and read tier progress on memberships.
Read aggregated spending, earnings, tier movements, and earning-rule statistics.
Program setup can be done in the dashboard (**Loyalty hub**) or through these APIs. Many integrations create the program in the dashboard, then automate only the runtime member journey.
## Shared platform dependencies
Loyalty v2 does not replace the rest of the Voucherify API. Runtime flows still use:
* [Authentication](/guides/authentication) and regional base URLs from [API overview](/guides/api-overview#choose-the-right-api-endpoint).
* [Customers](/api-reference/customers/create-customer): Required before membership.
* [Orders](/api-reference/orders/create-order) with `status: PAID`: Trigger order-paid earning rules; required before pay with points.
* [Custom events](/api-reference/events/track-custom-event): Triggers event-based earning rules.
* Discount or gift [campaigns](/build/campaign-overview): When rewards or benefits issue vouchers or credits.
* [Async actions](/api-reference/async-actions/get-async-action): For background enrollment.
Keep application keys on the server. See [Security](/guides/security).
## Design constraints that affect integrations
Account for these constraints early:
* **Active program lock**: After a program is `ACTIVE`, you cannot add or edit point wallets or add tier structures. Experiment in Sandbox before activation. However, you can still add and edit earning rules, rewards, and benefits. Details: [Integrate loyalty v2](/guides/loyalty-v2-integrate#preparation).
* **Program limits**: Up to 10 wallets, 100 rewards, 100 earning rules, one tier structure (up to 10 levels), and 100,000 members per program. See [Loyalty program overview](/build/loyalty-overview#program-limits).
* **Async outcomes**: Batch member create, card code generation, pay-with-points `TRANSACTION` mode, and reward purchases can complete asynchronously. Poll the relevant get, list or async-action endpoints until the status is terminal.
* **Examine is dry-run**: Examine endpoints estimate earnings and reward availability without changing balances.
* **Projects are isolated**: Sandbox and production do not share programs, members, or IDs. Recreate configuration when you go live.
## What's next?
Walk through preparation, enrollment, discovery, earning, retention, fulfillment, and cancellation with example payloads.
Recreate the program in production, run a go-live checklist, and resolve common HTTP errors.
Read the product model, rollout phases, and differences from legacy loyalty campaigns.
Open the Loyalty v2 API map and endpoint reference for request and response schemas.
Work with a developer tool to visualize and test loyalty programs without the full dashboard.
# Take loyalty v2 to production
Source: https://docs.voucherify.io/guides/loyalty-v2-take-to-production
Move your Voucherify Loyalty v2 integration from Sandbox to Production, and solve most frequent issues
Once your integration is ready as described in [Integrate loyalty v2](/guides/loyalty-v2-integrate), you can prepare your environment for a successful launch. For the `/v2/loyalties` API map, see [Loyalty v2: Overview](/api-reference/loyalty-v2-api-overview).
## Going to production
Moving your Voucherify loyalty v2 integration from a Sandbox environment to a live production environment requires more than simply swapping your API keys. Because Voucherify projects are completely isolated from one another, your configuration data does not automatically migrate. You must recreate your entire program setup from scratch in your live Production project before routing live customer traffic.
Use this step-by-step checklist to ensure a seamless launch and avoid transaction failures.
Use your production project or create a dedicated one for your live store data.
Go to **Project settings** > **Application keys** in the production project to retrieve your production credentials (`X-App-Id` and `X-App-Token`). Update your infrastructure environment variables with these live keys. Keep application keys on the server side only. See [Authentication](/guides/authentication) and [Security](/guides/security).
Point your system to the correct regional API base URL from [API overview](/guides/api-overview#choose-the-right-api-endpoint). Confirm the production project has the `LOYALTY_V2` entitlement.
Voucherify Sandbox and Production projects share zero database records. Attempting to pass production keys along with sandbox resource IDs (such as sandbox program IDs or member IDs) will cause the Voucherify API to return `404 Resource Not Found` errors.
Before your live system sends transaction data to the Voucherify API, you must manually rebuild your custom data structures in the new production project:
* Re-define all **Metadata schemas** used for custom attributes on point wallets, loyalty members, orders, and other data.
* Re-create all **Custom event schemas** that trigger loyalty earning rules (such as writing product reviews or downloading your mobile app).
Ensure your live customer profiles and store products exist inside the new production project so transactions map correctly:
* Import your live customer database into the production project using a CSV upload or the [POST Import and Update Customers](/api-reference/customers/import-and-update-customers-using-csv) API endpoint.
* If you use a CDP or CRM system, check if customer data is synchronized correctly.
* Synchronize your product catalog, matching your online store or POS menu item IDs to the Voucherify product engine fields (`source_id`).
If your loyalty program is going to issue discount vouchers or gift card credits as rewards or benefits, create relevant Voucherify campaigns.
Go to the **Loyalty hub** > **Programs** in the production project to rebuild your loyalty architecture:
* Set up your point wallets and define your tier structures exactly as you designed them in your Sandbox project.
* Re-create your earning rules, rewards, and benefits.
* Once verified, set the program status to `ACTIVE`.
Copy the new live loyalty program ID (`lprg_...`) and update your backend environment data. Your code must use this new live identifier for all member-related API calls.
Before turning the real customer traffic on the production project, perform a final transaction walkthrough using a controlled production member profile.
Check the following:
1. Enrollment: Create a test live member using a production customer ID. Confirm get-before-create and `409 member_already_exists` handling.
2. Earning: Submit a live order with a `PAID` status and verify that points are successfully added to the member's wallet balance.
3. Discovery: Call examine earning rules and examine rewards for the test member.
4. Redemption: Purchase a low-cost or test reward and poll until the reward transaction is `APPROVED` or `REJECTED`.
5. Pay with points: Run a `DRY_RUN`, then a live `TRANSACTION` payment, and poll [list member order payments](/api-reference/programs/list-member-order-payments) until the status is terminal.
6. Profile: Refresh [GET membership](/api-reference/programs/get-program-membership) and confirm balances, pending points, and transaction history.
## Operational readiness
Before you route live traffic, confirm these operational controls.
### Retries and rate limits
Use the following guidelines to handle retries and rate limits:
* Retry only safe reads and failed requests that did not create a transaction ID.
* Use exponential backoff for `429` and `5xx` responses. See [Limits](/guides/limits).
* Do not automatically replay pay-with-points or reward-purchase POSTs after a `202` response. Poll the transaction list instead.
### Monitoring and reconciliation
Use the following guidelines to monitor and reconcile your loyalty program:
* Alert on elevated `404`, `409`, `423`, `429`, and `5xx` rates for loyalty endpoints.
* Reconcile daily: memberships created, points earned, points spent, reward purchases, and rejected transactions.
* Use Loyalty v2 [Reports](/api-reference/loyalty-v2-reports-overview) for aggregated spending, points-earnings, tier, and earning-rule statistics at program or member scope.
* Use **Activity** tabs in Loyalty hub and the [Audit log](/analyze/audit-logs) when investigating mismatches.
### Rollback and kill switch
Use the following guidelines to rollback and kill switch your loyalty program:
* Keep a way to disable loyalty spend in your checkout (feature flag) without redeploying.
* For incorrect reward purchases, use [Refund a reward purchase](/api-reference/programs/refund-a-reward-purchase) when your support process allows refunds. Confirm the refund flow in Sandbox before production use.
* To stop a member from earning or spending, [deactivate the member](/api-reference/programs/deactivate-program-member). To pause the whole program, deactivate the program in **Loyalty hub** after you understand the impact on active members.
* Partial refunds by item or amount for point wallets are not supported yet. Plan support workflows around full refund behavior configured in the point wallet.
## Troubleshooting
Resolve operational friction points, API structural anomalies, and edge cases commonly encountered by system integrators during the deployment.
The Voucherify API returns an HTTP `404 Not Found` response code if the identifiers provided in the path parameters do not match database entries.
Solutions:
* ID confusion: Check if the client request payload has a Voucherify loyalty program member ID (`lmbr_...`) rather than a standard Voucherify Customer ID (`cust_...`) when querying member-specific states like `GET member`. This also applies to the new IDs of the recreated loyalty v2 program in your production environment.
* Cross-project scope separation: Verify that the request headers (`X-App-Id` and `X-App-Token`) point to the identical dashboard environment containing the referenced loyalty program ID (`lprg_...`).
The Voucherify API returns an HTTP `409 Conflict` response code if a resource already exists in a loyalty program.
The most frequent case is an attempt to enroll a customer in a loyalty program when that customer is already a member of that program.
Solutions:
* Verify ID uniqueness: Ensure that the integration request payload contains a unique, non-registered customer ID that is not currently associated with the program. If you use several loyalty programs, verify that the program IDs are not duplicated in the request.
* Implement get-before-create (read-first pattern): Before registering a customer, query the Voucherify memberships API (`GET /v2/loyalties/programs/{programId}/memberships/{customerId}`) to check if the customer profile already is a member of the target loyalty program.
* Graceful client-side redirection (soft-catch): Intercept the HTTP `409` error code on your backend integration layer. Instead of returning an error to the user interface, treat the conflict as a validation that the user is registered. Retrieve their existing active loyalty member data and transition the user interface directly to the active loyalty program dashboard.
The Voucherify API returns an HTTP `423 Locked` response code if you attempt to perform an action on a resource that is restricted due to the resource's current status, active validity rules, or balance limitations.
Solutions:
* Reward validity window: Verify that you are attempting to redeem or purchase the reward within the reward's scheduled active time frame. If the transaction occurs outside of the reward's configured validity dates and hours, Voucherify blocks the request. You can adjust the active dates of the reward in the **Loyalty hub**.
* **Zero card balance**: Check if the loyalty card has a positive point balance before pay with points or reward purchase. If the balance is zero, the operation fails with `zero_card_balance` until points are earned or added.
The Voucherify database assigns loyalty card code fields asynchronously. Immediately after triggering POST Create member, the response payload may expose `cards[].card.code` as a `null` value.
Solutions:
* Avoid immediate code dependency: Never configure client-side user interfaces to rely on a synchronous card code return when processing post-enrollment UI views.
* Fallback payload strategies: Rely cleanly on the unique Voucherify loyalty member ID (`lmbr_...`) or the card ID (`lcrd_...`) for all secondary client-side calculations.
Use **Activity** tabs in loyalty v2 components, like point wallets, members, rewards, to debug any errors or misconfigurations. The **Activity** tabs list all events that occurred for a given resource, including the request and response bodies.
Additionally, use the [Audit log](/analyze/audit-logs) to check the full history of your Voucherify project.
# Management API
Source: https://docs.voucherify.io/guides/management-api
API endpoints for managing account-related operations
## Management API benefits
Management API introduces API endpoints that let you perform account-related operations connected with:
* [Projects](/api-reference/management/create-project "Create Project"),
* [Users](/api-reference/management/assign-user "Assign User"),
* [Metadata schemas](/api-reference/management/create-metadata-schema "Create Metadata Schema"),
* [Custom event schemas](/api-reference/management/create-custom-event-schema "Create Custom Event Schema"),
* [Stacking rules](/api-reference/management/create-stacking-rules "Create Stacking Rules"),
* [Webhooks](/api-reference/management/create-webhook "Create Webhook Configuration"),
* [Branding](/api-reference/management/create-brand "Create Brand"),
* [Templates](/api-reference/management/list-campaign-templates).
**All of the above-mentioned endpoints must be sent to the following URL: `https://{region}.voucherify.io/management/v1/`.**
The three main advantages of the Management API are:
1. **Automation**: Streamline the process of creating new projects, configuring them, and adding users, among other tasks.
2. **Accelerated delivery**: Experience faster delivery times for new projects.
3. **Reduced error risk**: Standardized API calls lower the risk of human error in project configuration, ensuring consistency and reliability.
The Management API is an Enterprise feature. [Contact Voucherify Sales Team](https://www.voucherify.io/contact-sales "Contact Voucherify Sales") for more details.
## Management API keys
The new tab appears in Team Settings once your organization unlocks it. From there, you can generate Management API keys to facilitate various operations.
Each organization can generate a maximum of 5 management API keys. You have the flexibility to delete, edit, and add new keys at your discretion. However, any modification triggers a cache refresh (deletion).
If you require more than 5 keys, reach out to [Voucherify support team](https://www.voucherify.io/contact-support "Contact Voucherify support") for assistance.
The audit log does not record actions performed via the Management API for privacy and security reasons.
After creating a new Management API key, you have **15 minutes** to copy the token.
Write your secret keys down and keep them in a safe place.
## Tracking Management API usage
To monitor the usage of Management API calls, go to the Team Settings tab. You will find a comprehensive chart located alongside other usage metrics, allowing you to stay informed about your organization's activity.
# Metadata mapping
Source: https://docs.voucherify.io/guides/metadata-mapping
Custom attributes (metadata) and their use in Voucherify
## Custom attributes (metadata)
Custom attributes can be added to your project as metadata. A metadata attribute is a set of key/value pairs that you can use to customize your campaigns, vouchers, customers, SKUs, products, redemptions, publications, loyalty tiers, promotion tiers, and orders.
Here are some exemplary scenarios that can be achieved by using metadata:
* Validate redemptions based on custom attributes,
* Filter out customers in segments (e.g., users who signed up for a newsletter before a given date) and use them for validation rules,
* Run distributions based on custom customer attributes,
* Enforce that new campaigns have proper identifiers provided for reporting.
Voucherify [Management API](/guides/management-api "Management API"), available as an Enterprise feature, enables you to manage metadata schemas via API. For instance, you can set up new or modify standard metadata schemas under a specific configuration between projects. You can conveniently list metadata schemas, retrieve a specific metadata schema, update, or delete the schemas within a project as needed.
### Validation purposes
You can use validation rules and apply them to codes or loyalty-earning rules in your campaigns and can encourage customers to specific behaviors, allowing them to redeem the discount only if:
* A customer is subscribed to a newsletter,
* A customer chooses a specific payment method or currency,
* A customer buys an item from a specific brand,
* A customer is using a mobile application to make the purchase.
### Targeting purposes
You can target certain products or collections to be eligible for the discount. In this scenario, products share some common features, such as category, brand, or manufacturing date:
* Products that are about to expire,
* Products from the last season,
* Discount targeting a product category/collection.
### Distribution
You can reward your customers for certain behaviors that, in turn, will trigger the distribution of a voucher code or add points to their loyalty card balance:
* Reward a customer with a coupon code for subscribing to a newsletter,
* Reward a customer with loyalty points if the customer buys items from a specific brand,
* Give a customer a gift voucher if they leave a 5-star review.
### Enhancing the customer experience
You can enhance your customer experience and control the custom attributes exposed to them directly from Voucherify:
* Campaigns/vouchers – terms and conditions, link to a banner,
* Rewards – reward details, how to retrieve the reward,
* Earning Rules – terms and conditions.
## Metadata library
Voucherify will take care of metadata integrity. This is achieved by a [metadata schema validator](/prepare/metadata). It allows you to define field types, including:
* text
* number
* boolean
* date
* date time
* image URL
* Object (nested)
| Object | Metadata |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| [Customer](/reference/customer-object) | marital\_status (string), subscribed (boolean), billing information (nested), acquisition\_channel (string), braze\_segment (string) |
| [Redemption](/reference/redemption-object) | voucher\_deep\_linked (boolean) |
| [Product](/reference/product-object) | product\_category, expiration\_date (true/false), manufacturer\_id, brand, flight\_destination, booking\_date\_time |
| [Order](/reference/order-object) | shipping\_country, order\_channel, payment\_method, store\_id, currency |
| [Publication](/reference/publication-object) | request\_source, trigger |
| [Voucher](/reference/voucher-object) | terms\_and\_conditions, success\_banner\_url, failure\_banner\_url, contentful\_entities |
| [Campaign](/reference/campaign-object) | target\_audience, location, market, campaign\_owner |
| Order line item | category, manufacturer\_id, origin, flight\_number |
| [Loyalty tier](/reference/loyalty-tier-object) | exposed\_tier\_name, tier\_banner\_URL |
| [Promotion tier](/reference/promotion-tier-object) | exposed\_tier\_name, tier\_banner\_URL, location, market, campaign\_owner |
| [Earning rule](/reference/earning-rule-object) | terms\_and\_conditions, earning\_rule\_splash\_screen\_url |
| [Reward](/reference/reward-object) | place\_of\_collection, terms\_and\_conditions |
## Customer PII
Sending any kind of Personally Identifiable Information (PII) to Voucherify is not mandatory. However, passing such data enables additional features, but our promotion engine can be used without any PII from your customers. You can just send the technical ID of the customer to enable some specific discounts to the customer.
While using external tool segments, e.g., from Braze, Iterable, Salesforce, etc., segmentation is based on the PII. During the send-out process, the tool sends a request to Voucherify to assign a voucher code to a specific customer ID, thus not passing any PII. Such a solution enables the following scenarios:
* Showing the list of vouchers for a customer (based on the customer’s ID alone),
* Enabling the customer wallet scenario for qualification (targeted discounts based on the previous distribution),
* Validating whether the customer using the voucher is the person to whom the voucher code was assigned.
## Nested metadata
To extend the customization capabilities of Voucherify, you can also use nested metadata properties. For example, you may create a new metadata billing\_information and add several nested properties, such as billing\_address, billing\_country, or billing\_postal\_code. To customize these properties further, you can decide the type of the given metadata property and optionally set different conditions, e.g., billing\_country has to be a European country.
Example for a billing address:
```json json theme={null}
"metadata": {
"billing_information": {
"billing_address": "Porcelanowa 23",
"billing_city": "Katowice",
"billing_country": "Poland",
"billing_postal_code": "40-246",
"billing_recipient": "John Smith",
}
}
```
# SDKs
Source: https://docs.voucherify.io/guides/sdks
## Get your library
***
***
Voucherify developers constantly improve Voucherify's RESTful API, which you can use to integrate with your systems. The SDKs are open source and are mostly developed with the help of the client and partner community. Contribute and provide feedback by submitting a pull request on the [GitHub repository](https://github.com/voucherifyio/).
***
## JS
JS is **the latest** JavaScript and node.js SDK.
```shell Shell theme={null}
npm install @voucherify/sdk
```
[voucherifyio/voucherify-js-sdk](https://github.com/voucherifyio/voucherify-js-sdk)
***
## Java
Grab the SDK via Maven:
```xml XML theme={null}
io.voucherify.client
voucherify-java-sdk
17.0.2
compile
```
or via Gradle:
```
repositories {
mavenCentral()
}
dependencies {
implementation "io.voucherify.client:voucherify-java-sdk:17.0.2"
}
```
[voucherifyio/voucherify-java-sdk](https://github.com/voucherifyio/voucherify-java-sdk)
***
## Ruby
```shell Shell theme={null}
gem install voucherify
```
[voucherifyio/voucherify-ruby-sdk](https://github.com/voucherifyio/voucherify-ruby-sdk)
***
## PHP
Include Voucherify PHP SDK (rspective/voucherify) in your PHP composer.json file as required module i.e:
```php php theme={null}
"require": {
"rspective/voucherify": "dev-master"
}
```
You can check available versions at [Packagist](https://packagist.org/packages/rspective/voucherify).
[voucherifyio/voucherify-php-sdk](https://github.com/voucherifyio/voucherify-php-sdk)
***
## Python
```shell Shell theme={null}
pip install voucherify
```
[voucherifyio/voucherify-python-sdk](https://github.com/voucherifyio/voucherify-python-sdk)
***
## .NET
### Client-side library
```shell Shell theme={null}
Install-Package Voucherify.Client
```
### Server-side library
```shell Shell theme={null}
Install-Package Voucherify
```
Or simply use libraries from the lib/\{target-framework} folder.
[voucherifyio/voucherify-dotNET-sdk](https://github.com/voucherifyio/voucherify-dotNET-sdk)
***
## Node.js
Node.js is a deprecated version. Go to [JS](/docs/sdks#js) to use the latest Node.js SDK.
```shell Shell theme={null}
npm install voucherify
```
[voucherifyio/voucherify-nodejs-sdk](https://github.com/voucherifyio/voucherify-nodejs-sdk)
***
## Voucherify.js
Voucherify.js is a deprecated version. Go to [JS](/docs/sdks#js) to use the latest SDK.
From CDN:
[http://www.jsdelivr.com/projects/voucherify.js](http://www.jsdelivr.com/projects/voucherify.js)
[voucherify/voucherify.js](https://github.com/voucherifyio/voucherify.js)
***
## Android
Voucherify developers currently don't develop this SDK.
Using Gradle:
```groovy Groovy theme={null}
dependencies {
compile 'pl.rspective.voucherify.android.client:voucherify-android-sdk:0.6.0'
}
```
Using Maven:
```xml XML theme={null}
pl.rspective.voucherify.android.client
voucherify-android-sdk
0.6.0
```
The SDK requires at least Java 6 or Android 2.3.3 (API 10)
[voucherifyio/voucherify-android-sdk](https://github.com/voucherifyio/voucherify-android-sdk)
***
## iOS(Swift)
Voucherify developers currently don't develop this SDK.
Using CocoaPods simply add the following line to your Podfile:
```shell Shell theme={null}
pod "VoucherifySwiftSdk"
```
The SDK requires Swift 2.2 and therefore Xcode 7.3
[voucherifyio/voucherify-ios-sdk](https://github.com/voucherifyio/voucherify-ios-sdk)
# Security
Source: https://docs.voucherify.io/guides/security
Voucherify data security
* Learn how Voucherify guarantees campaign security.
* Identify PII data to be shared with Voucherify.
* Analyze your distribution processes in relation to GDPR and Data Privacy laws.
Data security assessment of integration.
***
As an **ISO-27001-certified product**, Voucherify implements several security standards and practices to protect your and your customers' data:
* AWS cloud security (Virtual Private Cloud) implemented according to the AWS Best Practices.
* Encryption (AWS KMS, TLS 1.2, data encryption at rest with AES-256).
* Regular PCI scans, security audits, and penetration tests performed by a third party IT security company.
* Web Application Firewall with active blocking rules
* DDOS protection (connection limiting, WAF).
* Login brute-force protection.
* Logging and monitoring systems, along with alerting and anomaly detection (Prometheus, Grafana, NewRelic, CloudWatch, PagerDuty).
* Role-based access and policy enforcement (AWS IAM, VPN, access logs, periodic permission reviews).
* All critical systems secured with multi-factor authentication and/or authenticating through SSO (enforced).
* Disaster Recovery Plan and custom disaster recovery protocols defined in the SLA.
* [GDPR & CCPA compliance](/manage/security-and-data-protection).
* Redundancy of all underlying services for High Availability.
* Reliability and backup (RAID class hardware, AWS S3).
* Two-factor authentication, strong password policies, and SAML. Voucherify prioritizes account security by implementing features like strong password policies, session management, and access monitoring. These measures help protect user accounts and prevent unauthorized access. For more details, read the [Account Security article](/manage/account-security).
* OAuth 2.0 authorization for generating access tokens. Voucherify can generate [OAuth 2.0 tokens](/guides/authentication#oauth-20) to be temporarily used with API clients. The tokens can have a limited scope to access specific parts of the Voucherify server-side or client-side API.
* Automated daily data backups. Voucherify also copies snapshots to a separate AWS account with limited access as an extra layer of security. Voucherify continuously checks whether automated backups succeed and regularly tests the procedure for recovering data from snapshots.
* [Member roles](/manage/members-and-roles "User roles and access control") – Voucherify's Team Management enhances account security by offering features like role-based access control, member permissions, and activity tracking. These tools ensure only authorized team members can access or modify sensitive data, reducing the risk of unauthorized actions.
* Security and Data Protection - Voucherify ensures robust security and data protection through measures like encryption, GDPR compliance, and secure API communication. These practices safeguard sensitive data and maintain compliance with legal standards. For more information, read the [Security & Data Protection](/manage/security-and-data-protection) article.
* Multi-Factor Authentication - Voucherify supports Multi-Factor Authentication (MFA) to enhance account security. MFA adds an extra layer of protection by requiring users to verify their identity through an additional factor beyond their password. For detailed guidance, read the [MFA article](/manage/account-security#two-factor-authentication).
* Fraud Prevention - Voucherify offers tools for Fraud Prevention to safeguard your campaigns, including setting redemption limits, monitoring suspicious activity, and defining usage rules to prevent abuse. For more information, read the [Fraud Prevention Mechanisms](/guides/fraud-prevention-mechanisms) and [Fraud Prevention and Tracking](/optimize/fraud-prevention-best-practices) articles.
* Passwords are hashed using SHA256 with salt. Plaintext passwords are never stored.
Contact [Voucherify Customer Success](https://www.voucherify.io/contact-support) team for a complete **Security Architecture Model** or the recent pentest report.
If you plan to use Voucherify's built-in messaging, go to a dedicated [GDPR guide](/manage/security-and-data-protection "Security and Data Protection – GDPR and CCPA compliance"). It showcases how Voucherify implements requirements from the Directive.
# Transfer loyalty points
Source: https://docs.voucherify.io/guides/transfer-loyalty-points
See how to transfer points between loyalty cards.
Sunset content: Loyalty v1
This page covers a topic for loyalty v1.
The current standard loyalty solution offered by Voucherify is loyalty v2.
Go to [Loyalty v2 overview](/build/loyalty-overview) to learn more.
This guide shows a workflow for combining loyalty points from multiple cards. A common use case is to allow a customer to redeem a reward if the number of points on a single card is not enough.
* Points can be transferred between cards in the same and different loyalty campaigns.
* Points can be transferred to the same and different customers.
## Reward qualification
First, call the [qualification endpoint](/api-reference/qualifications/check-eligibility). It returns a list of loyalty cards that you can use to redeem a reward specified in the request.
```json Request body theme={null}
{
"customer" : {
"id" : "cust_D01yXiZdzuMl149QpUFBG58E",
"source_id" : "src_id",
"name": "Jan Kowalski"
},
"reward": {
"id": "rew_BLeJDzhaNTxpW3tFFhuFM5Wl",
"assignment_id": "rewa_sxrvjMvQAtip54kV81FBxs2V"
}
}
```
```json 200 OK theme={null}
{
"object": "list",
"total": 2,
"data_ref": "data",
"data": [
{
"id": "v_h50cZynXOwLl4L3bCM478kTHdbSau25D",
"code": "L-CARD-BUHuH6g",
"campaign": "Postman Test Validtion Rules Campaign - 1571133612128",
"campaign_id": "camp_f1lr3j8puLtQQil70BFHheOX",
"category": null,
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 10,
"balance": 10
},
"start_date": "2019-01-01T00:00:00Z",
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/L-CARD-BUHuH6g/publications?page=1&limit=10"
},
"redemption": {
"object": "list",
"quantity": null,
"redeemed_quantity": 0,
"url": "/v1/vouchers/L-CARD-BUHuH6g/redemptions?page=1&limit=10"
},
"active": true,
"additional_info": null,
"metadata": {
"test": true
},
"is_referral_code": false,
"holder_id": "cust_A1pTeJEhSDedggst9WjjZouL",
"updated_at": null,
"object": "voucher",
"validation_rules_assignments": {
"object": "list",
"total": 0,
"data_ref": "data",
"data": []
}
},
{
"id": "v_d33138hlguqgLO2tU2QHfpqWqGfJHITx",
"code": "L-CARD-Re0431H",
"campaign": "Postman Test Validtion Rules Campaign - 1571133612128",
"campaign_id": "camp_f1lr3j8puLtQQil70BFHheOX",
"category": null,
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 10,
"balance": 10
},
"start_date": "2019-01-01T00:00:00Z",
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/L-CARD-Re0431H/publications?page=1&limit=10"
},
"redemption": {
"object": "list",
"quantity": null,
"redeemed_quantity": 0,
"url": "/v1/vouchers/L-CARD-Re0431H/redemptions?page=1&limit=10"
},
"active": true,
"additional_info": null,
"metadata": {
"test": true
},
"is_referral_code": false,
"holder_id": "cust_A1pTeJEhSDedggst9WjjZouL",
"updated_at": null,
"object": "voucher",
"validation_rules_assignments": {
"object": "list",
"total": 0,
"data_ref": "data",
"data": []
}
}
],
"id": "qfl_5HPcxiJFQ7KyqW8h0AcsaYqa",
"created_at": "2019-10-15T10:07:56Z"
}
```
The returned cards belong to the given customer but the customer parameter is optional. If you leave it not defined, the method will return all loyalty card codes which can be used to redeem a reward.
## Loyalty card validation
Use the [validation API](/api-reference/validations/validate-stackable-discounts) method to verify whether the customer has enough points to receive a reward. Here is an endpoint and example request.
An example request body and a response:
```json Example request theme={null}
{
"customer" : {
"id" : "cust_D01yXiZdzuMl149QpUFBG58E",
"source_id" : "src_id",
"name": "Jan Kowalski"
},
"reward": {
"id": "rew_BLeJDzhaNTxpW3tFFhuFM5Wl",
"assignment_id": "rewa_sxrvjMvQAtip54kV81FBxs2V"
}
}
```
```json 200 OK Response theme={null}
{
"reason": "loyalty card points exceeded",
"code": "6PMax4A9",
"tracking_id": "track_eWzw13pdCww=",
"metadata": {},
"valid": false
}
```
In the response, you can see that the customer doesn't have enough points to get the reward.
## The loyalty points transfer
You can transfer loyalty points between campaigns and customers. If a customer has two or more assigned loyalty cards, Voucherify lets you transfer points from one card to another - for example, when the customer does not have enough points on a single loyalty card to receive the reward. You can transfer points between cards in the same or different loyalty campaigns and for the same or different customers.
To transfer points from one card to another (\{id}), call the transfer endpoint with the following request body:
POST: [https://api.voucherify.io/v1/loyalties/\{campaignId}/members/\{memberId}/transfers](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/a2u22ec/transfer-points)
In the path parameters, you need to include:
* **campaignId** - a unique identifier of the loyalty campaign containing the voucher **to which** the loyalty points are to be sent.
* **memberId** – a unique code identifying the loyalty card **to which** you want to transfer loyalty points.
In the body parameters, you need to add the following data:
* **code** – a unique identifier of the loyalty card **from which** you want to transfer points.
* **points** – the number of loyalty points that you want to transfer to another loyalty card.
The number of points in the request body cannot be higher than the current balance on the loyalty card.
```json Request body theme={null}
[
{
"campaign_id": "camp_dYaLHvcIMdUZ2yINBABKDECE",
"code": "pLUJhg7S",
"points": 200
}
]
```
```json 200 Ok Response theme={null}
{
"id": "v_3grX6kmKO8Y4zFDmd441DAzBI81lhjSr",
"code": "6PMax4A9",
"campaign": "Loyalty Program 2",
"campaign_id": "camp_qOrtQUT8sRZ0p6dEAkFpx97p",
"category": null,
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 700,
"balance": 700
},
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX1+35occP23L/yglhePqiCkecRPeIdaqfGy9RwojagJEbdkA9jISi4J22JXzMB7K3Yr3Uc6b9/7Y/BTFcEn/5Ne/IC6OdI4VMBCsGKc38s33IXD4fQyNW1BUmX0SscHbGw4dNTi35/0vEQ==",
"url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B35occP23L%2FyglhePqiCkecRPeIdaqfGy9RwojagJEbdkA9jISi4J22JXzMB7K3Yr3Uc6b9%2F7Y%2FBTFcEn%2F5Ne%2FIC6OdI4VMBCsGKc38s33IXD4fQyNW1BUmX0SscHbGw4dNTi35%2F0vEQ%3D%3D"
},
"barcode": {
"id": "U2FsdGVkX1+11QKTmAxc4j8dcFzwE0TxTVY3bu/HwZ463JPTPUc+Wi4TSkem0hBBWaYge2oTQCT+Ll8ATwTsDcTx1TVI08YgO0Nrman9gB/vns1uqu6A31TA4UZIMCdHLXpW4TRfqYI1DTvHYAD6Kg==",
"url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2B11QKTmAxc4j8dcFzwE0TxTVY3bu%2FHwZ463JPTPUc%2BWi4TSkem0hBBWaYge2oTQCT%2BLl8ATwTsDcTx1TVI08YgO0Nrman9gB%2Fvns1uqu6A31TA4UZIMCdHLXpW4TRfqYI1DTvHYAD6Kg%3D%3D"
}
},
"is_referral_code": false,
"created_at": "2020-08-10T09:17:47.059Z",
"updated_at": "2020-08-12T08:23:00.448Z",
"holder_id": "cust_D01yXiZdzuMl149QpUFBG58E",
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/6PMax4A9/publications?page=1&limit=10"
},
"redemption": {
"object": "list",
"quantity": null,
"redeemed_points": 0,
"url": "/v1/vouchers/6PMax4A9/redemptions?page=1&limit=10"
},
"object": "voucher"
}
```
As a result, the balance on both cards has changed.
## Points redemption
Finally, redeem the points from the card.
POST: [https://api.voucherify.io/v1/loyalties/\{campaignId}/members/\{memberId}/redemption](https://www.postman.com/voucherify/voucherify-s-public-workspace/request/owm90ir/redeem-reward)
Where campaignId is a unique id of a loyalty campaign and the memberId is a loyalty card code.
```json Request body theme={null}
{
"reward": {
"id": "rew_BLeJDzhaNTxpW3tFFhuFM5Wl"
}
}
```
```json 200 OK Response theme={null}
{
"id": "r_NSwKXZJ4c6vTxSNu3kPIHQVz",
"object": "redemption",
"date": "2020-08-12T08:49:48Z",
"customer_id": "cust_D01yXiZdzuMl149QpUFBG58E",
"amount": 700,
"customer": {
"id": "cust_D01yXiZdzuMl149QpUFBG58E",
"source_id": "src_id",
"name": "Jan Kowalski",
"email": "[email protected]",
"metadata": {},
"object": "customer"
},
"reward": {
"assignment_id": "rewa_GX8TKRItHlZQ7APDYL9E4RoR",
"loyalty_tier_id": null,
"voucher": {
"id": "v_2tEjwo4VAtcjUdJn5MW389JDtymUl7Hb",
"code": "Z3YKtBd1",
"campaign": "Loyalty Reward: 100 GBP Gift Card",
"campaign_id": "camp_G0pCbugE2QTDr70IuzoXlD8s",
"category": null,
"type": "GIFT_VOUCHER",
"discount": null,
"gift": {
"amount": 10000,
"balance": 10000
},
"loyalty_card": null,
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"publish": {
"count": 1,
"entries": null
},
"redemption": {
"quantity": 1,
"redeemed_quantity": 0,
"redeemed_amount": 0,
"redemption_entries": []
},
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX19kXzzIqUbIkoHJD2yABw+Rs3Fxx7X4LqW/VlOMeB9XP1juPVYEZQarfiVv6rcIdTGfkXElEzokyeScX9uYza0687FB53vRymgSTWXOpUSjECSXGF/2ZlMxOmzS1MkeQx4cMuhAnNhZSA==",
"url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19kXzzIqUbIkoHJD2yABw%2BRs3Fxx7X4LqW%2FVlOMeB9XP1juPVYEZQarfiVv6rcIdTGfkXElEzokyeScX9uYza0687FB53vRymgSTWXOpUSjECSXGF%2F2ZlMxOmzS1MkeQx4cMuhAnNhZSA%3D%3D"
},
"barcode": {
"id": "U2FsdGVkX1+n56O4nzi/ejeJOgcP3/k7hmexhoKPP4cHpMq8sIhycRkQnWcmeH1E5aF14kPoWrGO5rNpIN6/FNYoCPEIuU/lY637p3yrwTul9a2cgnkjCJ9TjiTjHZIZra0x52ARBz5uhDKGAet3Vw==",
"url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Bn56O4nzi%2FejeJOgcP3%2Fk7hmexhoKPP4cHpMq8sIhycRkQnWcmeH1E5aF14kPoWrGO5rNpIN6%2FFNYoCPEIuU%2FlY637p3yrwTul9a2cgnkjCJ9TjiTjHZIZra0x52ARBz5uhDKGAet3Vw%3D%3D"
}
},
"is_referral_code": false,
"holder_id": "cust_D01yXiZdzuMl149QpUFBG58E",
"updated_at": "2020-08-12T08:49:48Z"
},
"id": "rew_BLeJDzhaNTxpW3tFFhuFM5Wl",
"name": "100 GBP Gift Card",
"created_at": "2020-08-12T07:04:35Z",
"updated_at": null,
"parameters": {
"automation_id": null,
"campaign": {
"id": "camp_G0pCbugE2QTDr70IuzoXlD8s",
"balance": 10000
}
},
"type": "CAMPAIGN",
"object": "reward"
},
"result": "SUCCESS",
"tracking_id": "track_eWzw13pdCww=",
"voucher": {
"id": "v_3grX6kmKO8Y4zFDmd441DAzBI81lhjSr",
"code": "6PMax4A9",
"campaign": "Loyalty Program 2",
"campaign_id": "camp_qOrtQUT8sRZ0p6dEAkFpx97p",
"category": null,
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 700,
"balance": 0
},
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/6PMax4A9/publications?page=1&limit=10"
},
"redemption": {
"object": "list",
"quantity": null,
"redeemed_quantity": 1,
"url": "/v1/vouchers/6PMax4A9/redemptions?page=1&limit=10",
"redeemed_points": 700
},
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX1+35occP23L/yglhePqiCkecRPeIdaqfGy9RwojagJEbdkA9jISi4J22JXzMB7K3Yr3Uc6b9/7Y/BTFcEn/5Ne/IC6OdI4VMBCsGKc38s33IXD4fQyNW1BUmX0SscHbGw4dNTi35/0vEQ==",
"url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B35occP23L%2FyglhePqiCkecRPeIdaqfGy9RwojagJEbdkA9jISi4J22JXzMB7K3Yr3Uc6b9%2F7Y%2FBTFcEn%2F5Ne%2FIC6OdI4VMBCsGKc38s33IXD4fQyNW1BUmX0SscHbGw4dNTi35%2F0vEQ%3D%3D"
},
"barcode": {
"id": "U2FsdGVkX1+11QKTmAxc4j8dcFzwE0TxTVY3bu/HwZ463JPTPUc+Wi4TSkem0hBBWaYge2oTQCT+Ll8ATwTsDcTx1TVI08YgO0Nrman9gB/vns1uqu6A31TA4UZIMCdHLXpW4TRfqYI1DTvHYAD6Kg==",
"url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2B11QKTmAxc4j8dcFzwE0TxTVY3bu%2FHwZ463JPTPUc%2BWi4TSkem0hBBWaYge2oTQCT%2BLl8ATwTsDcTx1TVI08YgO0Nrman9gB%2Fvns1uqu6A31TA4UZIMCdHLXpW4TRfqYI1DTvHYAD6Kg%3D%3D"
}
},
"is_referral_code": false,
"holder_id": "cust_D01yXiZdzuMl149QpUFBG58E",
"updated_at": "2020-08-12T08:49:48Z",
"holder": {
"id": "cust_D01yXiZdzuMl149QpUFBG58E",
"source_id": "src_id",
"name": "Jan Kowalski",
"email": "[email protected]",
"metadata": {},
"object": "customer"
},
"object": "voucher",
"validation_rules_assignments": {
"data": [],
"object": "list",
"total": 0,
"data_ref": "data"
}
}
}
```
In the dashboard, you can see that the points from the loyalty card were spent on the reward and the balance was updated.
# Voucherify Core MCP
Source: https://docs.voucherify.io/guides/voucherify-core-mcp
Use AI to access Voucherify data
Model Context Protocol, or MCP, is an open standard that lets AI agents connect to and work with data from different platforms. It has two main parts:
* **MCP client:** The application where the AI agent runs, such as Claude Code, Cursor, Visual Studio Code, Windsurf, or others.
* **MCP package:** A service provided by another platform that defines which tools the AI can use and what data it can access. You host it locally.
Currently, only the local MCP package is supported.
Voucherify developers are planning to work on a remote MCP server. Reach out to [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager if you're interested in this solution.
## About Voucherify Core MCP
After [setting up the Voucherify Core MCP](#setting-up-voucherify-core-mcp) locally, you can connect AI tools directly to Voucherify. This way, these tools can read data regarding campaigns, promotion tiers, orders, products, vouchers, and more.
The Voucherify Core MCP is great for:
* Building AI tools that need data from Voucherify.
* Your engineers to create complex scenarios and integrate with other MCP integrations.
* Technical marketers who want to use natural language commands to fetch Voucherify data from multiple sources for analytics and other purposes.
The Voucherify Core MCP uses a number of endpoints for reading data. To prevent accidental changes to your campaigns, validation rules, and other data, creating and updating data is currently not supported.
### Voucherify Core MCP GitHub repo
To explore Voucherify Core MCP test engine, run it from source, or contribute, visit [Voucherify Core MCP repo](https://github.com/voucherifyio/core-mcp/). The repo also includes Python test scenarios showing MCP capabilities.
## Setting up Voucherify Core MCP
You can install the Voucherify Core MCP in different tools. Follow the guides for the most popular tools, or refer to the documentation of other supported tools.
### Prerequisites
To set up Voucherify Core MCP, you need:
* An MCP client (for example Cursor, Claude Desktop, Visual Studio Code)
* [UV installed](https://docs.astral.sh/uv/getting-started/) (remember to restart your client if you've installed UV for the first time)
* *Recommended*: Use a separate Voucherify server-side app ID and token for the MCP.
### Set up Voucherify Core MCP
To set up Voucherify Core MCP:
Open your MCP client.
Add the following code snippet to the `mcp.json` file in your client. This step may vary depending on your client; refer to the specific documentation for details.
```json theme={null}
{
"version": 1,
"mcpServers": {
"voucherify-core-mcp": {
"command": "uvx",
"args": ["voucherify-core-mcp", "--transport", "stdio"],
"env": {
"VOUCHERIFY_APP_ID": "",
"VOUCHERIFY_APP_TOKEN": "",
"VOUCHERIFY_API_BASE_URL": "https://.api.voucherify.io"
}
}
}
}
```
Copy your Voucherify server-side app ID and token from **Project settings** into the `mcp.json`.
Provide your Voucherify API base URL. For shared regions:
* Europe: `https://api.voucherify.io`
* North America: `https://us1.api.voucherify.io`
* Asia: `https://as1.api.voucherify.io`
Run the connection with the MCP server.
Open a new chat to start your conversation.
### Client-specific setup
To set up Voucherify Core MCP in specific clients:
In Cursor, go to:
Go to **Settings** > **Cursor Settings** > **MCP** > **Add new global MCP server**.
Paste the configuration mentioned above into your Cursor `~/.cursor/mcp.json` file. Alternatively, you can also install it in a specific project by creating `.cursor/mcp.json` in your project folder.
Open a new chat to start your conversation.
For more details, read [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol).
Starting from Cursor 1.0, click
for instant installation.
To configure the Voucherify Core MCP in Claude Desktop:
Paste the above-mentioned code snippet in the path depending on your operating system:
* macOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
* Windows: `%APPDATA%\Claude\claude_desktop_config.json`
Restart Claude Desktop app.
Open a new chat to start your conversation.
For more details, read [Claude Desktop docs](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop).
To configure the Voucherify Core MCP in Visual Studio Code:
Open MCP User Configuration. Alternatively, create the `.vscode/mcp.json` file just for the workspace you're working on.
Configure the `mcp.json` file as in Set up Voucherify Core MCP.
In the `mcp.json` file, click **Run** above `voucherify-core-mcp`.
In a new chat, select `voucherify-core-mcp` in the tool list and start your conversation.
For more details, read [Visual Studio Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
## Available functionalities
You can access the following endpoints with the Voucherify MCP to fetch data:
Displays a customer's current status and detailed information such as collected loyalty points, eligibility for rewards, and other profile data. You can use the customer's email, source ID, or Voucherify ID.
Retrieves a list of campaigns to view active, scheduled, or completed campaigns.
Displays a performance summary of ongoing campaigns, including comparisons with past activity (for example, previous week), to visualize trends and measure success over time.
Fetches details about the configuration of a promotion tier, such as reward levels or thresholds that determine customer benefits.
Checks and returns a customer's eligibility for specific campaigns, promotions, or reward rules, ensuring only qualified users receive incentives.
Returns information about better prices contextually by showing the top 5 best incentives.
For the best results, set the Application rule to **Partial** in Voucherify dashboard, Redemptions section, Stacking rules tab. Read the [Stacking rules](/orchestrate/stacking-rules) article for more details.
Retrieves the catalog of products, including attributes like pricing, availability, and categories.
Returns full details of a specific voucher, such as code, status, balance, and expiration date, to support redemption or troubleshooting.
Estimates the number of points a customer will receive in a given loyalty campaign for a specific order through earning rules with the order-paid type.
Identify your customer through (ID, source ID, or email) and provide details regarding the order, like ordered items (name or ID and quantity). The MCP will return the estimated number of points.
This scenario returns only an estimation, not a precise point value. If a campaign includes tiers, mappings, and multiple earning rules, the calculation becomes more complex. During final calculation, a customer may change tiers and earn more or fewer points depending on other factors.
## Best practices
Follow these practices to get the best results.
* Use precise date ranges (for example "July 2025 redemptions") instead of vague prompts like "recent redemptions".
* Describe exactly what you need: specific campaign names, product categories, or data types.
* Broad requests (for example "all campaigns in the last 3 years") usually lead to unclear results.
If results look off, reframe your query or try again. If the AI loops or repeats itself, redirect with a new question or start a new chat with a more detailed prompt.
Once you've got an answer you like, ask the client to:
* Suggest additional insights or next steps.
* Explain how it reached its conclusions to help refine your future prompts.
If you're not satisfied with answers or the overall process, use a different AI model. Each model is trained on different data, has their own strengths, and is best suited for various tasks.
### Prompt examples
Read the following prompt examples for inspiration on how to use Voucherify Core MCP:
Find customer by email `tom@example.com` (or `source_id`, or `customer_id`). Return the ID, `loyalty_balance`, `active_vouchers`.
Count total of customers in segment "VIP". List their basic details: name, email address, `source_id`. Turn the data into a CSV-friendly format.
List active campaigns with fields: ID, name, type, `start_date`, `end_date`.
Get voucher by code "BK-4829" and show: status, `redemption.count`, `redemption.limit`, `balance` (for gift or loyalty cards).
Get campaign "BK-Sept-20OFF" data: total budget, spent budget, redemption counts, and per-customer caps.
Show the campaign with the most coupons generated. Return redemption data for this campaign.
Show me the best performing campaign in terms of number of successful redemptions. Return the budget - the total discount value that was applied.
Get redemptions aggregated by day between 2025-09-01 and 2025-09-03 (timezone Europe/Warsaw).
Get best deals for a customer with this email address. They have these items in their cart: Voucherify T-shirt (SKU: VCH-TST-001, quantity: 1, price: 25 USD), Voucherify Mug (SKU: VCH-MUG-002, quantity: 2, price: 15 USD each). Suggest if there's anything they can do to get even better deals.
The number of API calls made by the Voucherify MCP depends on your question. Complex queries, like get best deals for a given customer, will need more API calls, while simple questions can be limited to just a few or even one, like get campaign summary. The MCP client will ask for confirmation to make an API call.
The API calls made with the Voucherify MCP are included in your billing period.
## Use examples
You can interact with the Voucherify MCP using natural language in your AI agents, just as you would with other AI tools.
In this scenario, you want to learn what best deals a customer, Alex Doe, can get if they have a specific cart. The scenario used is `get_best_deals`.
The Voucherify Core MCP ran 9 API calls to find out what best deals Alex Doe can get at the moment and what they'll get if they meet specific conditions.
In this case, one prompt was enough to propose best deals for Alex Doe, like:
* Adding one product to meet a bundle promotion,
* Take part in Friday happy hours promotion,
* Becoming a VIP customer,
* Using a gift card.
In this scenario, you want to learn what Voucherify campaigns there are in the project and if they're active, have time frames set, and similar details. This gives a quick overview of needed info about campaigns.
The Voucherify Core MCP runs 8 API calls to fetch the requested data.
The MCP returned campaign details and summarized the campaigns by their type, status, and provided time frames. For example, the response shows:
* The Loyalty program campaign is still inactive as it is a draft;
* The Friday Happy Hours campaign is valid on Fridays, between 15:00 and 17:00;
* BLACKFRIDAY2025 is active, but the time frame is set to between 28 and 30 November 2025.
## Troubleshooting and feedback
The Voucherify MCP is still under development and we'd love to have your feedback to improve it. Also, if you've encountered any issues, let us know. Contact [Voucherify support](https://www.voucherify.io/contact-support) or your account manager.
## Disclaimer
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/specification/2025-06-18/basic) is a new open-source standard and may still have potential vulnerabilities. The Voucherify MCP server setup and instructions are provided “as is” and without warranties. Use is at your own risk.
Voucherify is not liable for issues caused by incorrect setup, misuse, or security gaps related to MCP.
If you have questions or need support, reach out to our team - [we're here to help](https://www.voucherify.io/contact-support).
# Voucherify Docs MCP
Source: https://docs.voucherify.io/guides/voucherify-docs-mcp
Connect AI tools like Claude, Cursor, and VS Code to Voucherify documentation using MCP
Model Context Protocol (MCP) is an open protocol for a standardized connection between AI tools and other tools, like documentation.
You can connect your AI tool, like Claude, Cursor, or others, directly to Voucherify documentation. This way, when you ask questions about Voucherify to your AI tool, it will base its answers directly on the content of the documentation instead of on the trained data or web-based search. This ensures that the answers are always up-to-date with the documentation.
## Documentation MCP tools
The MCP supports two tools for agents to use:
* Search: Searches across the documentation to find relevant content. Use this to discover information or find pages matching a query.
* Query docs filesystem: Reads and navigates the documentation's virtual filesystem using shell-style commands. Use this to retrieve page content, browse the docs structure, or extract specific sections.
Agents determine when to use each tool based on the context of the conversation.
## Connect to documentation MCP
Voucherify documentation MCP can be accessed through the following URL:
```Voucherify docs MCP theme={null}
https://docs.voucherify.io/mcp
```
You can install the MCP through the **Copy page** context menu in this page:
1. Unroll **Copy page** drop-down menu at the top of this page.
2. Select:
* **Copy MCP Server** to copy the MCP server URL to clipboard.
* **Copy MCP install command** to copy the `npx` command to install the MCP server.
* **Connect to Cursor** to open Cursor and install the MCP server.
* **Connect to VS Code** to open Visual Studio Code and install the MCP server.
In Claude settings:
1. Navigate to the **Connectors** page.
2. Select **Add custom connector**.
3. Add Voucherify MCP server name and URL.
4. Select **Add**.
5. When using Claude, select the attachments button (the plus icon).
6. Select Voucherify MCP server.
See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/develop/connect-remote-servers#connecting-to-a-remote-mcp-server) for more details.
Use the following command to connect Voucherify documentation MCP to Claude Code.
```bash Claude command wrap theme={null}
claude mcp add --transport http VoucherifyDocsMCP https://docs.voucherify.io/mcp
```
See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.
In Cursor:
1. Open the command palette.
2. Search for **Open MCP settings**.
3. Select **Add custom MCP**. This opens the `mcp.json` file.
4. In `mcp.json`, configure your server:
```json theme={null}
{
"mcpServers": {
"VoucherifyDocsMCP": {
"url": "https://docs.voucherify.io/mcp"
}
}
}
```
See the [Cursor documentation](https://cursor.com/docs#installing-mcp-servers) for more details.
In VS Code:
1. Create a `.vscode/mcp.json` file.
2. In `mcp.json`, configure your server:
```json theme={null}
{
"servers": {
"VoucherifyDocsMCP": {
"type": "http",
"url": "https://docs.voucherify.io/mcp"
}
}
}
```
See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.
## Using MCP servers
You can connect multiple MCP servers to your AI tools. Connected MCP servers don't consume context until the AI calls a search tool. The AI decides when to search based on your query, so it doesn't search every connected server for every question.
When the AI searches, each query returns multiple results that add to the conversation's context. If the AI searches several servers for a single question, this can use up significant context.
Best practices for using multiple MCP servers:
* Connect only the MCP servers that will be useful in your current work.
* Be specific in your questions, so the AI searches the most relevant server.
* Disconnect servers you're not using to reduce context usage.
# ActiveCampaign
Source: https://docs.voucherify.io/integrations/activecampaign
In this short tutorial, you will learn how to connect Voucherify and ActiveCampaign accounts. This integration enables you to sync customers and exchange data between both accounts.
The ActiveCampaign integration supports data exchange between ActiveCampaign and Voucherify.
Data sent from ActiveCampaign to Voucherify uses [webhook limits](/guides/limits#webhooks).
Sending codes from Voucherify to ActiveCampaign consumes message limits. You can read more about message limits in our [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1).
You can send Voucherify codes to your ActiveCampaign account and later on share them with customers in an automated email campaign. To do so, you can use standard distribution or as a part of the referral program (distribution channel for rewards).
## Integrate Voucherify with ActiveCampaign
Open your Integrations tab in the Home section and expand ActiveCampaign integration.
Copy your API key and URL address (the endpoint) from ActiveCampaign settings.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
Paste the copied data into Voucherify. **The API endpoint should start with `https://`.**
Click **Connect** and next synchronize contacts to Voucherify by mapping one of the ActiveCampaign fields (email or ID) to Voucherify customers. Confirm the mapping by clicking **Enable**. You can change the mapping later on.
Source\_id is a unique identifier for a customer in the Voucherify database. When you use validation rules that require customer verification, for example, "one redemption per customer," each time someone tries to redeem the code, Voucherify verifies if the source\_id attached to this customer wasn't already used to redeem the code in this campaign.
When the mapping is ready, and API access data are in place, you can confirm integration. From now on, you can use ActiveCampaign as a channel in [Voucherify distributions](/integrations/distributions-overview) and as a channel for automatic delivery of [referral rewards](/build/create-referral-campaign).
You can test the integration by adding a new contact to your ActiveCampaign account and then checking whether the new contact appeared in Voucherify.
The integration will only synchronize the contacts added after the integration is confirmed. It will not automatically map old contacts. You can upload your ActiveCampaign contacts by a [CSV import](/prepare/customers).
**Before you create Voucherify Distribution and map codes, you need to add the necessary custom fields to ActiveCampaign profiles. The fields will represent code attributes.**
## Mapping Voucherify codes
In the [Distribution Manager](/integrations/create-distribution), you can choose ActiveCampaign as a distribution channel. As a result, Voucherify will deliver codes to customer profiles in your ActiveCampaign account. Then, you can send these codes to your customers using ActiveCampaign email templates.
After choosing the channel, you can see the voucher attributes such as publication (sending) date, balance (value) of the code, and finally, the code itself. To map code attributes, choose the fields added to the ActiveCampaign. If you can't choose ActiveCampaign as a channel, check if you added your custom fields to ActiveCampaign profiles. Go to the ActiveCampaign dashboard and choose **Lists** > **Manage Fields** and **Add Field**.
You can add more fields that are going to represent:
* Code of the published voucher (already added).
* Publication date.
* Value of voucher.
Visit [this tutorial](https://www.activecampaign.com/learn/guides/what-are-custom-fields) to learn more about fields in ActiveCampaign.
## Distribution with ActiveCampaign
After adding the field, you can use it in [Voucherify Distribution](/integrations/distributions-overview).
Let's create a distribution of \$25 discount codes for all new customers via ActiveCampaign.
* Choose a distribution trigger – customer entering segment.
* Select the action – send codes from the campaign.
* Build a [segment](/prepare/customer-segments) of message receivers – to attach a code to every new customer in ActiveCampaign create a segment with filter ***Source*** *is ActiveCampaign*.
In Channels, select ActiveCampaign.
Enable ActiveCampaign as your distribution channel and proceed to map fields.
Now, Voucherify codes from the given campaign will be published (assigned) to a single customer profile the moment they enter the predefined customer segment.
You can also use ActiveCampaign as a channel that delivers rewards to referrers. Choose ActiveCampaign as a notifications channel and send rewards to customer profiles in ActiveCampaign. Same as before, a code will be presented in the customer profile as a custom field.
# Airship
Source: https://docs.voucherify.io/integrations/airship
Airship is a customer relationship management (CRM) platform that seamlessly manages customer interactions, streamlines sales processes, and cultivates lasting relationships.
This integration allows you to send data from Voucherify to [Airship](https://www.airship.com/ "Airship mainpage"). You can inform your customers of promotions and distribute customized coupons. With event-triggered Airship campaigns, you can react to various occasions with new Voucherify coupons and gift cards, which will be delivered to your customers.
You can trigger sending messages through action-based delivery and, as a result, send out codes to customers:
* During bulk delivery to a customer segment,
* When a customer enters or leaves a customer segment,
* As a response to an outstanding order or a custom event.
## How does the integration work?
The example below shows the implementation of the following scenario:
* Customers who haven’t visited the store for some time should be offered a discount coupon to draw them back.
* Only the customer who has received the voucher should be able to redeem it.
* The customer should receive personalized coupons via email.
## Setting up the integration in Voucherify
In Voucherify, generate API integration keys for Airship.
1. Go to **Project Settings**, and in the **General** tab, scroll down to **Integration Keys**.
2. Click the plus button on the right.
3. Fill in the **Name** for your key.
4. Choose your role from the **Role** drop-down list.
5. Choose **Airship** from the **Integration** drop-down list.
6. Click **Create Integration API Key**.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
## How to distribute Voucherify’s unique coupons with Airship
Follow these steps to distribute coupons with Airship.
### Step 1: Prepare a Voucherify campaign to engage inactive customers
In this example, create a [unique coupon campaign](/build/create-discount-coupons) used, in which the whole cart is discounted by 10€.
Set the campaign to **Customers will be allowed to join the campaign only once**. As a result, the customer will receive only one code from the campaign. Each subsequent code publication for the customer who has already received one will return the original code. If this setting is turned off, each subsequent code publication for that customer returns a new coupon code.
The campaign ID will be needed later. To obtain the campaign ID, use [the GET List Campaigns endpoint](/api-reference/campaigns/list-campaigns) or copy it from the campaign list view.
### Step 2: Configure an Airship External Data Feed, which will publish a new code from the campaign
In your Airship project, go to **Settings** > **Project configuration** > [External Data Feeds](https://docs.airship.com/guides/messaging/user-guide/personalization/sources/external-data-feeds/ "Airship documentation") and select the **Add data feed**. An **Add data feed** box will appear. Fill it in as follows:
* **Friendly name**: this is the name of the Content API endpoints. It can’t be changed afterward. In this case, it is named New Reactivation Voucher because it will send out voucher codes from the Customer Reactivation campaign.
* **Feed ID**: unique feed identifier. In this case: new\_reactivation\_voucher.
* **Description**: a short description of the data feed.
* **Request URL**: type in the address of the Create Publications endpoint: `{{API_URL}}/v1/publications/create?campaign=[Voucherify campaign ID]&customer={{ua_named_user_id}}`.
* You can find your API URL in your Voucherify **Project Settings** in the **Application Information** section under the **API endpoint** label.
* [The Create Publication API endpoint](/api-reference/publications/create-publication) requires at least two parameters:
* Voucherify campaign ID.
* Customer ID who the newly generated voucher code will be assigned to. This value will be mapped to the customer `source_id` field in Voucherify. The `{{ua_named_user_id}}` variable is a customer’s unique identifier in Airship. You can see the list of user attributes and add custom ones under the **Attributes** option in the **Audience** menu.
* Confirm request URL domain: type in `api.voucherify.io`.
* In the **Headers** section
* Add `X-App-Id` and `X-App-Token` headers generated in **Setting** up the integration – Voucherify.
* Set `Content-Type` header to `application/JSON`.
Click **Next** and confirm that you have the right to make API requests to your Voucherify account. In this step, you can also throttle the requests. This option will make sure that a marketing campaign won’t deplete your API limits.
In the last step, you can define the object location.
### Step 3: Use the External Data Feed in an Airship message
1. Create a new Airship message. This example is a one-time email outbound message that targets customers who have not visited an e-commerce site in 30 days.
2. Prepare the email content. In Airship, you can use the curly braces to insert, e.g., the customer’s name into the email content. As a result, the Data Feed created in step 2 will be called, and its response will be parsed to display the desired details to the customer.
* To invoke the configured Data Feed with its parameters for Voucherify to publish a new code to an email’s recipient and extract only the published voucher’s code from the response, use this snippet:
`{{#feed "reengage_coupon"}}{{voucher.code}}{{/feed}}`
3. When you publish your campaign and messages are sent (on a scheduled time or as soon as possible), each message will be tailored to every customer and will contain the voucher code that has been published to them.
4. You can see each publication call made during the email send-out in the Audit Log in your Voucherify Dashboard.
You can also view the generated codes in the campaign dashboard in the Vouchers tab.
## Scenario: Referral code and loyalty card publication
Assigning a referral code or loyalty card is very similar to the one described above. All you need to do is change the campaign name parameter to the referral or loyalty campaign that you have created. Visit the Voucherify Help Center to learn more about [referral programs](/build/referral-campaign-overview) and [loyalty programs](/build/loyalty-campaign-overview).
In this example, the customer’s code will be retrieved from the referral program with the ID `camp_f0bKCWIYyTfOept56g2UMLY7`. If the Customer will be allowed to join the campaign only once the option is turned on in the referral program configuration, the customer who is a program member will receive their already-assigned referral code. If a referral code hasn’t been assigned yet to the customer, they will receive the code, which will be present in the response.
First, configure the **Data Feed**.
Then, to retrieve and embed the referral code, use the following code: `{{#feed "referral_code"}}{{voucher.code}}{{/feed}}`
The customer can share their referral code with a friend. When they use it during a purchase, the referrer will be awarded the gift you’ve set up in the Voucherify Dashboard.
# Amplience
Source: https://docs.voucherify.io/integrations/amplience
Learn how to integrate Voucherify and Amplience
## What is Amplience?
[Amplience](https://amplience.com/) is a Content Management System (CMS) that helps businesses to manage and deliver digital content across various channels and devices. Thanks to the [Content Field Extensions](https://amplience.com/developers/docs/schema-reference/schema-examples/extensions/), you can fetch resources from your Voucherify account and assign them to a specific Amplience content.
You can link the Amplience content to the following Voucherify resources:
* [Campaigns](/build/create-discount-coupons),
* [Earning rules](/build/loyalty-campaign-overview#earning-rules),
* [Promotion tiers](/api-reference/promotions/promotion-tier-object).
With the Content Field Extensions, you can easily connect the content created in Amplience to Voucherify campaigns, enhancing the customer journey and your marketing team experience by:
* Adding links to terms and conditions to your campaigns so that customers know what they need to do to receive the discounts. The terms and conditions might be similar or the same for different campaigns, making it easier for the marketing team to manage it in one place.
* Adding banners and the rules explanations to the Earning Rules so that the customers know how they can earn points. In case a banner or a logo changes, the change will be visible after updating the content in Amplience.
* Adding banners and promotion details so that your customers know when they are eligible for the discounts.
With Amplience, it is easier to update the conditions, banners, logos, and other promotional material from one place.
## Setting up the integration in Voucherify
On the Voucherify side, you will need to generate API integration keys for Amplience.
1. Go to **Project Settings** and in the **General** tab, scroll down to **Integration Keys**.
2. Click the plus button on the right.
3. Fill in the **Name** for your key.
4. Choose your role from the **Role** drop-down list.
5. Choose **Amplience** from the **Integration** drop-down list.
6. Click the **Create Integration API Key** button.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
## Amplience
To perform the next steps, your account needs to have the Developer role assigned and the Development tab visible.
### Content field extensions
1. In the **Development** tab, open the **Extensions** tile and click the **Register extension** button.
2. Choose the **Content field** category and fill in the required fields. Set the URL to `https://cms-integrations.voucherify.io/frontend/amplience`. If your project uses a region other than EU1, the URL should have the prefix `https://.cms-integrations.voucherify.io/frontend/amplience`; for example `https://us1.cms-integrations.voucherify.io/frontend/amplience`.
3. In the **Permissions** tab, enable all permissions with the exception of the **Allow downloads** permission (it should be **Off**).
4. Fill in your **Installation parameters** with the API Integration keys for Amplience.
```json App Keys theme={null}
{
"APP_ID":"[your Amplience integration keys ID]",
"SECRET_KEY":"[your Amplience integration secret key]"
}
```
5. Click the **Save** button to add the new extension.
### Content type schemas
1. In the **Development** tab, open the **Content type** schema tile, click the **Create schema** button.
2. Choose **Code from scratch** and click the **Get started** button.
3. Specify the content type **Schema ID**, which should be a valid URI. For example `https://voucherify.amplience.com/voucherify-resources` and choose the **Content type** validation level.
4. Add your required elements to the JSON schema of this content. You do not have to change anything except the properties object. The most important thing is to put a connection to the extension (`“uixtension”`) into the properties object. Below is an example of the basic configuration of the schema. The name of `"ui:extension"` should match the name of the Content Field Extension that you created earlier:
```json Schema theme={null}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://voucherify.amplience.com/voucherify-resources",
"title": "[Title]",
"description": "[Description]",
"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],
"type": "object",
"properties": {
"name": {
"title": "[Content name]",
"type": "string",
"minLength": 0,
"maxLength": 20
},
"voucherifyResources": {
"ui:extension": {
"name": "voucherify-resource"
}
}
}
}
```
5. Click the **Save** button to save the changes in the content type schema.
If you need to update the content type schema, apart from saving changes, you will also need to use **Sync content type**.
### Content types
1. In the **Development** tab, open the **Content types** tile, and click the **Register content type** button.
2. Pick a schema you created in the previous step, specify the **label**, and, optionally, choose an icon or a card.
3. In the **Associated repositories**, select **Content**.
4. Click the **Save** button to add your content type.
If you need to update the content type schema, apart from saving changes, you will also need to use **Sync with schema**.
At this point, you can create your own content and use the Voucherify app resources: **Campaigns**, **Earning Rules**, or **Promotion Tiers**.
Once integrated, Amplience automatically creates a new metadata array for linked Voucherify Campaigns, Earning rules, or Promotion tiers upon the first connection. Each **amplienceContentIds** contains the **Content ID**. If a Voucherify resource is linked to several Amplience entries, all those entries will be listed in metadata as **amplienceContentIds** with respective **Content IDs**.
## Linking Amplience content to Voucherify
The integration between Voucherify and Amplience allows your team to create and manage content directly in Amplience.
Once the integration is complete, the content with Voucherify fields can link the content to a Voucherify campaign, promotion tier, or earning rule.
In this example, a content type has a name, description, and terms and conditions fields. It can be linked to Voucherify’s resources.
Voucherify will show the list of all the resources for you to choose from (you may need to save the content first to be able to retrieve information from Voucherify).
Once you choose the resource and the content is published, the **Content ID** will be associated with the campaign, earning rule, or promotion tier in Voucherify.
The linked Content IDs will be returned via the Voucherify API in the form of metadata. Once you retrieve the campaign, promotion tier, or earning rule details from Voucherify via the API, the Content ID list will be returned. Your development team must use the returned Amplience Content IDs to fetch the content from the Amplience CMS.
If a campaign uses a voucher metadata schema, updating the content for that campaign will change the metadata of every voucher that was not published and not redeemed. Depending on the number of vouchers, this action can take from a couple of minutes to hours for multi-million voucher campaigns. During that time, the campaign will not allow any changes.
# Autopilot
Source: https://docs.voucherify.io/integrations/autopilot
This integration allows you to add a new contact from Autopilot to Voucherify automatically. Plus, you can enhance the profile of a contact being stored with custom properties stored in Autopilot.
## Prerequisites
* Zapier account
* Autopilot account (generated API key for Zapier)
* Voucherify account (keys from project settings)
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
## Zapier configuration
From the [invitation link](https://zapier.com/developer/invite/62387/cdcdf9275d825dff01c4da836b4c445f/), create a new Zap.
Click the **Create a new Zap** button. In the Trigger Service drop-down, choose Autopilot, and choose a trigger using the additional drop-down – **Contact Added to List**.
Connect Autopilot account by providing generated access key.
Test connection by clicking the **Test** button.
In the Action Service drop-down, choose Voucherify (invite link) to send your Autopilot data to. In the Action drop-down, choose your desired action and click Continue - **Create Customer**.
Select proper data from Autopilot and forward to Voucherify. The most important fields are:
* **Source Id**: Autopilot contact ID or email.
* **Email**: Customer email, Customer Name.
Add custom properties which will be useful for defining distributions and corresponding customer segments: title, company etc. You can use your custom names for properties.
Go back on your new Zap screen.
Try out your Zap using the sample/test data shown next to your fields. When you have finished this step, click Continue. As a result of the test, you will see a new customer in Voucherify.
Give your Zap a name. You may find it easiest to use the same Title/Name given to the corresponding feed.
Click the Make Zap Live button. That's it!
# Batch
Source: https://docs.voucherify.io/integrations/batch
Integrate with Batch
This integration allows you to send data from Voucherify to [Batch](https://batch.com/). You can trigger sending messages through action-based delivery and, as a result, send out codes to customers:
* During bulk delivery to a customer segment,
* When a customer enters or leaves a customer segment,
* As a response to an outstanding order or a custom event,
* And more!
The integration with Batch consumes message limits for sending codes in accordance with the [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1). The customer must be already recorded in Batch before the action-based delivery.
## Setting up the integration
To integrate Voucherify and Batch, follow these steps.
### Batch
To configure the connection, you'll need a set of API keys available in the [General App Settings of Batch](https://doc.batch.com/dashboard/settings/app-settings/).
The keys need to be provided in Voucherify.
### Voucherify
To configure the integration in Voucherify:
1. Head to the Home section.
2. Go to the Integrations tab.
3. Scroll down to the Batch integration.
4. Click the Connect button to open the integration menu.
5. Provide the API keys generated in [Batch](https://doc.batch.com/dashboard/settings/app-settings/).
## Distribution process
Once the Batch integration is enabled, you can start sending data to Batch in a [distribution](/integrations/distributions-overview).
Customer data bases
Your Voucherify customer database should be up-to-date with your Batch customer database for the distribution to work correctly.
As a result the data shared via Voucherify will be stored in the user’s attributes in Batch.
```
{
u.voucher_code "blackfriday-3LBhfTr"
u.voucher_code_barcode "https://dl.voucherify.io/api/v1/assets/barcode/id"
u.voucher_code_publication_date 09/11/2023 14:09UTC
u.voucher_code_qr "https://dl.voucherify.io/api/v1/assets/qr/id"
u.voucher_code_value "$10.00"
}
```
If the user attribute is enabled in the [Custom Data configuration](https://doc.batch.com/dashboard/settings/app-settings/#custom-data-management), you can start using the provided data in messaging.
The detailed process on how to use coupon codes is described in [this Batch article](https://help.batch.com/en/articles/8601919-how-to-connect-batch-to-voucherify).
# BigCommerce
Source: https://docs.voucherify.io/integrations/bigcommerce
Discontinued plugin
The BigCommerce v3 plugin is not maintained anymore and it will not receive any updates or bug fixes, as well as it cannot be installed.
However, Voucherify is still compatible with BigCommerce and you can integrate the platforms through the API.
Contact [Voucherify support](https://www.voucherify.io/contact-support) for more information.
Connect your store with the Voucherify account and let your customers redeem Voucherify promo codes and gift cards in the storefront. BigCommerce integration enables you to sync your customers, orders, products, and their variants. All updates from your BigCommerce dashboard are sent to your Voucherify database in real-time.
The BigCommerce integration supports data exchange between BigCommerce and Voucherify.
Data synced from BigCommerce to Voucherify, including customers and products, uses [webhook limits](/guides/limits#webhooks).
Code validation and redemption requests sent from BigCommerce to Voucherify consume [API limits](/guides/limits#api-limits).
Before you start
* Connecting Voucherify to your BigCommerce account will automatically disable BigCommerce gift certificates and coupons. Before installing integration scripts, make sure you have made the necessary migrations and are ready to use Voucherify coupons and gift cards only.
* The latest v3 plugin version was released on 23/08/2021. It adds support for stacking gift cards and fixed price discounts. If you connected your store before that day, you need to re-install your integration to access new features. [Read how to upgrade your integration](#update-integration).
* A gift card code cannot have more than 13 characters in Voucherify to be used in BigCommerce.
## APIs for BigCommerce
Integrations created before 2021-08-23 use the **v2 version** of Voucherify and BigCommerce API. BigCommerce stores connected after that date will have **the latest v3** **version** installed automatically.
To verify which plugin version is installed in your BigCommerce store, either go to the BigCommerce dashboard > Storefront > Script Manager *or* if you are using Multi-Storefront go to **Channel Manager** > **Edit Storefront Settings** > **Script Manager**.
In v2 API there will be *two* scripts from Voucherify integration. In v3 API, you will see *four* Voucherify scripts.
### Summary of versions v2 and v3
Here's the list of the features supported in both v2 and v3 plugin versions.
#### V2
* Voucherify coupons
* Percentage discount
* Amount discount
* Free shipping discount
* Unit discount with free product *(no support for product variants)*
* Voucherify gift certificates
* Voucherify codes can work in parallel with BigCommerce promotions
* Synchronization of customers, products and orders
* Synchronization of customer groups and product categories
* Validation rules
* Locking session until the order is created
#### V3
* All features supported in version v2
* Stacking multiple gift cards in a single order *(up to 5 gift cards per transaction)*
* Fixed price discount type (coupons)
* Unit discounts with free product **or product variants** *(add-new-items effect only)*
* Referral code redemptions
* Only double-sided referral programs
* Referral code must have a discount assigned
* Dynamic discounts based on mathematical and logical formulas using metadata
## How to upgrade to the latest (v3) BigCommerce plugin?
If you'd like to upgrade to the latest version of the Voucherify and BigCommerce plugin, you need to reinstall your integration with BigCommerce. It comes down to [disconnecting](#disconnect-bigcommerce-plugin) Voucherify and BigCommerce accounts and [connecting](#install-bigcommerce-plugin) them again.
## Disconnect BigCommerce plugin
Log in to your Voucherify account and follow the steps below.
1. Go to the Integrations tab and scroll down to the BigCommerce integration.
2. Click on **Settings** and **Uninstall scripts**.
3. Confirm with **Update configuration**.
4. Click on **Disconnect** to disconnect Voucherify from your BigCommerce store.
Voucherify coupons and gift cards can't be validated or redeemed from this moment on. Follow the steps below to restore the connection and install the latest version of the plugin.
## Install BigCommerce plugin
1. To connect both accounts, start by logging into your BigCommerce account. Open **Advanced Settings.**
2. In the next step, you need to generate API keys for Voucherify integration. Go to **API Accounts** and choose to **Create API Account > Create V2/V3 API Token**.
3. Name your new API Account.
4. The API account for Voucherify needs the following OAuth Scopes in your BigCommerce shop:
* Content (modify)
* Checkout Content (modify)
* Customers (read-only)
* Marketing (modify)
* Orders (read-only)
* Order Transactions (read-only)
* Products (read-only)
* Carts (modify)
* Checkouts (modify)
* Informations & Settings (read-only)
5. Choose **Save** to confirm. Your API account credentials will be automatically downloaded in the .txt file on your device.
6. Now, log into your Voucherify account. Open the **Integrations** menu and click Connect in the BigCommerce integration.
7. Open the .txt file generated in the BigCommerce panel. Copy and paste your Client ID, API path, and API keys.
By marking the respective checkboxes, you can optionally enable the following features:
* Make calculations based on retail prices (MSRP)
* Allow applying coupons with other promotions – by enabling this option, **Voucherify's coupons will apply on top of BigCommerce's automatic promotions** (both Voucherify coupons and BigCommerce promotions can be applied)
Lastly, you need to map the source ID (unique customer identifier in Voucherify) to the BigCommerce field. You can choose if the source ID in Voucherify will be mapped to the BigCommerce customer ID or the customer's email.
Confirm with **Connect** to sync both accounts. The app will confirm if the installation is complete with the '**Connected**' button next to the BigCommerce integration.
8. Now, click **install scripts** to sync databases and enable your customers to validate and redeem Voucherify codes.
9. Click **Update Configuration** to finish setting up your integration.
## Update integration
1. Go to Integrations > BigCommerce > Settings.
2. When needed, you will be able to uninstall, edit, and reset your scripts.
3. Click **Update Configuration**.
## Data synchronization
When your BigCommerce store is connected, data are synced in real-time. It means that every time you add or update a customer, order, product, or product variant to BigCommerce, it is automatically created in the connected Voucherify account.
The following guides will help you learn how to manage customers, products and orders in Voucherify:
* [Customers](/prepare/customers)
* [Products](/prepare/products)
* [Orders](/prepare/orders)
Thanks to Voucherify metadata, you can also sync the BigCommerce customer groups and product categories. Then, you can use synced data to create campaign rules and limits.
Visit our guide on metadata to learn more about how metadata works in Voucherify. [Read more.](/guides/metadata-mapping)
## Synchronization of customer groups
Customer groups from BigCommerce are mapped to Voucherify metadata properties. Therefore, to start, add the respective metadata fields in Voucherify customer profiles.
1. Open the Projects Settings and then Metadata Schema.
2. Create a new nested property with fields:
* **id** (number)
* **name** (string).
Nested metadata means that they will be combined and included in the single metadata object representing the BigCommerce group.
3. Now, find the Customers tab to add the metadata object with group attributes to customer profiles.
4. Then, assign the created nested property to the new object: **bigcommerce\_customer\_group**.
To sync data properly, you need to use the same name for this object (bigcommerce\_customer\_group) in your Metadata Schema.
From now on, if you assign a customer to a customer group in BigCommerce, Voucherify will automatically update their profile (you can see it in the metadata section).
Now, you can use your customer groups to create validation rules (limits and rules of your promotions). [Go here to learn more.](#validation-rules)
## Synchronization of product categories
Product categories are automatically mapped to a predefined metadata field in Voucherify. If you add a new product with categories or update an existing one, the assigned categories will be visible in the product details.
If you select more categories for the product, Voucherify will display all values as a list.
You can find IDs of product categories by clicking on the category name in the BigCommerce dashboard.
When the product categories and customer groups are synced, you can use them to create the validation rules described below.
## Validation rules
Voucherify integration supports validation rules based on:
* Order structure and order volume
* Budget constraints (like redemptions per customer, redemptions per campaign, and so on)
* Products categories
* And customer groups
If you're not familiar with the validation rules builder, [follow this guide](/optimize/validation-rules-reference) first.
### How to create rules based on customer groups?
If you want to limit code usage to a particular BigCommerce customer group(s), you need to create validation rules based on metadata in the Audience category.
### How to create rules based on product categories?
You can use your product categories to offer discounts and gift cards applicable to specific product groups. To model this in practice, you need to create a product collection in Voucherify and use this collection to build a respective validation rule.
Remember that BigCommerce categories in Voucherify are represented by their IDs.
### Step 1: Create products collection
1. Go to the Products section and click **Find and apply filters.**
2. Create a product collection based on a custom attribute (metadata) representing the proper product category.
3. When creating collection criteria, you can exclude or include a specific product category using its BigCommerce ID.
4. Confirm collection filters with **Apply** and click **Create dynamic collection** to save applied filters and use them in validation rules.
5. Name your collection and confirm with **Save**. The collection is ready to use in your validation rules.
You can read more about product collections in [this guide](/prepare/products).
### Step 2: Add validation rules to your coupons/gift cards
When creating new coupons or gift cards, you can add the following product-specific rules.
* **Discount selected:** apply discount/gift card to items from a chosen product category.
* **Order structure validation rules:** require an item from a particular product category in the customer's cart.
When it comes to the **Order structure** validation rules, you can use product categories to define the required cart items, subtotals, and quantity. Go [here](/optimize/validation-rules-reference#product-metadata) to read more.
## Coupons and gift cards
When your data are synced, and campaigns are live, your customers can enter Voucherify coupons and gift cards when purchasing in your store.
**Before you start**
* **Shipping fee** - Gift cards cover the application of a discount to shipping. When applying coupons, the discount doesn't cover the shipping fee.
* **Unit discounts** work only with the discount effect *Add new items* and *Add multiple items* combined with *Add new items*. BigCommerce doesn't support the *Add missing items* effect.
* The maximum allowed **Gift card code length** for a BigCommerce integration is at most **13** characters long.
* The maximum allowed **Coupon code length** for a BigCommerce integration is at most **43** characters long.
### Validation
When a customer applies a coupon or gift card at the checkout, Voucherify API validates the code and sends the response to the BigCommerce store.
The code is applied only if all rules and limits assigned to the code are met.
### Redemption
The customer can confirm the order and redeem the code when the validation succeeds. Redemption is always preceded by validation, so any updates and changes that come after applying the code will be taken into account when redeeming the code. The order details are noted in both BigCommerce and Voucherify dashboards.
## Gift cards
Gift vouchers from Voucherify are mapped to Gift Certificates in BigCommerce. So, all codes that are created in gift card campaigns don't work as coupon codes in BigCommerce anymore (they are recognized as BigCommerce Gift Certificates). The gift vouchers can be redeemed multiple times as long as there is a positive balance on the card.
You can create two types of gift cards in Voucherify:
* **Generic gift card** – a single gift card code with a predefined balance, typically for multi-use.
* **Bulk codes** – one-off codes with the same balance grouped in a campaign. Each unique code can be assigned (published) to a specific customer who becomes the gift card owner as a result.
If you need help with creating gift cards, follow this detailed tutorial [here](/build/gift-card-overview).
### Stacking gift cards
Your customers can apply more than one gift card to the same cart (up to 30 gift cards). Before clicking **Apply**, a customer needs to list gift card codes one by one, separating each of them using a comma.
The gifts will be applied in the order they were listed.
## Discount coupons
You can create a [unique codes or generic codes campaign](/build/create-discount-coupons) with percentage, amount, unit, free shipping, and fixed price discounts.
You can read the description of each discount type in [this guide](/build/discount-types-and-effects).
You can create two types of coupon campaigns in Voucherify:
* Generic code – a single discount code with a predefined balance, typically for multi-use.
* Bulk codes – one-off codes with the same discount grouped in a campaign. Each unique code can be assigned (published) to a specific customer who becomes the code owner as a result.
## Fraud protection
When your customer applies a coupon or gift card at the checkout, Voucherify validates the code and locks the session. As a result, validated code can't be applied to another cart. The session ends when the customer places the order and calls a code redemption.
The lock is valid as long as:
* The transaction is created in your BigCommerce account.
* The end-user manually deletes the code from the basket.
* Voucherify detects a cart error.
# Bloomreach CMS
Source: https://docs.voucherify.io/integrations/bloomreach-cms
Connect with Bloomreach CMS
Connect Voucherify resources and Bloomreach documents for easier CMS management related to the promotion offers, like coupons, cart-level promotion, etc. Create and manage the connection from the Bloomreach document by selecting available Voucherify resources.
Once the connection is set up in Bloomreach, it is also visible in Voucherify. The information about the related Bloomreach document ID(s) is stored in Voucherify’s resource metadata.
A single Bloomreach document can be linked with multiple Voucherify resources and vice versa – a single Voucherify resource can be linked with multiple Bloomreach documents.
Currently supported resources are:
* [Discount coupons](/build/discount-promotion-overview),
* [Gift vouchers](/build/gift-card-overview),
* [Referral code](/build/referral-campaign-overview)
* [Promotion tiers](/api-reference/promotions/promotion-tier-object),
* [Earning rules](/build/loyalty-campaign-overview#key-loyalty-concepts) (within a [loyalty program](/build/loyalty-campaign-overview)).
**The integration with Bloomreach CMS uses [API limits](/guides/limits#api-limits) for downloading campaigns**.
## Integration configuration
Follow these steps to integrate Bloomreach CMS with Voucherify.
### Voucherify
To connect Bloomreach with Voucherify, you need to generate new integration keys.
1. Go to **Project Settings** and in the **General** tab, scroll down to **Integration Keys**.
2. Click the plus button on the right.
3. Fill in the **Name** for your key.
4. Choose your role from the **Role** drop-down list.
5. Choose **Bloomreach** from the **Integration** drop-down list.
6. Click **Create Integration API Key** button.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
You can also use the **User** role in the integration keys configuration (as it has Bloomreach permission selected by default). However, Voucherify recommends creating [a new custom role](/manage/members-and-roles#custom-roles-enterprise-feature) only for integration purposes.
Once the Bloomreach integration key is generated, it can be found in the **Integration Keys** section.
### Bloomreach
To connect Bloomreach and Voucherify, you need to define a new custom integration in Bloomreach. Select from the left menu **Setup**, then **Integrations**, and **Add** a new **Custom integration.**
In the **Custom integration** configuration:
1. Fill in the **Name** field.
2. Fill in the **Application URL** field to proper address, e.g.: `https://eu1.cms-integrations.voucherify.io/frontend/bloomreach/`
The address above is for the EU region. It can be different for shared or dedicated regions. If you are not sure what your Voucherify region is, contact our Support Team.
3. Set **Configuration** to **stringified JSON** with your Voucherify integration credentials (the ones generated in the [step above](#voucherify)) and desired resource types as follows:
```json theme={null}
{
"appId": "YOUR_APPLICATION_ID",
"appToken": "YOUR_SECRET_KEY",
"resourceTypes": [
"campaigns",
"earningRules",
"promotionTiers"
]
}
```
4. Set **Height(px)** to a proper value. We recommend 50-60 px per resource type, so if you want to use all three available resource types (campaigns, earning rules, promotion tiers), you can set it to 180 px.
5. Set **CSP** property to **frame-src** and \*\*\*\*.
Once the Voucherify integration is set up, you can define the content type.
Select from the left menu **Content**, then choose **Content types** from the drop-down in the left column and select a **New document type** in the **brxsaas** folder.
Then, fill in the **Name** and choose the required layout and build the desired layout. To include Voucherify integration, choose the **Field extension** option from **Primitive Field** list and use the **Voucherify** custom integration created in the previous steps in the **Integration** field.
To allow your new content type, you need to add it to the document allowed content.
In the **Content** section, choose **Documents**, then select the **Edit allowed content** from the folder options list. In the next window, select the content type created in the previous step.
Once it is done, you can now create a new document.
## Use guide
To get details about connected data, click the **Connected \** button to see the connected data details.
This window shows up to 10 elements per page. In the bottom right corner, you can see the total number of elements and you can change the page. You can also search resources by name with the search button in the top right corner.
Once the Bloomreach document is connected with a Voucherify resource, it is also visible in Voucherify in the object **Metadata** tab.
## Adding a connection
To add a connection:
1. Go to document **Edit** mode in Bloomreach and click **Manage Connected \.**
2. In the new modal, click **+ Add \**.
3. Find a resource that you want to connect and click **Add**.
4. Click the **Yes** button to confirm your action in the new window.
## Removing a connection
Deleting a connection is very similar to adding a new one.
1. Go to document **Edit** mode in Bloomreach and click **Manage Connected \.**
2. In the new modal, find the resource whose connection you want to remove and **Delete** it.
3. Click **Yes** to confirm your action in the new window.
If you delete a Bloomreach document that is connected to a Voucherify resource, that connection will not be deleted in Voucherify and vice versa – if a resource in Voucherify is deleted, the connection to the Bloomreach document will not be removed.
# Bloomreach Engagement
Source: https://docs.voucherify.io/integrations/bloomreach-engagement
Connect with Bloomreach CDP
Thanks to a two-way integration between [Bloomreach Engagement](https://www.bloomreach.com/en/products/engagement) and Voucherify, you can send Voucherify events to enrich your Bloomreach Engagement content (**inbound traffic**, from Voucherify to Bloomreach) as well as send Bloomreach Engagement data to Voucherify (**outbound traffic**, from Bloomreach to Voucherify). This way, you can store Bloomreach Engagement audience information in Voucherify and use it to build complex campaign eligibility and targeting options while reducing the manual work needed for granular user segmentation.
Sending data from Bloomreach Engagement to Voucherify (outbound traffic) uses [webhook limits](/guides/limits#webhooks).
Sending events from Voucherify to Bloomreach Engagement (inbound traffic), including code publication, does not consume API call or webhook limits.
The integration updates only the defined customer metadata. The undefined metadata or data that don't match the defined data type are omitted.
## Marketing automation – code publication
Bloomreach Engagement supports marketing automation. The scenarios you define in Bloomreach Engagement can be enhanced by Voucherify’s API requests, enabling the following use cases:
* Assigning a coupon code and sharing it with the customer once the customer meets your segmentation criteria,
* Sending out a reward to customers who left a comment or a review based on an event-triggered automation,
* Informing the customer how many loyalty points they have,
* Showing the most recent discount they are eligible for,
* Sending out to the customer a gift voucher based on the customer’s anniversary,
* And many more.
### Throttling
If you want to use the marketing automation approach, read this chapter carefully.
Voucherify accounts have limits for API requests per hour or per minute. The marketing automation approach, including code publication triggered by Bloomreach scenarios, consumes API request limits.
If you want to send messages to a large number of customers in bulk, make sure to throttle the sendout.
Once you add a webhook tile to your Bloomreach Engagement scenario, turn on **Throughput policies** in the webhook **Settings** tab. Throughput policies allow you to limit the number of concurrent requests sent to Voucherify and help prevent exceeding API request limits.
Note that if you send messages in bulk to thousands of customers, setting the throughput policy to `1` (minimum value) can still translate to up to 9,000 API requests per hour.
### Setting up a scenario
Voucherify API can enhance marketing campaigns created through [Bloomreach Scenarios](https://documentation.bloomreach.com/engagement/docs/introduction-to-scenarios) by sending to each customer a unique coupon code, the amount of points the customer received on their loyalty card, the most recent discount that the customer can get, and more.
In this scenario, the cart abandoned email is enhanced with Voucherify’s discount coupon code to encourage the customer to finish the purchase by giving an additional benefit. The scenario consists of three components:
* An **On event** trigger that will start the process.
* A webhook component that will communicate with Voucherify to get a unique coupon code for the customer.
* An email action that will send a message to the customer including the assigned voucher code.
Publishing the coupon code webhook requires the following configuration.
Use a POST Endpoint with the following details depending on the region.
| Shared region | Endpoint for Bloomreach Engagement |
| ---------------- | ----------------------------------------------- |
| Europe (default) | `https://api.voucherify.io/v1/publications` |
| United States | `https://us1.api.voucherify.io/v1/publications` |
| Asia (Singapore) | `https://as1.api.voucherify.io/v1/publications` |
The payload you send to Voucherify is described in detail in the [Publication API endpoint](/api-reference/publications/create-publication). In the payload, you need to provide the customer’s hard id and the name of the campaign.
```json theme={null}
{
"customer": {
"source_id": "{{ customer_ids.main_hard_id }}"
},
"campaign":{
"name":"Discount code campaign name"
}
}
```
To use the response in another scenario action, select **Process the response as JSON**.
Finally, in the Settings tab, provide the API keys to your Voucherify application. You can obtain your API keys from Voucherify’s project settings explained in the [Generating Voucherify API keys for Bloomreach Engagement](#generating-voucherify-api-keys-for-bloomreach-engagement) section.
The API keys must be set in the headers as `X-App-Id` and `X-App-Token`.
Once the component is ready, the returned values can be used in the marketing automation. The returned values can be applied with the Jinja tags, in the case below `{{ webhook['voucher.code'] }}`:
## Inbound integration
The inbound integration supports the flow of data from Voucherify to Bloomreach Engagement. Voucherify associates events with customers in Bloomreach Engagement. Use these events to update customer parameters, trigger event-based messaging, and enhance Bloomreach segmentation.
The following list shows the events sent to Bloomreach Engagement:
* Redemption:
* [`EVENTS.CUSTOMER.REDEMPTION.SUCCEEDED`](/api-reference/customer/redemption-succeeded)
* [`EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.SUCCEEDED`](/api-reference/customer/redemption-rollback-succeeded)
* `EVENTS.CUSTOMER.REDEMPTION.FAILED`
* `EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.FAILED`
* [`EVENTS.CUSTOMER.REWARD_REDEMPTIONS.CREATED`](/api-reference/customer/reward-redemptions-created)
* [`EVENTS.CUSTOMER.REWARD_REDEMPTIONS.COMPLETED`](/api-reference/customer/reward-redemptions-completed)
* Publication:
* [`EVENTS.CUSTOMER.PUBLICATION.SUCCEEDED`](/api-reference/customer/publication-succeeded)
* `EVENTS.CUSTOMER.PUBLICATION.FAILED`
* Rewards:
* [`EVENTS.CUSTOMER.REWARDED.MAIN`](/api-reference/customer/rewarded)
* [`EVENTS.CUSTOMER.REWARDED.LOYALTY_POINTS`](/api-reference/customer/rewarded-loyalty-points)
* Validation:
* `EVENTS.CUSTOMER.VALIDATION.SUCCEEDED`
* `EVENTS.CUSTOMER.VALIDATION.FAILED`
### Setting up the inbound integration
The integration between Voucherify and Bloomreach Engagement requires the configuration of both the inbound and outbound modes. You will need to generate the API keys in Bloomreach Engagement.
#### Generating Bloomreach Engagement API keys
To use Bloomreach Engagement with Voucherify, you need to generate [API keys in Bloomreach Engagement](https://documentation.bloomreach.com/engagement/reference/authentication).
1. Click the cog (**Settings**) button in the top right corner and go to **Project Settings**.
2. Click **Access management** and go to **API**.
3. Save your **Project Token**, **API Base URL**, and **API Token**.
4. Create a new **API group** or use an API group created earlier. The API group must be private.
5. In the **Group Keys** section, click the **Add key** button.
6. Provide the **Key name** and click the **Create** button.
7. Your **API secret** key will be displayed. Copy and save it before closing this window. You will not be able to see it again.
8. Click the **Close** button to view the **Group Keys** list. You will see your **API Key ID** on the list.
9. Go to the **Events** tab under **Group permissions** and give permission for events that you want to process through API.
10. **Optional**: if you do not have defined events or you want to allow processing of all new events, select the **New Events** checkbox.
#### Configuring Bloomreach Engagement in Voucherify
To enable the integration between Bloomreach and Voucherify, you need to specify a few details in the integration section of Voucherify. To configure the integration, follow these steps:
1. Click your user name in the top right corner to display the drop-down menu.
2. Go to **Integrations**.
3. Scroll down to the **Bloomreach Engagement** section.
4. Click the **Connect** button to open Bloomreach Engagement integration menu.
In the basic menu view, the following items are displayed:
* **Bloomreach Engagement Main Hard ID** – Bloomreach Engagement identifies its customers using many IDs. Define which Bloomreach Engagement Customer’s Hard ID will be used as a customer’s `source_id` in Voucherify. This field is required for both the inbound and outbound modes.
* **Send events** – it enables the inbound integration to receive the Voucherify events associated with customers by Bloomreach Engagement. If enabled, Bloomreach Engagement API keys need to be provided.
* **Sync Voucherify Customer's ID** – If enabled, the Voucherify Customer’s ID will be stored in Bloomreach Engagement as either a Hard or Soft ID.
The Bloomreach Engagement full menu view includes the following fields:
* **Bloomreach Hard/Soft ID for storing Voucherify Customer's ID** – this setting is accessible only when **Sync Voucherify Customer's ID** is enabled. This field specifies the Hard ID or Soft ID that stores the Voucherify customer ID.
* Bloomreach Engagement API keys – these fields are required when **Send events** or **Sync Voucherify Customer's ID** is enabled. The Project Token, API base URL, the API Key and Secret are available in Bloomreach Engagement in the API page of the Access Management section. See the [Generating Bloomreach Engagement API keys](#generating-bloomreach-engagement-api-keys) section above to learn more.
Once the configuration is done, all customer-related events in Voucherify will be sent to Bloomreach Engagement.
## Setting up the outbound integration
The outbound integration allows you to send the customer data updates and events (for example, bulk events) from Bloomreach Engagement to Voucherify. The data shared with Voucherify can be used for:
* Incentivizing promotions and discounts depending on the events associated with the customers or the updated customer profiles,
* Synchronizing customers,
* Segmenting customers based on the updates sent from Bloomreach Engagement.
The outbound integration requires a set of API keys dedicated for Bloomreach Engagement and defining which Hard ID should be used to identify the customer in Voucherify.
### Generating Voucherify API keys for Bloomreach Engagement
In Voucherify, you will need to generate API integration keys for Bloomreach Engagement.
1. Go to **Project Settings** and in the **General** tab, scroll down to **Integration Keys**.
2. Click the plus button on the right.
3. Fill in the **Name** for your key.
4. Choose your role from the **Role** drop-down list.
5. Choose **Bloomreach Engagement** from the **Integration** drop-down list.
6. Click the **Create Integration API Key** button.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
### Defining the main hard ID
Bloomreach Engagement identifies its customers using IDs. You need to define which Bloomreach Engagement [Customer’s Hard ID](https://documentation.bloomreach.com/engagement/docs/customer-identification#hard-id) will be used as a [customer’s source\_id](/prepare/customers) in Voucherify. To define the hard ID:
1. In Voucherify, click your user name in the top right corner to display the drop-down menu.
2. Go to **Integrations**.
3. Scroll down to the **Bloomreach Engagement** section.
4. Click the **Connect** button to open Bloomreach Engagement integration menu.
5. Define the **Bloomreach Engagement Main Hard ID**.
### Creating an outbound scenario in Bloomreach Engagement
Sending out events and customer data updates can be defined in a [Campaign Scenario](https://documentation.bloomreach.com/engagement/docs/introduction-to-scenarios) in Bloomreach Engagement.
During the Scenario setup, you can add [various components](https://documentation.bloomreach.com/engagement/docs/creating-a-basic-scenario), e.g. a webhook component. The webhook action component allows sending a message to another system. In the webhook, you need to define:
* The endpoint,
* The `application-id` and `secret-key` as a part of the headers,
* Specify the payload as a batch webhook,
* The payload’s template.
The endpoints to send the payload to are as follows:
| Region | Customer update | Events |
| ----------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| **Europe** | `https://bloomreach.voucherify.io/bloomreach-engagement/upsert-customer-bulk` | `https://bloomreach.voucherify.io/bloomreach-engagement/create-event-bulk` |
| **United States** | `https://us1.bloomreach.voucherify.io/bloomreach-engagement/upsert-customer-bulk` | `https://us1.bloomreach.voucherify.io/bloomreach-engagement/create-event-bulk` |
| **Asia** | `https://as1.bloomreach.voucherify.io/bloomreach-engagement/upsert-customer-bulk` | `https://as1.bloomreach.voucherify.io/bloomreach-engagement/create-event-bulk` |
The `application-id` and `secret-key` must be provided under the **Settings** section of the webhook configuration.
The payload you share with Voucherify has to conform to the following structure.
For bulk updates, the key `example_hard_id` is the field defined in Voucherify integrations > **Bloomreach Engagement** > **Bloomreach Engagement Main Hard ID**.
The `bloomreach_hard_id` in `customer_ids.bloomreach_hard_id` is one of the hard IDs defined in your Bloomreach Engagement project, for example, `registered`.
```json Events lines highlight={4} theme={null}
{
"event": "Event Name",
"customer": {
"example_hard_id": "{{ customer_ids.bloomreach_hard_id }}"
},
"metadata": {
"example_metadata_key" : "Example metadata value",
"example_customer_consent":"{{ customer.consent_status }}"
}
}
```
```json Customer updates lines highlight={2} theme={null}
{
"example_hard_id": "{{ customer_ids.bloomreach_hard_id }}",
"name": "{{ customer.firstName }}",
"description": "{{ customer.description }}",
"email": "{{ customer.email }}",
"phone": "{{ customer.phone }}",
"birthdate": "{{ customer.birthDate }}",
"address": {
"city": "{{ customer.city }}",
"state": "{{ customer.state }}",
"line_1": "{{ customer.address1 }}",
"line_2": "{{ customer.address2 }}",
"country": "{{ customer.country }}",
"postal_code": "{{ customer.postalCode }}"
},
"metadata": {
"segment": "{{ customer.segment }}"
}
}
```
The customer objects must conform to Voucherify customer definitions. The objects can contain any parameter that Bloomreach Engagement has stored about the customer. Accessing the customer object is detailed in [Bloomreach Engagement documentation](https://documentation.bloomreach.com/engagement/docs/customers), while Voucherify customer definition is available in the [Voucherify API reference](/api-reference/customers/customer-object).
The metadata section of the customer object allows feeding Voucherify custom data about your customers. The data can be used to allow or fail the redemption of the coupon codes based on the customer profile you shared via Bloomreach Engagement.
# Optimize your Connected Content scripts
Source: https://docs.voucherify.io/integrations/braze-connected-content-optimization
Configure rate limiting, caching, and retry mechanisms for Braze Connected Content
Use the following settings to optimize the performance of your Connected Content scripts. These settings reduce the number of API calls triggered by Braze and lower the risk of exceeding API rate limits, which may affect message delivery.
The examples below use the default API address `https://api.voucherify.io`.
If your API endpoint is in a [different region](/integrations/braze-connected-content-overview#api-endpoints), remember to change it.
## Rate limiter
When configuring campaigns in Braze, [limit the number of messages](https://www.braze.com/docs/user_guide/engagement_tools/campaigns/building_campaigns/rate-limiting/#delivery-speed-rate-limiting) sent per minute.
This helps prevent excessive traffic to Voucherify API endpoints used by Braze campaigns and Connected Content requests. Set the sending rate according to your Voucherify [API rate limits](/guides/limits#api-limits) and account for other API consumers in your project.
## Add caching to calls
Caching reduces the number of API calls triggered by Braze.
Connected Content calls do not cache responses by default and can trigger two Voucherify API calls per request. This can quickly increase API usage. Enabling caching can reduce this to one API call per request.
Add caching to calls as follows:
* Provide a caching key `cache_id={{cache_id}}` in the destination endpoint query parameter so Braze can identify a unique call. First, define the variable, then append the unique query string to your endpoint. In the example, this differentiates each publication by the `source_id`.
* Add a `:cache_max_age` attribute. You can customize the duration using seconds. It can be set between 5 minutes to 4 hours. Example: `:cache_max_age 3600` will cache for 1 hour.
By default, the caching duration is 5 minutes.
```liquid Caching in publications focus={5,16} lines wrap theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
Braze caches API calls based on the URL. The unique string used as a query parameter is ignored by Voucherify, but it lets Braze distinguish different API requests and cache each one separately.
Without this query parameter, every customer receives the same value (for publications, the same coupon code) for the cache duration.
## Retry attribute
Add a [retry](https://www.braze.com/docs/user_guide/personalization_and_dynamic_content/connected_content/connected_content_retries) attribute to your Connected Content script. Connected Content doesn't validate the Voucherify response, so without retry, a slow or failed request results in a message sent without data. With `:retry`, Braze retries up to 5 times before aborting the message.
Publications without retry
If you use the POST `v1/publications` endpoint without `:retry`, Braze sends the message even if Voucherify returns no response.
This can result in emails without a published code.
```liquid Retry in publications focus={17} lines wrap theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
## Unique publication per customer
The `source_id` parameter in the script body ensures each customer receives only one unique code per Braze campaign. Even if Braze sends duplicate requests, the customer gets the same code that was published in the first message.
```liquid Source ID in publications focus={3,14} lines wrap theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
## Publication with customer can join only once
If your Voucherify campaign is set to **Customers can join campaign only once**, remove `source_id` from the script body.
Voucherify ensures that each Braze message to the same customer delivers the same code that was published in the first message.
Your Connected Content script should be as follows:
```liquid Customer can join only once publication script theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign cache_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
## Source ID configurations
You can modify `{{source_id}}` and its effect on publications with the following configurations.
| Configuration | Effect |
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{campaign.${dispatch_id}}}` | Ensures that all customers within a single send-out will use the same publication. |
| `{{campaign.${api_id}}}` | Ensures that all customers within a single campaign will use the same publication. |
| `{{${user_id}}}` or `{{${braze_id}}}` | Ensures that every customer uses the same publication regardless of which campaign is sent. `${user_id}` is the external ID and `${braze_id}` is the internal Braze ID. |
| `{{campaign.${dispatch_id}}}` and `{{campaign.${user_id}}}` | Each customer within a single send-out will use the same unique publication. |
## Converting Connected Content scripts to Canvas
The examples above are prepared for Braze campaigns. However, you can use them in Braze Canvas as well.
To use the script in Canvas, delete the line with `{% assign braze_campaign_id = {{campaign.${api_id}}} %}` and add `{% assign braze_id = canvas.${id} %}`.
## Solving issues
If your Connected Content script doesn't show data from the Voucherify API, go to **Audit logs** in Voucherify. Check for errors in the request and response payloads.
## Next steps
Once optimized, get inspired with the [Connected Content script reference](/integrations/braze-connected-content-reference): API endpoints, script templates, and parameter configurations.
# Braze Connected Content overview
Source: https://docs.voucherify.io/integrations/braze-connected-content-overview
Understand how Voucherify data works with Braze Connected Content
Braze Connected Content fetches data from the Voucherify API at message send time and displays it in your Braze messages. You can publish coupons, invite referrers, retrieve loyalty card balances, add gift card credits, and more.
## How does it work?
When Braze sends a message, the Connected Content script calls the Voucherify API, fetches the response, and injects the data into the message template before delivery.
A basic Connected Content script looks as follows:
```liquid Connected content basic schema lines theme={null}
{% connected_content
"voucherify-API-ENDPOINT-url"
:method post
:headers {
"X-App-Id": "Voucherify-API-key",
"X-App-Token": "Voucherify-Secret-key"
}
:content_type application/json
:retry
:save {{result_variable}}
%}
```
The script contains the following elements:
* API endpoint URL: The Voucherify API endpoint to call (for example, `/v1/publications`).
* `:method`: The HTTP method – `post` for creating resources, `get` for fetching data.
* `:headers`: Your Voucherify API credentials (`X-App-Id` and `X-App-Token`) for authentication.
* `:content_type`: Set to `application/json` for Voucherify API calls.
* `:retry`: Retries the call up to 5 times if the request fails.
* `:save`: Stores the API response in a variable you can reference in the message body.
## What can you do with Connected Content?
Connected Content scripts support various Voucherify use cases:
| Use case | Description |
| ------------------------------- | ----------------------------------------------------------------- |
| **Publish unique coupon codes** | Assign and send a unique discount code to each customer. |
| **Generate personalized codes** | Create codes with custom prefixes based on customer attributes. |
| **Invite referrers** | Publish referral codes for customers to share. |
| **Fetch loyalty card balance** | Display a customer's current loyalty points and expiration dates. |
| **Add loyalty points** | Award points through custom event earning rules. |
| **Add gift card credits** | Top up a customer's gift card balance. |
| **List unused coupons** | Show customers their available, unredeemed codes. |
| **Resend existing codes** | Remind customers about codes they already received. |
See the [Connected Content script reference](/integrations/braze-connected-content-reference) for ready-to-use scripts for each use case.
## API endpoints
Connected Content calls the Voucherify API. The examples in this documentation use the default European region. Change the endpoint if your project is in another region or uses a dedicated region.
You can check your API endpoint in Voucherify under **Project settings** > **General** > **API endpoint**.
| Shared region | Endpoint for Braze Connected Content |
| ---------------- | ------------------------------------ |
| Europe (default) | `https://api.voucherify.io/v1/` |
| United States | `https://us1.api.voucherify.io/v1/` |
| Asia (Singapore) | `https://as1.api.voucherify.io/v1/` |
## Optimization and security
Without proper optimization, each Connected Content message can trigger multiple Voucherify API calls. This can significantly increase API usage. Before going to production, configure:
* **Rate limiting**: Limit the number of messages Braze sends per minute to help prevent exceeding Voucherify API limits.
* **Caching**: Add `cache_id` and `:cache_max_age` to reduce duplicate API calls.
* **Retry**: Use the `:retry` attribute so Braze retries failed requests up to 5 times.
* **Source ID**: Use `source_id` to ensure each customer receives only one unique code per campaign.
Read [Optimize your Connected Content scripts](/integrations/braze-connected-content-optimization) for detailed configuration instructions.
## Next steps
Visit the following pages to explore possibilities of using Voucherify with Braze Connected Content.
Publish your first coupon code with a step-by-step tutorial.
Configure caching, retry, and rate limiting for production.
Browse ready-to-use script templates for all use cases.
# Get started with Braze Connected Content
Source: https://docs.voucherify.io/integrations/braze-connected-content-quickstart
Publish your first Voucherify coupon code in a Braze campaign
Prerequisites
* A Voucherify campaign with codes to publish
* A Braze campaign or Canvas
* [Voucherify API credentials](/integrations/braze-overview/#connect-braze-with-voucherify) (App ID and App Token)
Use this tutorial to set up a basic scenario of code publication with Connected Content.
The script example below includes optimization parameters like caching and retry. This tutorial focuses on the essential Voucherify-specific parts.
Read [Optimize your Connected Content scripts](/integrations/braze-connected-content-optimization) for details on each optimization parameter.
## Display fetched data in Braze messages
Use the following steps to display the data fetched from Voucherify in Braze messages.
Copy and paste the Connected Content script under the `` tag in a message HTML template.
```liquid Connected content publication script lines theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
Add from Voucherify:
* `campaign_id` copied from the campaign details view in the Voucherify dashboard (line 4).
* Your API endpoint. You can check it in **Project settings** > **General** > **API endpoint** (line 8).
* Add publications address `/v1/publications` and the API method (lines 8-9). Don't remove `?cache_id={{cache_id}}`, as it reduces the number of API calls.
* Add your API credentials for authentication (lines 11-12).
```liquid Connected content publication script lines focus={4,8-9,11-12} theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
Responses from the Voucherify API are stored by connected content under the value of `:save` parameter. For example, `:save publication` in line 18.
```liquid Connected content publication script lines focus={18} theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
This enables you to retrieve and display data from a Voucherify response in Braze messages.
To display the published code in a message template, create a snippet that fetches a unique code from the voucher object:
```liquid theme={null}
{{publication.voucher.code}}
```
Each customer will get a message with a unique code automatically assigned to their profile. Each time the user receives a code, it is published to their profile in Voucherify.
Experiment with different data fields
You can fetch any field from Voucherify's response.
For gift cards, you can also display gift card balance by using the following snippet:
```liquid theme={null}
Your gift card: {{publication.voucher.code}}.
Your balance: {{publication.voucher.gift.amount}}.
```
See [POST Create publication](/api-reference/publications/create-publication) for the full response schema.
When setting up a campaign target, use advanced settings to limit the number of messages sent per minute.
Limiting the sending rate helps prevent exhausting code pools and exceeding Voucherify API limits during testing and live traffic.
Read more about rate limiting and frequency capping in [Braze documentation](https://www.braze.com/docs/user_guide/engagement_tools/campaigns/building_campaigns/rate-limiting/#delivery-speed-rate-limiting).
The script is ready. Send test messages with **Test Send** before launching. Braze preview mode doesn't display Connected Content calls with a `retry` attribute.
In Voucherify, go to **Audit logs** to check if Braze called the API successfully.
## Next steps
Visit the following pages to achieve more with Voucherify and Braze Connected Content:
* [Optimize your Connected Content scripts](/integrations/braze-connected-content-optimization) – Configure caching and retry mechanisms
* [Connected Content script reference](/integrations/braze-connected-content-reference) – View all script templates
# Connected Content script reference
Source: https://docs.voucherify.io/integrations/braze-connected-content-reference
API endpoints, script templates, and parameter configurations for Braze Connected Content
Prerequisite: Recommended reading
It's recommended to read the following articles before exploring the scripts:
* [Get started with Braze Connected Content](/integrations/braze-connected-content-quickstart)
* [Optimize your Connected Content scripts](/integrations/braze-connected-content-optimization)
This page contains ready-to-use Connected Content scripts for common Voucherify use cases. Copy a script, replace the placeholder values, and add it to your Braze message template.
The examples use the default API address `https://api.voucherify.io`. If your project is in a [different region](/integrations/braze-connected-content-overview#api-endpoints), change the endpoint accordingly.
All publication examples below use Voucherify publication `source_id` together with Braze cache and retry parameters to help reduce the number of API calls triggered by Braze campaigns.
As a result:
* A customer can't receive different codes within the same Braze campaign.
* If your Voucherify campaign uses the **Customers can join campaign only once** setting, remove `source_id` from the connected content body as described in [Optimize your Connected Content scripts](/integrations/braze-connected-content-optimization#publication-with-customer-can-join-only-once).
## Publish and send unique code
This script calls the Voucherify API to publish a unique code and send it in a Braze message. Each Braze user receives only one unique code.
Use this snippet to distribute codes in the following scenarios:
* Abandoned cart recovery
* Braze user performs a custom event – reward for an achievement
* Invite referrers to a referral program
* Sending the same through multiple channels (for example, email and push)
```liquid Publish and send unique code lines wrap theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/publications?cache_id={{cache_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:retry
:save publication
%}
```
To display the published code in your message, use the following snippet:
```liquid Published code snippet theme={null}
{{publication.voucher.code}}
```
If you publish a gift card, you can additionally display its value:
```liquid Display gift card balance theme={null}
{{publication.voucher.gift.balance}}
```
If you publish a loyalty card when a customer fulfils an earning rule and receives a card with a loyalty card balance, use the following snippet:
```liquid Display loyalty card balance theme={null}
{{publication.voucher.loyalty_card.balance}}
```
If the points have an expiration date, use:
```liquid Display loyalty card point expiration date theme={null}
{{publication.voucher.loyalty_card.next_expiration_date }}
```
Read the documentation of [POST Create publication](/api-reference/publications/create-publication) endpoint to learn more about the response data.
## Generate and publish a discount coupon
This script generates a coupon with a custom prefix based on a customer attribute (for example, phone number or email) and then publishes it. The two-step process first creates the voucher, then assigns it to the customer.
Use this snippet to distribute personalized codes in the following scenarios:
* VIP welcome offers with recognizable, branded codes
* Phone-number-based coupons for SMS campaigns where the code doubles as an identifier
* Personalized codes for partner or co-branded promotions
* Event-specific codes tied to customer attributes for easy tracking
```liquid Generate and publish a discount coupon lines wrap theme={null}
{% assign campaign_id = {{campaign.${dispatch_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign phoneNumber = {{${phone_number}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign prefix = "Your-Prefix" %}
{% connected_content
https://api.voucherify.io/v1/campaigns/{{voucherify_campaign_id}}/vouchers/{{prefix}}{{phoneNumber}}?c={{source_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:content_type application/json
:cache_max_age
:save voucher_created
:retry
%}
{% connected_content
https://api.voucherify.io/v1/publications?c={{source_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body voucher={{prefix}}{{phoneNumber}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:cache_max_age
:save publication
:retry
%}
```
To display the generated and published code in your message, use the following snippet:
```liquid Published code snippet theme={null}
{{publication.voucher.code}}
```
If you publish a gift card, you can additionally display its value:
```liquid Display gift card balance theme={null}
{{publication.voucher.gift.balance | divided_by: 100.0 }}
```
Read the documentation of [POST Create publication](/api-reference/publications/create-publication) endpoint to learn more about the response data.
## List unused coupons
This script retrieves all unredeemed discount coupons assigned to a Braze user (lines 15-19). It loops through the customer's vouchers and displays only the ones that haven't been used.
Use this snippet to remind customers about available codes in the following scenarios:
* Weekly or monthly "wallet" digest emails listing available coupons
* Re-engagement campaigns reminding inactive users they have unused discounts
* Post-purchase follow-ups nudging customers to use remaining codes
* End-of-campaign reminders before codes expire
```liquid List unused coupons lines wrap highlight={15-19} theme={null}
{% assign campaign_id = {{campaign.${dispatch_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% connected_content
https://api.voucherify.io/v1/vouchers?customer={{customer_id}}&c={{source_id}}
:method GET
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:save voucher_list
%}
{% for voucher in voucher_list.vouchers %}
{% if voucher.redemption.redeemed_quantity == 0 %}
Code: {{voucher.code}}
{% endif %}
{% endfor %}
```
If you want to display unused codes from one campaign, add `{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}`.
Then, edit the URL to `https://api.voucherify.io/v1/vouchers?customer={{customer_id}}&campaign_id={{voucherify_campaign_id}}&c={{source_id}}` to display only the vouchers from this campaign.
Use this snippet to show additional details like the discount value for each voucher:
```liquid Display coupon with discount theme={null}
Code: {{voucher.code}} – Discount: {{voucher.discount.percent_off}}% off
```
Use this snippet to display the expiration date for urgency:
```liquid Display coupon expiration date theme={null}
Code: {{voucher.code}} – Expires: {{voucher.expiration_date}}
```
Read the documentation of [GET List vouchers](/api-reference/vouchers/list-vouchers) endpoint to learn more about the response data.
## List all codes and publish a new one if there are none
This script checks if a customer already has an available code from a specific campaign. If the customer has no codes, or if their most recent code was already redeemed, it publishes a new one. This ensures every message contains a valid, usable code.
Use this snippet to guarantee a valid code in the following scenarios:
* Always-on promotional campaigns where customers should always have an active code
* Recurring campaigns where a new code is needed after each redemption
* Win-back flows that check for an existing offer before generating a new one
* Multi-touch nurture sequences where you want one active code per customer at all times
The script retrieves the vouchers from the campaign assigned to a customer (lines 1-14), then verifies if the customer has a voucher from the campaign or if a voucher was already redeemed (lines 16-34).
```liquid List codes and publish if none lines wrap highlight={1-14,16-34} theme={null}
{% assign campaign_id = {{campaign.${dispatch_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% connected_content
https://api.voucherify.io/v1/vouchers?customer={{customer_id}}&campaign_id={{voucherify_campaign_id}}&c={{source_id}}
:method GET
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:save voucher_list
%}
{% if (voucher_list.total) == 0 or (voucher_list.vouchers[0].redemption.redeemed_quantity) != 0% }
{% connected_content
https://api.voucherify.io/v1/publications?c={{source_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body campaign={{voucherify_campaign_id}}&customer={{customer_id}}&channel=Braze&source_id={{source_id}}
:content_type application/json
:save new_voucher
:cache_max_age
:retry
%}
{% assign code = {{new_voucher.voucher.code}} %}
{% else %}
{% assign code = {{voucher_list.vouchers[0].code}} %}
{% endif %}
```
Place this snippet where you want to display the discount coupon in your message:
```liquid Display discount coupon theme={null}
{{code}}
```
For gift cards, you can display also their balance:
```liquid Display gift card balance theme={null}
{{new_voucher.voucher.gift.balance}}
{{voucher_list.vouchers[0].gift.balance}}
```
Read the documentation of [GET List vouchers](/api-reference/vouchers/list-vouchers) and [POST Create publication](/api-reference/publications/create-publication) endpoints to learn more about the response data.
## Resend codes
Prerequisite: Store incentive codes as custom attributes
For this script to work, you need to first assign a discount coupon, gift card, or referral code to a Braze user and save the code and expiration date as custom attributes.
Read [Distribute to Braze custom attributes](/integrations/braze-custom-attributes) to learn how to send Voucherify data as Braze custom attributes.
This script fetches an existing incentive code from the customer's custom attributes and checks its status. If the code hasn't been redeemed, the message reminds the customer to use it. If the code has been redeemed, the message acknowledges it. Build a customer segment based on the expiration date and target this message at that segment.
Use this snippet to resend existing codes in the following scenarios:
* Expiration reminder emails sent a few days before a code expires
* Re-engagement campaigns for customers who received but never used a code
* Multi-channel reminders (for example, push notification after an email)
* Post-purchase follow-ups reminding customers about their remaining gift card or referral code
```liquid Resend codes lines wrap theme={null}
{% assign campaign_id = {{campaign.${dispatch_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% connected_content
https://api.voucherify.io/v1/vouchers/{{custom_attribute.${incentive_name}}}?c={{source_id}}
:method GET
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:save incentive
%}
{% if incentive.__http_status_code__ != 200 %}
{% abort_message("Voucher does not exist") %}
{% endif %}
{% if incentive.redemption.redeemed_quantity == 0 %}
You can still use the voucher {{incentive.code}} up until {{incentive.expiration_date}}
{% else %}
Your voucher {{incentive.code}} has been used.
{% endif %}
```
To display the incentive code:
```liquid Incentive code snippet theme={null}
{{incentive.code}}
```
To show the expiration date to create urgency:
```liquid Display expiration date theme={null}
Your code {{incentive.code}} expires on {{incentive.expiration_date}} – use it before it's gone!
```
To display different messages based on redemption status:
```liquid Conditional redemption status theme={null}
{% if incentive.redemption.redeemed_quantity == 0 %}
You still have an unused code: {{incentive.code}}
{% else %}
Thanks for using your code!
{% endif %}
```
Read the documentation of [GET Voucher](/api-reference/vouchers/get-voucher) endpoint to learn more about the response data.
## Fetch loyalty card balance
Prerequisite: Send loyalty card code as a custom attribute
For this script to work, you need to store the loyalty card code as a custom attribute in Braze user's profile.
Read [Distribute to Braze custom attributes](/integrations/braze-custom-attributes) to learn how to send Voucherify data as Braze custom attributes.
This script fetches the current loyalty balance from a loyalty card code stored as a custom attribute in Braze.
Use this snippet in the following scenarios:
* Point balance reminder email
* Post-purchase point update
* Tier-based messaging
* Monthly loyalty statement
* Re-engagement for inactive members
```liquid Fetch loyalty card balance lines wrap theme={null}
{% assign braze_campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = braze_campaign_id | append: customer_id %}
{% assign voucherify_campaign_id = "camp_XXXXXXXXXXXXXXXXXXXXXXXX" %}
{% assign cache_id = source_id %}
{% connected_content
https://api.voucherify.io/v1/loyalties/{{voucherify_campaign_id}}/members/{{custom_attribute.${loyalty.card}}}?cache_id={{cache_id}}
:method get
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:content_type application/json
:cache_max_age
:retry
:save member
%}
```
Use the following snippets to display loyalty card details.
Display the loyalty card code:
```liquid Loyalty card code snippet theme={null}
{{member.code}}
```
Display the current balance:
```liquid Loyalty card balance snippet theme={null}
{{member.loyalty_card.balance}}
```
If points are about to expire, create a sense of urgency to spend them. Display the number of expiring points and the date when they will expire:
```liquid Display loyalty card expiring points with date theme={null}
{{member.loyalty_card.next_expiration_points}}
{{member.loyalty_card.next_expiration_date}}
```
If you use pending points, display the number of points that are in the pending state:
```liquid Display loyalty card point pending points theme={null}
{{member.loyalty_card.pending_points}}
```
If you send emails to remind users about their point balance, you can use the following template:
```liquid Remind users about their balance wrap theme={null}
Hi {{${first_name}}},
You currently have {{member.loyalty_card.balance}} loyalty points!
{% if member.loyalty_card.balance >= 500 %}
You have enough points to redeem a reward. Visit your account to browse available rewards.
{% else %}
You're only {{500 | minus: member.loyalty_card.balance}} points away from your next reward!
{% endif %}
```
Use the following template to message users about their progress in achieving loyalty tiers:
```liquid Tier-based messaging with conditional logic wrap theme={null}
{% if member.loyalty_card.balance >= 1000 %}
As a Gold member with {{member.loyalty_card.balance}} points, you get early access to our seasonal sale!
{% elsif member.loyalty_card.balance >= 500 %}
You have {{member.loyalty_card.balance}} points – earn {{1000 | minus: member.loyalty_card.balance}} more to unlock Gold status!
{% else %}
Start collecting points today. Your current balance: {{member.loyalty_card.balance}}.
{% endif %}
```
Read the documentation of [GET Member](/api-reference/loyalties/get-member) endpoint to learn more about the response data.
## Add loyalty points with a custom event earning rule
This script sends a custom event (lines 5-12) to Voucherify when a Braze message is delivered. The event triggers an earning rule in your loyalty campaign, which awards points to the customer. Different segments can receive different point amounts based on the earning rule configuration.
Use this snippet to award loyalty points in the following scenarios:
* Reward customers for opening or engaging with a campaign message
* Award bonus points during double-points promotional periods
* Grant points for completing a profile, survey, or onboarding step
* Trigger milestone rewards when a customer reaches a segment threshold
```liquid Add loyalty points with a custom event lines wrap highlight={5-12} theme={null}
{% assign campaign_id = {{campaign.${dispatch_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% capture postBody %}
{
"event":"Event Name",
"customer": {
"source_id": "{{customer_id}}"
}
}
{% endcapture %}
{% connected_content
https://api.voucherify.io/v1/events?c={{source_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body {{postBody}}
:content_type application/json
:cache_max_age
:retry
%}
```
The script sends a [custom event](/api-reference/events/track-custom-event) to Voucherify with the customer's `source_id`. Voucherify evaluates the event against your earning rules and awards points accordingly.
To set this up:
1. Create a custom event schema in Voucherify under **Project settings** > **Custom events**.
2. Create an earning rule in your loyalty campaign that listens for this event.
3. Replace `"Event Name"` in the script with your custom event name.
Different earning rules can award different point amounts per segment, so you can run tiered loyalty campaigns from a single Braze message.
Read the documentation of [POST Track custom event](/api-reference/events/track-custom-event) endpoint to learn more about the request and response data. Also, read [Custom events](/prepare/custom-events) to learn more about defining them.
## Add credits to a gift card
Prerequisite: Send the gift card code as a custom attribute
For this script to work, you need to store the gift card code as a custom attribute in Braze user's profile.
Read [Distribute to Braze custom attributes](/integrations/braze-custom-attributes) to learn how to send Voucherify data as Braze custom attributes.
This script adds credits to a customer's gift card (lines 5-9). The gift card code is retrieved from a Braze custom attribute, and the specified amount is added to the card balance.
Use this snippet to top up gift cards in the following scenarios:
* Birthday or anniversary bonus credits
* Compensation credits for a negative customer experience
* Seasonal top-ups during holiday campaigns
* Reward credits for completing a purchase or hitting a spending milestone
The `"amount": 1000` is a value in the smallest currency units (for example, cents for USD or EUR).
This snippet can be also used for adding loyalty points to an existing loyalty card that's assigned as a custom attribute to a user profile in Braze.
```liquid Add credits to a gift card lines wrap highlight={5-9} theme={null}
{% assign campaign_id = {{campaign.${dispatch_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}
{% capture postBody %}
{
"amount":1000
}
{% endcapture %}
{% connected_content
https://api.voucherify.io/v1/vouchers/{{custom_attribute.${gift_card_from_attribute}}}/balance?c={{source_id}}
:method post
:headers {
"X-App-Id": "12345678-90QW-ERTY-UIOP-asdfghjklzxc",
"X-App-Token": "MNBVCXZL-KJHG-FDSA-POIU-ytrewq098765"
}
:body {{postBody}}
:content_type application/json
:no_cache
:save balances
:retry
%}
```
After adding credits, you can confirm the top-up in the message. The `:no_cache` attribute ensures the balance reflects the latest update.
To notify the customer about the added credits:
```liquid Display added amount theme={null}
We've added credits to your gift card: {{ balances.amount | divided_by: 100.0 }}
Your current balance is: {{ balances.balance | divided_by: 100.0 }}.
```
Read the documentation of [Adjust voucher balance](/api-reference/vouchers/adjust-voucher-balance) endpoint to learn more about the request and response data.
## Tips for fetching data with Braze Connected Content
Use the following tips to format data fetched from Voucherify.
If you fetch date and time, for example `expiration_date` for points or codes, you can format it according to your preferences as follows:
* day, month, year: `{{voucher.expiration_date | date: "%d.%m.%Y"}}`
* day, month, year and time: `{{voucher.expiration_date | date: "%d.%m.%Y o %H:%M"}}`
* month, day, year: `{{voucher.expiration_date | date: "%B %d, %Y"}}`
* date and time adjusted to the time zone: `{{ voucher.expiration_date | time_zone: 'Europe/Warsaw' | date: "%d.%m.%Y %H:%M" }}`
If you fetch a gift card balance or discount amount, Voucherify returns the value multiplied by 100. Divide by `100.0` to display the correct currency amount.
For example `{{ voucher.gift.balance | divided_by: 100.0 }}` renders `"balance": 10000` as `100.0`
If your country uses a comma (`,`) as a decimal separator, append `replace: '.', ','` to the snippet:
```liquid Display added amount theme={null}
We've added credits to your gift card: {{ balances.amount | divided_by: 100.0 | replace: '.', ',' }}
Your current balance is: {{ balances.balance | divided_by: 100.0 | replace: '.', ',' }}.
```
# Distribute to Braze custom attributes
Source: https://docs.voucherify.io/integrations/braze-custom-attributes
Learn how to use distributions to push incentives to Braze custom attributes
Prerequisite: Add Braze credentials to Voucherify
To send events to Braze, [connect your Voucherify project with Braze](/integrations/braze-overview#connect-voucherify-with-braze "Braze overview: Connect Voucherify with Braze instructions").
Voucherify distributions let you assign incentive codes to custom attributes on Braze user profiles. You can then use these custom attributes in your Braze campaigns, for example in Connected Content scripts or message personalization.
You can assign:
* Discount coupons
* Gift cards
* Loyalty cards
* Referral codes
* Promotion tiers
You can distribute incentives to Braze using:
* **Manual messages**: A one-time action that assigns random codes or sends promotion tier details to a chosen audience (a Voucherify segment or a single customer).
* **Automated workflow**: Sends an incentive in response to a specific customer action.
Voucherify can push codes or promotion tiers to Braze custom attributes automatically in response to the following triggers.
Triggers that can push codes or promotion tiers:
* **Customer entered/left segment**: The message is sent when a customer joins or leaves a segment in Voucherify.
* **Successfully published**: The message is sent when the code from a campaign is published (assigned) to a customer in Voucherify.
* **Order status changed**: The message is sent when the order changes its status to created, updated, paid, or canceled.
* **Reward redemption**: The message is sent when a customer redeems a loyalty or referral reward.
* **Custom event**: The message is triggered once Voucherify receives a particular custom event.
* **Loyalty points adjusted**: The message is sent when loyalty points are added to or subtracted from the customer's profile.
* **Customer rewarded loyalty points**: The message is sent when a customer was rewarded loyalty points.
If a Voucherify customer doesn't exist in Braze, the distribution creates a new Braze user profile. The Voucherify customer `source_id` is used as the Braze `user_id`.
## Set up distribution
In Voucherify, go to **Engagement** > **Distributions** to **Create distribution**.
Name your distribution and select the trigger.
For a relevant trigger, select required options:
* **Campaign**
* **Segment**
* **Validation rule**
* **Custom event**
* **Notify customers about promotion**. Select **Promotion tier**.
* **Send and publish unique codes from campaign**. Select the campaign that will be the source of unique codes.
Voucherify sends the incentive data to Braze customer profiles. The data includes the environment it was sent from and the code in three formats: text, barcode, and QR.
In **Channels**, choose Braze as a channel. Map custom fields that will be added to the user profile in Braze.
* For vouchers, map **Voucher code** to add the field representing the `code` of the published voucher, for example `voucherify_campaign_code`. The rest of the fields are optional.
* For promotion tiers, map **Promotion tier name** and **Promotion tier ID**. The rest of the fields are optional.
This is where you decide how you want to label Voucherify properties as custom attributes in Braze.
You don't have to add that custom attribute in Braze earlier, as these custom attributes will be mapped automatically to the defined key.
In **Summary**, verify the configuration. When ready, click **Save and send** to deliver the codes or promotion tiers to Braze user profiles.
Manual distribution is sent after 10 minutes delay. You can edit your distribution details in the meantime.
Automated distribution starts immediately and a message is sent whenever the triggering event occurs.
Each message assigns a code or promotion tier as a custom attribute to a user profile in Braze.
## Use Voucherify custom attributes in your Braze campaign
Once the custom attribute with the code is added to the customer's custom attributes in Braze, you can use it in your Braze campaigns.
Edit the message body and add the custom attribute defined in the Voucherify distribution, for example `voucherify_campaign_code`. To display the unique code, use the liquid code `{{custom_attribute.${voucherify_campaign_code}}}`.
You can see the code in your message preview for a relevant user.
## Related features
Learn more about related features when using Braze custom attributes.
Before you use Braze custom attributes in Voucherify distributions for Customer entered/left segment, you need to add your Braze users to the Voucherify dashboard.
To do this, you can:
* Use Braze connected content to synchronize users.
* [Synchronize customers with Braze Canvas](/integrations/send-data-from-braze#synchronize-customers-with-braze-canvas) on an ongoing basis
* Import [users through CSV in the Voucherify dashboard](/prepare/customers#csv-import).
* Import users through the [Import and Update Customers using CSV](/api-reference/customers/import-and-update-customers-using-csv) endpoint.
When importing Braze users to Voucherify, map the Braze `user_id` to the Voucherify `source_id`.
Once imported, create a [customer segment](/prepare/customer-segments) by filtering `source_id` with a condition like `starts with braze`. You can also filter by the `brazeAudiences` metadata field with a specific Braze `audience_id` stored in Voucherify customer profiles.
Some distribution triggers in the automated workflow can use [validation rules](/optimize/validation-rules-reference). Validation rules work as additional conditions for triggering the incentive sendout.
For example:
* You can use a validation rule that will trigger the incentive sendout when the order status changes to "paid" and the order amount is above \$100.
* You can use a validation rule that requires the customer to belong to a VIP customer segment in Voucherify when a custom event is triggered.
You can use validation rules with the following distribution triggers:
* **Order status changed** to created, update, paid, or canceled.
* **Custom event**.
Experiment with what works best in your business scenario.
# Braze
Source: https://docs.voucherify.io/integrations/braze-overview
Connect Voucherify with Braze to deliver incentives, sync customer data, and trigger messages based on promotion events
Voucherify handles incentive logic: code generation, validation, redemption, and budget control. Braze handles delivery: timing, channel selection, and message personalization. Together, they let you distribute the right incentive at the right time through the right channel.
## Integration options
The Braze integration supports four patterns for moving data between the platforms. Each pattern serves a different use case.
| Pattern | Direction | What it does |
| ----------------------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **[Connected Content](/integrations/braze-connected-content-overview)** | Braze calls Voucherify | Fetches codes, balances, or gift card data from Voucherify at message send time. Best for real-time personalization. |
| **[Custom attributes](/integrations/braze-custom-attributes)** | Voucherify pushes to Braze | Stores codes and promotion data on Braze user profiles via distributions. Best for pre-assigning codes before a campaign. |
| **[Promotion code lists](/integrations/braze-promotion-codes)** | Manual export/import | Exports codes from Voucherify in bulk and imports them into Braze promotion code lists. Best for large-scale, one-time distributions. |
| **[Event streaming](/integrations/stream-events-to-braze)** | Voucherify pushes to Braze | Sends promotion events (redemptions, publications, loyalty updates) to Braze. Best for triggering follow-up messages based on customer activity. |
You can also [send data from Braze to Voucherify](/integrations/send-data-from-braze) using Canvas webhooks to sync customer segments or forward Braze events as Voucherify custom events.
The Braze integration supports two-way data exchange between Braze and Voucherify.
* Data sent from Braze to Voucherify, including custom attributes and audience sync, consumes **[webhook limits](/guides/limits#webhooks)**.
* Connected Content requests from Braze to Voucherify consume **[API limits](/guides/limits#api-limits)**.
* Events sent from Voucherify to Braze do not consume API call or webhook limits.
Plan your campaign volumes accordingly.
## What you need to connect with Braze
Voucherify and Braze communicate both ways. You need credentials configured in each platform.
### Connect Voucherify with Braze
This connection lets Voucherify push events and custom attributes to Braze.
In your Braze account, create or locate a REST API key with at least the `users.track` permission.
In Voucherify, go to **Home** > **Integrations**, find **Braze**, and click **Connect**. Paste the REST API key, select the Braze API endpoint for your region, and enable **Send events to Braze**.
### Connect Braze with Voucherify
This connection lets Braze call Voucherify APIs for Connected Content, Canvas webhooks, and other API-based integrations.
In **Home** > **Project Settings**, scroll to **Integration keys** and click **+**. Name your key, assign a role, and select **Braze** from the integration list. Click **Create integration API**.
Copy the **Application ID** and **Secret key**. You will not be able to view the secret key again.
Add the Application ID and Secret key to your Braze Connected Content scripts, Canvas webhook headers, or other integration settings that require Voucherify authentication.
## Rate limiter
When configuring campaigns in Braze, [limit the number of messages](https://www.braze.com/docs/user_guide/engagement_tools/campaigns/building_campaigns/rate-limiting/#delivery-speed-rate-limiting) sent per minute. This helps prevent excessive traffic to Voucherify API endpoints used by Braze campaigns and Connected Content requests.
Set the sending rate according to your Voucherify [API rate limits](/guides/limits#api-limits). When calculating the limit, account for other API consumers in your project.
## Next steps
Explore the following pages to match Voucherify to your Braze use cases.
Fetch codes and loyalty data from Voucherify at send time.
Use Voucherify events to trigger action-based delivery in Braze.
Sync customer segments and forward events to Voucherify with Canvas webhooks.
Push codes to Braze user profiles with Voucherify distributions.
Export codes in bulk and import them into Braze.
Learn how to tweak and experiment in Voucherify to gain even better results with your Braze campaigns.
# Export coupons to Braze
Source: https://docs.voucherify.io/integrations/braze-promotion-codes
Use Braze discount code snippet to share Voucherify coupons
Export codes from Voucherify, import them to Braze, and add an email code snippet to pull codes from the promotion list.
Use this scenario when you have a large number of Voucherify codes that you want to share with your customers.
Prerequisite: Code campaign
Prepare a code campaign first to distribute them with Braze:
* [Discount coupons](/build/create-discount-coupons)
* [Gift cards](/build/create-gift-cards)
* [Loyalty cards](/build/create-loyalty-campaign)
* [Referral codes](/build/create-referral-campaign)
In Voucherify, go to **Campaigns** and select the campaign that will be the source of codes to export:
1. Click the three-dot menu to **Export to CSV**.
2. Select only the **Code** field to be exported.
3. Wait for the export to finish.
4. Edit the CSV file and remove the name of the column to leave the list of codes only.
In Braze, go to **Data Settings** > **Promotion Codes**, then select **Create Promotion Code List**.
You can use the Voucherify campaign name to name the list and ensure data consistency.
Add a **Code snippet name**, for example `VoucherifyPromoCodes26`, that refers to the codes from this list. When Braze sends a message, it replaces the snippet with a unique code from the list.
You can set attributes like **List Expiration** and **Threshold Alerts**. Voucherify manages its own expiration logic for codes regardless of these list settings.
Upload the CSV file with Voucherify codes.
Confirm that the list only contains codes (and not column header) to **Start Upload**.
When the import is done, click **Save List** to confirm the list details.
Large files take several minutes to import. You can leave the page while the import is in progress.
To use codes from the list in a Braze campaign, **Copy Snippet** and add it to the email body.
Paste the code snippet to your Braze message to display a code from the list.
Sample code snippet:
```liquid theme={null}
{% promotion('VoucherifyPromoCodes26') %}
```
Once the message with code is sent, the same code won't be used again.
Your Braze audience starts receiving Voucherify codes.
If you need help on any of the steps above, visit the [Promo codes user guide](https://www.braze.com/docs/user_guide/personalization_and_dynamic_content/promotion_codes) in Braze documentation.
# CleverTap
Source: https://docs.voucherify.io/integrations/clevertap
Transfer data from Voucherify to CleverTap and trigger messages and deliver codes to customers
Here are some scenarios where Voucherify and CleverTap can be used:
* **Bulk delivery:** Send codes to a specific customer segment in one go.
* **Segment updates:** Automatically deliver codes when a customer enters or exits a defined segment.
* **Event-based responses:** Send codes in reaction to an outstanding order or any custom event.
* **Re-engage inactive customers:** Identify customers who have not visited your store for a while and incentivize them with a discount coupon.
* **Exclusive redemption:** Ensure that only the recipient of the voucher can redeem it, maintaining exclusivity and preventing misuse.
* **Personalized delivery:** Send tailored coupons to customers via email, creating a more engaging and targeted experience.
## Setting up the integration in Voucherify
Generate API integration keys for CleverTap.
1. Go to Project Settings and scroll to Integration Keys in the General tab.
2. Click the plus button on the right.
3. Fill in the Name for your key.
4. Choose your role from the Role drop-down list.
5. Choose CleverTap from the Integration drop-down list.
6. Click the Create Integration API Key button.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
## How to distribute Voucherify’s unique coupons with CleverTap
Follow these steps to distribute coupons.
### Step 1: Prepare a Voucherify campaign to engage inactive customers
In this example, a [unique coupon campaign](/build/create-discount-coupons) called **“Customer Reactivation”** is implemented. This campaign offers a 20% discount on the entire cart, with a maximum discount value of \$100.
The key setting in this campaign is the **"Customers will be allowed to join the campaign only once"** option.
* **When enabled:** Each customer will receive only one code from the campaign. If the customer tries to request another code, the system will provide the original code they initially received.
* **When disabled:** The customer will receive a new coupon code every time a request is made.
With this setting you can control whether customers can access multiple reactivation codes or just a single one, depending on your campaign strategy.
You will need the **campaign ID** for later steps. You can copy it from the campaign tile in the campaign list or you can call [the GET campaign endpoint](/api-reference/campaigns/get-campaign).
### Step 2: Configure a CleverTap Linked Content endpoint, which will publish a new code from the campaign
In your CleverTap account, go to Settings > Setup > Linked Content and select the + Linked Content button. A Linked Content form will appear. Fill it in the following way:
* API Name: this is the name of the Linked Content endpoints. In this case, it is named New Reactivation Voucher because it will send out voucher codes from the Customer Reactivation campaign.
* API URL: type in the address of the Create Publications endpoint: `{{API_URL}}/v1/publications/create?campaign=[Voucherify campaign ID]&customer={{customersourceid}}`. You can find your API URL in your Voucherify Project Settings in the Application Information section under the API endpoint.
* In the Parameters tab, a customersourceid parameter will appear. Check the Mark mandatory checkbox, as without the customer ID, a coupon cannot be assigned to the customer.
* In the Headers tab:
* Add `X-App-Id` and `X-App-Token` headers you have generated earlier in Voucherify
* Set Content-Type header to `application/json`.
After you save the configuration, you can test it using the Test Linked Content. If everything is configured correctly, you will see Voucherify’s response.
You can now click the Auto-Fill Objects with Response button to populate objects present in the response automatically. In this example, only the `voucher.code` field will be needed – it contains the published code.
### Step 3: Use the Linked Content endpoint in a CleverTap campaign
Create a new CleverTap campaign. In this example, set up a one-time email outbound campaign targeting customers who last visited an e-commerce site 30 days ago.
Prepare the email content. CleverTap supports the use of [Liquid tags](https://docs.clevertap.com/docs/liquid-tags) to dynamically insert details, such as the customer’s name, into the email content. This triggers the Linked Content endpoint configured in Step 2. The endpoint response is then parsed to display the appropriate details to the recipient.
To use Voucherify’s *create publication* endpoint and generate a new code for the email recipient:
Add the configured Linked Content endpoint to the campaign using the **Personalization Setup**.
Specify the field to be used as the request parameter for the endpoint.
In the place where you want the coupon code to be displayed, choose Customize with Liquid tags and choose the code field from the Linked Content endpoint created in Step 2.
You can preview how the message will appear to a specific customer by clicking **Preview & Test**.
In the campaign's **Delivery Preferences**, you can configure email throttling to control the rate of message delivery. Ensure the throttling rate is set to a value lower than your minute limit as defined in your Voucherify plan.
Once the campaign is published and messages are sent – either at the scheduled time or immediately – each message will be personalized for the recipient and will include the voucher code assigned to them.
You can see each publication call made during the email send-out in the Audit Log in your Voucherify Dashboard with the URL `/v1/publications/create`.
You can also view the generated codes in the selected campaign dashboard in the Vouchers tab.
## Other scenarios
### Referral code and loyalty card publication
The process of assigning a [referral code](/build/referral-campaign-overview) or [loyalty card](/build/loyalty-campaign-overview) is similar to the one described above. All you need to do is change the campaign name parameter to the referral or loyalty campaign you created.
In this example, the customer's code is retrieved from the referral program by using campaign ID.
If the **Customer is allowed to join the campaign only once** (the option is enabled in the referral program configuration), a customer who is already part of the program will receive their previously assigned referral code. If a referral code has not yet been assigned to the customer, a new code will be generated and included in the response.
First, configure the Linked Content endpoint.
Then, to retrieve the loyalty card, use the following code: `{{ Linked["Customer Referral Code"].code }}`.
The customer can share their referral code with a friend. When they use it during a purchase, the referrer will be awarded the gift you have set up in the Voucherify Dashboard.
# commercetools
Source: https://docs.voucherify.io/integrations/commercetools
If you're interested in using the commercetools integration, [visit Voucherify's main Commercetools connector repository](https://github.com/voucherifyio/commerce-tools-integration) and [Gift card connector repository](https://github.com/voucherifyio/commerce-tools-gift-card-connect/).
By integrating Voucherify with your [commercetools store](https://commercetools.com/), you can start offering personalized promo codes and other campaigns with custom redemption limits, unavailable in the standard commercetools instance. These include:
* Dynamic discounts that change value based on order total and other attributes.
* Proportional discounts.
* Multi-tiered double and single-sided referral campaigns.
* Advanced product and order-specific discounts, including free product offers and BOGO.
Open source
commercetools plugin is open source. This means that you can build custom functionalities on top of it based on your unique business needs.
The integration with commercetools uses [API limits](/guides/limits#api-limits) for sending code validation and redemption from Voucherify to commercetools and vice versa.
## Supported features
Before you start creating promo campaigns for your commercetools audience, read the summary of Voucherify features supported in the plugin and make sure your use cases are covered.
* [Amount discount coupons](/build/discount-types-and-effects#amount-discount).
* [Percentage discount coupons](/build/discount-types-and-effects#percent-discount).
* [Fixed amount discount coupons](/build/discount-types-and-effects#new-price).
* [Unit discount coupons](/build/discount-types-and-effects#free-products) – add free items to orders.
* [Free shipping coupons](/build/discount-types-and-effects#free-shipping).
* Syncing products, customers, and orders.
* [Validation sessions](/guides/locking-validation-session) – temporarily lock the voucher's usage until redemption is successful, which is helpful for coupons with limited use.
* [Stackable validation](/api-reference/validations/validate-stackable-discounts) and [stackable redemption](/api-reference/redemptions/redeem-stackable-discounts) – allow customers to use up to 30 incentives at the same time.
* [Partial redemption](/orchestrate/stacking-rules#application-and-sorting) – allow customers to redeem only the applicable incentives in a stack even if it includes incentives that fail validation.
* [Validation rules](/optimize/validation-rules-reference) – coupons are valid only for select scenarios based on cart or order attributes.
* [Discount effects](/build/discount-types-and-effects) – define how to apply the discount to the customer's cart
* [Loyalty](/build/loyalty-campaign-overview) and [referral](/build/referral-campaign-overview) programs.
* [Cart-level discounts](/build/create-discount-promotions).
* [Gift cards](/build/gift-card-overview).
**What is not supported yet**:
* Unit discount coupons – support for product variants (SKUs).
## How does the integration work?
Voucherify and commercetools integration is based at checkout. commercetools fetches Voucherify API to validate and redeem the promo code.
1. Voucherify returns the result and applies the discount to the order (to the cart, items, or triggers another behavior based on the discount effect).
2. Once the order is paid, the code is redeemed, and the commercetools order and customer data is synced with Voucherify.
## How to install and configure the plugin?
You will need credentials to use both Voucherify and commercetools.
| Service | Description |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Voucherify** | Voucherify account and API keys – you can find your API keys in Project Settings → Application Keys. [Read more here](/guides/api-quickstart#get-your-api-keys). |
| **commercetools** | commercetools account with API client and API keys – available when a new API Client is created. Create it in Settings → Developer Settings → Create new API client using the **Admin client** scope template. [Read more in the commercetools documentation](https://docs.commercetools.com/merchant-center/api-clients). |
To start with, follow the steps outlined in the [Github repository](https://github.com/voucherifyio/commerce-tools-integration).
## Use Voucherify coupons in your commercetools store
Your visitors can redeem Voucherify coupon codes to get a discount while shopping in your commercetools store. The workflow is as follows:
1. A customer selects products to add to their cart.
2. In a cart summary, they can see a field for a coupon code.
3. The customer enters a Voucherify code, and after choosing **Apply**, their order is automatically updated. Applied discounts are also visible on a checkout page and order summary.
4. You can see redeemed coupons in your Merchant Center dashboard. Go to the Orders List section and choose which order you'd like to display. If any coupon has been applied, you'll see it in the order items.
## Tracking your performance
Once the plugin is configured, you will be able to use promo codes. For more tracking data, you can visit the Voucherify dashboard. In the Redemptions, Customers and Orders sections, Voucherify collects and presents detailed, up-to-date information. You can read more about tracking in this [guide](/optimize/validations-and-redemptions).
## Troubleshooting
In case you encounter any issues while working with the plugin, you can debug your integration and find the issues using commercetools logs or Voucherify logs.
* commercetools logs – logs can be found in the Merchant Center. To view the logs, go to the Audit log > Change history. [Read more here](https://docs.commercetools.com/merchant-center/change-history).
* Voucherify logs – if you want to know how Voucherify reacted to the request, you can find that information under the Audit Logs in Voucherify. To view the logs, go to the Audit log. You can learn more about Voucherify’s logs by following [this tutorial](/analyze/audit-logs).
# Contentful
Source: https://docs.voucherify.io/integrations/contentful
Learn how to integrate Voucherify and Contentful
[Contentful](https://www.contentful.com/) is a Content Management System (CMS) that helps businesses to manage and deliver digital content across various channels and devices. Thanks to the Voucherify app which is available at [Contentful Marketplace](https://www.contentful.com/marketplace/app/voucherify/) and which can be embedded in Contentful content, you can fetch resources from your Voucherify account and assign them to a specific Contentful entry.
You can link the Contentful entries to the following Voucherify resources:
* [Campaigns](/build/create-discount-coupons),
* [Earning rules](/build/earning-rules),
* [Promotion tiers](/api-reference/promotions/promotion-tier-object).
With this app, you can easily connect the content created in Contentful to Voucherify campaigns, enhancing the customer journey and your marketing teams experience by:
* Adding links to terms and conditions to your campaigns so that customers know what they need to do to receive the discounts. The terms and conditions might be similar or the same for different campaigns, making it easier for the marketing team to manage it in one place.
* Adding banners and the rules explanations to the Earning Rules so that the customers know how they can earn points. In case a banner or a logo changes, the change will be visible after updating the content in Contentful.
* Adding banners and promotion details so that your customers know when they are eligible for the discounts.
With Contentful, it is easier to update the conditions, banners, logos, and other promotional material from one place.
**The integration with Contentful uses** [API limits](/guides/limits#api-limits) **for campaigns with documentID in the metadata.**
You can view how to set up the integration here:
Voucherify and Contentful integration video.
## Setting up the integration
Follow these steps to set up the integration.
### Voucherify
On the Voucherify side, you will need to generate API integration keys for Contentful.
1. Go to **Project Settings** and in the **General** tab, scroll down to **Integration Keys**.
2. Click the plus button on the right.
3. Fill in the **Name** for your key.
4. Choose your role from the **Role** drop-down list.
5. Choose **Contentful** from the **Integration** drop-down list.
6. Click **Create Integration API Key** button.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
### Contentful
Configure settings in Contentful.
1. Create a new [Contentful account](https://www.contentful.com/sign-up/) or request an invitation to an existing project.
2. Go to **Apps** and click the **Marketplace** button.
3. Search for Voucherify. Select it and click **Install**.
4. Select your environment and click **Authorize access**.
5. In the configuration screen, fill in the required fields:
1. Provide Voucherify API integration keys: **Application ID** and **Secret Key**.
2. Set **Custom URL** to: `https://cms-integrations.voucherify.io`. If your project uses a region other than EU1, the URL should have the prefix `https://.cms-integrations.voucherify.io`
6. Click **Verify Credentials**.
7. If the credentials are correct, click **Install**.
8. Once the installation is successful, click **Save** in the upper right corner to save the provided configuration in the Contentful app.
9. Create your own [Content type](https://www.contentful.com/help/adding-a-content-model/) or edit an existing one. In the **Content type** which includes your target fields (e.g. text, date and time, media), add a JSON object field.
10. Name the JSON object and click **Add and configure**.
11. Configure the JSON object to link to Voucherify resources such as a campaign, promotion tier, or an earning rule. In the object edit screen, scroll down to the **Appearance** section and choose the Voucherify app you have installed earlier.
12. Click **Confirm** and then **Save**.
You have now linked the Content model to Voucherify by using the JSON object field type. In the next steps, you will learn how to use this configuration in Contentful Entries.
At this point you can create your own [Entry](https://www.contentful.com/help/adding-new-entry/) and use the Voucherify app resources: **Campaigns**, **Earning Rules**, and **Promotion Tiers**.
Once integrated, Contentful automatically creates a new metadata array for linked Voucherify campaigns, earning rules, or promotion tiers upon the first connection. Each **contentfulEntity** contains the **Entry ID** and the **contentType**. If a Voucherify resource is linked to several Contentful entries, all those entries will be listed in metadata as **contentfulEntities** with respective **Entry ID**s and **contentType**s.
## Linking Contentful entries to Voucherify
The integration between Voucherify and Contentful allows your team to create and manage content directly in Contentful.
Once the integration is complete, the content with Voucherify fields can link the content to a Voucherify campaign, promotion tier, or earning rule.
In this example, a content type has a name, description, and terms and conditions fields and can be linked to Voucherify’s resources.
Voucherify will show the list of all the resources for you to choose from a pop-up window in Contentful with links to Voucherify campaigns.
Once you choose the resource and the content is published, the **Entry ID** will be associated with the campaign, earning rule, or promotion tier in Voucherify.
The linked **Entry ID**s will be returned via the Voucherify API in the form of metadata. Once you retrieve the campaign, promotion tier, or earning rule details from Voucherify via the API, the Entry ID list will be returned. Your development team must use the returned Contentful **Entry ID**s to fetch the content from the Contentful CMS.
If a campaign uses a voucher metadata schema, updating the content for that campaign will change the metadata of every voucher that was not published and not redeemed. Depending on the number of vouchers, this action can take from a couple of minutes to hours for multi-million voucher campaigns. During that time, the campaign will not allow any changes.
# Create distribution
Source: https://docs.voucherify.io/integrations/create-distribution
Create manual and automatic distributions to deliver messages, rewards, and vouchers to your customers
Suggested reading
This page covers how to create a distribution.
Read [Distribution overview](/integrations/distributions-overview) to learn how distributions work and the details of specific settings.
Distributions let you send messages, rewards, and voucher codes to selected customers. You can send distributions manually to a chosen audience or trigger them automatically based on customer activity and system events.
To create a distribution, go to **Engagement** > **Distributions** and click **Create distribution** to open the distribution builder.
Provide a unique name for the distribution in the **Name distribution** field.
**Save draft** to pause the configuration and continue later.
For example, you can save a draft while waiting for a customer segment to finish syncing.
## Manual distribution
Use manual distributions (manual message) to send one-time messages or rewards to selected customers or customer segments.
In the **Category** dropdown, select **Manual messages**.
Choose who receives the distribution:
* **A message to a single customer**: Select an existing customer or add a new customer.
* **Bulk messages to customers from \[segment]**: Select an existing segment or create a new one.
Use the filter icon to open advanced segment filtering options and review matching customers.
Voucherify sends manual distributions with a 10-minute delay. If you create a new customer segment, the countdown starts only after the segment finishes syncing. You can monitor the syncing status next to the segment name.
Choose what the distribution sends:
* **Notify customers about promotion**: Select the promotion tier to include in the message.
* **Send and publish unique codes from campaign**: Select the source campaign.
* **Send plain message to customers**: Send a message without incentives.
Use **Add channel** to choose delivery channels. You can add multiple channels to the same distribution.
The list of the available channels depends on the selected **Action**.
Review the distribution settings.
**Save & Send** to confirm.
The distribution starts 10 minutes after it's saved. You can edit the distribution during this time. Your changes are applied before sendout.
## Automatic distribution
Use automatic distributions to send messages automatically when customers perform specific actions or when system events occur.
In the **Category** dropdown, select the event category that triggers the distribution, such as **Segment related activity**, **Cart related activity**, or **Customer rewards**.
Then select the specific trigger event, for example **Order paid** or **Customer entered segment**.
Depending on the trigger, you can or you must select one of the following:
* Customer segment
* Validation rule
* Campaign
* Custom event
* Loyalty campaign tier
Choose what the distribution sends. Available actions depend on the selected trigger.
Use **Add channel** to select delivery channels.
The list of the available channels depends on the selected **Trigger** and **Action**.
Review the distribution logic.
**Save & Send** to activate the distribution.
The distribution is active and sends messages automatically when the trigger conditions are met.
## Related features
Learn more about the following features that work together with distributions.
Many distribution triggers are based on customers belonging to a customer segment.
Customer segments group together customers who share defined properties and custom attributes (metadata).
Learn more about [customer segments](/prepare/customer-segments).
Some distribution triggers can be limited with a validation rule.
A validation rule limits when the event is triggered. When the rule is met, then the distribution sends a message.
Learn more about [validation rules](/optimize/validation-rules-reference).
# Customer engagement platforms
Source: https://docs.voucherify.io/integrations/customer-engagement-platforms
Integrate Voucherify with CEPs to deliver personalized incentives across channels
Customer Engagement Platforms (CEPs) orchestrate personalized, cross-channel communications based on customer behavior and data. Integrating Voucherify with your CEP allows you to deliver the right incentive at the right time through the right channel.
## Why integrate with a CEP?
Voucherify handles incentive logic: validation, redemption, budget control, and fraud prevention. Your CEP handles delivery: timing, channel selection, and message personalization. Together, they form an incentive loop where every campaign becomes a live experiment you can trigger, measure, and adjust.
**Key capabilities:**
* **Behavior-triggered incentives**: Automatically distribute codes when customers perform specific actions (cart abandonment, subscription renewal, milestone reached).
* **Segment-driven campaigns**: Target VIP customers, dormant users, or any segment defined in your CEP with tailored rewards.
* **Unique codes in templates**: Pull individual voucher codes, gift cards, or loyalty balances directly into message templates.
* **Real-time event sharing**: Send Voucherify events (redemptions, loyalty updates, publications) to your CEP to trigger follow-up communications.
## Integration patterns
Most CEP integrations follow one of these patterns:
| Pattern | Description | Use case |
| ---------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| **Webhooks** | Voucherify sends events to your CEP when actions occur (redemption, publication, loyalty update). | Trigger follow-up messages after a customer redeems a code. |
| **API calls from CEP** | Your CEP calls Voucherify APIs (using Connected Content, Content API, or webhooks) to fetch or publish codes. | Dynamically insert a unique code into an email at send time. |
| **Custom attributes** | Sync voucher codes, balances, or campaign data to customer profiles in your CEP. | Display loyalty points in a mobile push notification. |
| **Bulk code import** | Export codes from Voucherify and import them into your CEP's coupon list. | Large-scale campaigns where codes are pre-generated. |
## Supported platforms
Event sharing, Connected Content, custom attributes, and promotion code lists.
Custom profile attributes, webhook-based flows, and bulk code import.
Content API integration for real-time code publication in campaigns.
Bidirectional sync: send events to Bloomreach and receive customer updates.
Webhook-based integration for code distribution and event tracking.
Connect customer engagement data with Voucherify incentives.
Additional integrations: [Infobip](/integrations/infobip), [ActiveCampaign](/integrations/activecampaign), [Airship](/integrations/airship), [Batch](/integrations/batch), [Mailchimp](/integrations/mailchimp), [SendGrid](/integrations/sendgrid), [Twilio](/integrations/twilio), [Salesforce Marketing Cloud](/integrations/salesforce-marketing-cloud).
## Common scenarios
Explore the common scenarios for using Voucherify together with Customer Engagement Platforms.
### Abandoned cart recovery
1. Customer abandons cart → CEP detects the event.
2. CEP calls Voucherify to publish a unique discount code.
3. CEP sends an email with the code to incentivize purchase completion.
### Loyalty program updates
1. Customer earns points → Voucherify sends a `REWARDED.LOYALTY_POINTS` event to your CEP.
2. CEP triggers a push notification showing the updated balance.
3. When points near expiration, CEP sends a reminder.
### Win-back campaigns
1. CEP identifies inactive customers via segmentation.
2. CEP triggers a webhook to Voucherify to publish a reactivation code.
3. Voucherify distribution updates the customer profile in the CEP.
4. CEP sends a personalized message with the code.
## Getting started
1. **Connect your CEP**: Go to **Integrations** in your Voucherify **Project settings** and configure API credentials for your platform.
2. **Set up distributions**: Define triggers (segment entry, custom event, successful publication) and select your CEP as the channel.
3. **Map fields**: Configure which Voucherify data (code, value, expiration) syncs to customer profiles.
4. **Test the flow**: Use a test customer to verify codes are published and delivered correctly.
Depending on the integration flow, CEP integrations may consume [API limits](/guides/limits#api-limits), [webhook limits](/guides/limits#webhooks), or message limits as described in the [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1). Plan your campaign volumes accordingly.
## What's next?
* Review the integration guide for your specific CEP.
* Learn about [distributions](/integrations/distributions-overview) to automate code delivery.
* Explore [webhooks](/api-reference/introduction-to-webhooks) for event-driven workflows.
# Customer.io integration
Source: https://docs.voucherify.io/integrations/customer-io
Learn how to integrate Voucherify with Customer.io to deliver personalized, cross-channel journeys and dynamically distribute voucher codes.
Customer.io is an AI-driven Customer Engagement Platform (CEP) that turns first-party data into personalized, cross-channel journeys. It unifies messaging, data routing, and analytics in one platform, allowing brands to deliver tailored, real-time communications.
## How does the integration work?
The most basic way to integrate Voucherify with Customer.io is through [webhooks](/api-reference/introduction-to-webhooks). Voucherify can send webhook events directly to Customer.io, which captures the data and uses it to create or update a customer profile with a custom attribute, for example, a voucher code.
Once the code is stored in the customer profile, it can be inserted into messages. Using Liquid, you can add the attribute to your message content so the code is dynamically filled in at send time.
## Scenario ideas
You can try these scenario ideas when using [Customer.io](http://customer.io/) and Voucherify.
When a customer completes their first order, renews a subscription, or abandons a cart, Customer.io can notify Voucherify to create a discount code and send it to them.
Customer.io segments, such as VIP customers or inactive users, can trigger specific Voucherify rewards like loyalty coupons or referral codes.
Voucherify generates individual codes for each customer that Customer.io inserts into messages. This prevents code reuse and keeps campaigns secure.
## Setting up the integration
This guide explains how to connect Voucherify and Customer.io. In this scenario, each time you publish a code in your Voucherify campaign, Voucherify posts a webhook to Customer.io. The webhook updates the customer’s profile in Customer.io with the code attribute. The Customer.io broadcast detects that the code exists in the customer’s profile, and sends the email – or any other type of message supported by Customer.io – containing the code to the customer. This completes the loop from publication in Voucherify to delivery in the customer’s inbox through Customer.io.
In [Customer.io](http://customer.io/):
1. [Create a new campaign](https://docs.customer.io/journeys/create-a-campaign/) from the **Campaigns** tab.
2. Choose a **Webhook** trigger.
3. Copy the webhook URL that Customer.io provides.
1. Create a [Discount coupons](/build/create-discount-coupons) campaign in Voucherify.
2. Provide a name, set the time frame, and define the discount value.
3. Save the campaign.
This campaign will be the source of the codes that you send to customers.
1. In the **Distributions** tab, create a new distribution.
2. Set the trigger to **Successfully published** and select the coupon campaign you created.
3. Select **Webhook** as the channel and paste the same Customer.io webhook URL.
4. Save the distribution.
This configuration ensures that publishing a code in the campaign sends a webhook to [Customer.io](http://customer.io/).
In Voucherify, you can configure different types of distribution triggers, such as custom events or segment-based rules. To explore all available options, read the article on [distributions](/integrations/distributions-overview).
1. Publish a code from the Voucherify campaign to a test customer.
2. The publish action triggers the distribution and posts a webhook to Customer.io.
3. In the Customer.io campaign workflow, confirm that a sample webhook was received.
4. Use the fields from this payload to update the customer profile.
1. Add a **Create or Update Person** step after the webhook in your Customer.io workflow.
2. Use the webhook payload to identify the person and store the code.
3. Set the person identifier to the email from the payload using `{{data.publication.customer.email}}`.
4. Save the voucher code to a profile attribute, for example, `gift_code`, using `{{data.publication.voucher.code}}`. You can choose a different attribute name (such as `voucher_code`).
1. Create a broadcast in Customer.io.
An API‑triggered broadcast works well for this flow, because it sends automatically when the code attribute appears in the profile.
2. Define a condition such as “`gift_code` exists” (or your chosen attribute name).
customer-io-define-broadcast.png
3. Add **Email** as the messaging channel in the workflow and edit the message content. Insert Liquid to display the code stored on the profile:
```liquid theme={null}
Your gift code: {{customer.gift_code}}
```
4. Once finished editing the message, you can start the broadcast.
Start the Customer.io campaign and the broadcast. Publish another test code in Voucherify to the same test customer. In Customer.io, verify that the person’s profile contains the code attribute and that the broadcast sent the email with the expected value.
This completes the loop from publication in Voucherify to delivery in the customer's inbox.
# Distribution overview
Source: https://docs.voucherify.io/integrations/distributions-overview
Learn how Voucherify distributions work and what triggers and channels are available
The distribution manager automates communication with your customers. It helps you send messages or incentives automatically when specific events occur.
Distributions can send messages directly to customers or transfer data to external tools such as Braze, Mailchimp, or webhook endpoints.
## When to use distributions
Use distributions when you want Voucherify to automatically send a message or incentive after a specific event.
Common use cases include:
* Sending a welcome code when a customer enters a segment.
* Notifying customers when loyalty points are added.
* Sending reward details after a reward is redeemed.
* Delivering a promotion code after it is published to a customer.
* Sending event data to another system with webhooks.
## Key concepts
Distributions are built from four main elements.
A message is the data Voucherify pushes to the end customer or another application.
A trigger defines when Voucherify starts a distribution.
For example, a distribution can start when:
* Customer enters a segment
* Voucher is redeemed
* Loyalty points are added
The audience defines who receives the message.
Depending on the selected trigger, the audience can include:
* Single customer
* Customers in a segment
* Customers affected by an event
The action defines what customers receive after the distribution is triggered.
Depending on the selected action, the message can include:
* Voucher code
* Promotion details
* Redeemed reward information
* Plain message
The channel defines how Voucherify delivers the message or transfers data.
Common channels include:
* Email: Sends messages directly from Voucherify.
* SMS: Sends text messages through configured SMS providers.
* Webhook: Sends event data to external systems.
* External integrations: Transfer Voucherify data to tools like Braze or Mailchimp.
Available channels depend on the selected trigger and action.
## Distribution types
Voucherify supports manual and automatic distributions.
### Manual distribution
Use manual distributions when you want to send a one-time message or incentive without waiting for an event trigger.
Messages are delivered with a 10-minute delay. This delay gives you time to stop or edit the distribution before messages are sent.
Manual distributions can target:
* Single customer
* Customer segment
### Automatic distribution
Use automatic distributions when you want Voucherify to react automatically to customer activity or system events.
For example, automatic distributions can start when:
* Customer enters a segment
* Voucher is redeemed
* Loyalty points are added
## Distribution triggers
Triggers define when Voucherify starts a distribution.
In the distribution builder, you choose one trigger to start the workflow.
Use these triggers to react to customers entering or leaving a segment:
* **Customer entered segment**: Starts the distribution when a customer starts matching the segment rules, for example after a profile update, import, or tracked event. You can also include customers who are already in the selected segment when the distribution is activated.
* **Customer left segment**: Starts the distribution when a customer no longer matches the segment rules.
Use these triggers to react to order lifecycle changes:
* **Order created**: Starts the distribution when a new order is created.
* **Order updated**: Starts the distribution when an existing order changes.
* **Order paid**: Starts the distribution when an order status becomes paid.
* **Order canceled**: Starts the distribution when an order is canceled.
Use these triggers to react to gift card and loyalty point updates:
* **Gift credits adjusted**: Starts the distribution when credits are added to or removed from a gift card.
* **Loyalty points adjusted**: Starts the distribution when points are added to or removed from a loyalty card.
* **Loyalty points expired**: Starts the distribution when loyalty points expire.
* **Loyalty pending points adjusted**: Starts the distribution when pending points are added to or removed from a loyalty card.
* **Loyalty pending points updated**: Starts the distribution when pending points change.
* **Loyalty pending points activated**: Starts the distribution when pending points become active.
* **Loyalty pending points canceled**: Starts the distribution when pending points are removed.
* **Voucher redeemed**: Starts the distribution after a successful voucher redemption.
* **Voucher redemption rolled back**: Starts the distribution when a voucher redemption is reversed.
Use these triggers to react to loyalty reward activity:
* **Reward redeemed**: Starts the distribution when a customer redeems a loyalty or referral reward.
Use this trigger when you want to send a one-time message without an event trigger:
* **Manual message**: Sends a distribution manually after confirmation.
Use this trigger to react to code assignment events:
* **Successfully published**: Starts the distribution when a code is published to a customer.
Use this trigger to react to custom events tracked in Voucherify:
* **Custom event**: Starts the distribution when your system tracks a custom event in Voucherify.
Use these triggers to react to customer activity in loyalty tiers:
* **Customer entered loyalty tier structure**: Starts the distribution when a customer joins a tier structure.
* **Customer left loyalty tier structure**: Starts the distribution when a customer leaves a tier structure.
* **Customer loyalty tier upgraded**: Starts the distribution when a customer moves to a higher tier.
* **Customer loyalty tier downgraded**: Starts the distribution when a customer moves to a lower tier.
* **Customer loyalty tier prolonged**: Starts the distribution when tier validity is extended.
* **Customer rewarded loyalty points**: Starts the distribution when loyalty points are granted.
Use this trigger to react to referral events:
* **Customer was referred**: Starts the distribution when a new customer is successfully referred.
## Distribution actions
Use actions to define what customers receive after a distribution is triggered.
Common actions include:
* **Send and publish unique codes from campaign**: Voucherify selects a code from a campaign, publishes it to the customer, and sends it.
* **Notify customers about promotion**: Sends details of an in-cart promotion tier.
* **Send plain message to customers**: Sends a message without a voucher or reward.
* **Customer will get a message with amount of received credits**: Sends a message when a customer receives new credits on a gift card. The message includes the credited amount.
* **Customer will get a message with amount of received points**: Sends a message when a customer receives new loyalty points. The message shows how many points were added.
* **Customer will get a message with reward details**: Sends a message after a customer redeems a reward in a loyalty campaign. The message includes reward information.
* **Customer will get a promotion code from \[campaign]**: Sends a message when a code is successfully published to a customer from the selected campaign.
* **Customer will get a message**: Sends a configured message related to the selected action.
## Channels
Use channels to decide how customers receive messages or how Voucherify transfers data to external systems.
Voucherify offers:
* Built-in channels like email, SMS, webhooks.
* Integrated tools like Braze, Mailchimp, Klaviyo, Intercom, and more.
Some integrations do not send messages directly to customers. Voucherify transfers the code or event data to the external platform, where the final message is sent.
## Limits and anti-spam policy
To send messages through Voucherify, your account must follow the Voucherify [anti-spam policy](https://www.voucherify.io/legal/anti-spam-policy-v1-1):
* Trial accounts are limited to 10 total messages before verification.
* Verified trial accounts can send up to 10 messages per day and 100 per month.
* Email sending requires **Brand Details** in [Project settings](/manage/project-settings).
Large-scale distributions are governed by the Voucherify [Fair use policy](https://www.voucherify.io/legal/fair-use-policy-v2-3).
## Create distribution
Read the [Create distribution](/integrations/create-distribution) article to learn how to set up a distribution.
## Managing distributions
Go to **Engagement** > **Distributions** and click on a given distribution to monitor its activity and delivery status.
Each distribution includes:
* Dashboard summary with delivery statistics
* Performance metrics for sent messages
* Issue reporting for failed deliveries
* Activity log with distribution events
## Related features
Learn more about features related to distributions.
Learn how Voucherify assigns unique codes to customer profiles and why [publications](/orchestrate/code-publication) are required for loyalty and referral campaigns.
Use [webhook](/api-reference/introduction-to-webhooks) channels to send Voucherify events and incentive data to external systems in real time.
Build [customer segments](/prepare/customer-segments) based on customer attributes, metadata, and tracked behavior.
# Infobip
Source: https://docs.voucherify.io/integrations/infobip
Engage customers with messages and Voucherify incentives
Infobip, a global communication platform, allows businesses to engage customers through SMS, WhatsApp, and email, while Voucherify enables personalized [promotions](/build/create-discount-promotions), [vouchers](/build/discount-promotion-overview), and [loyalty programs](/build/create-loyalty-campaign). By combining the strengths of both platforms, you can streamline marketing campaigns that engage your customers across channels with personalized offers. Some example use cases in marketing campaign engagement scenarios are:
* **Automated Birthday Campaigns** **via various Messaging Channels**. Automatically send personalized birthday offers to customers via their preferred messaging channel (e.g., WhatsApp, SMS, Viber) to enhance engagement and encourage voucher redemption.
* **Cart Abandonment Recovery with Personalized Discounts**. Use personalized discount vouchers sent through a customer’s preferred messaging channel to win back those who have abandoned their shopping carts.
* **Loyalty Program Engagement**. Reward loyal customers by sending real-time updates about their loyalty status or rewards through their chosen communication platform.
* **Event-Triggered Campaigns** (e.g., Black Friday Flash Sales). Maximize engagement during special events by sending time-sensitive offers across [multiple messaging channels](/integrations/distributions-overview), ensuring timely outreach to various customer segments.
Also, Infobip’s contact center and customer support capabilities can be extended with Voucherify to enable the following scenarios:
* **Appeasement Codes for Customer Resolutions**. Customer support agents can quickly generate and share appeasement codes (e.g., discounts or free shipping vouchers) via a customer’s preferred channel directly from their support platform to resolve issues swiftly and improve satisfaction.
* **Proactive Problem-Solving with Personalized Offers**. When an issue is detected (e.g., delayed shipment), a personalized apology voucher or discount can be automatically generated and sent to the customer, preemptively addressing concerns and showing appreciation for their patience.
* **Feedback-Based Incentives**. After a customer support interaction, send a satisfaction survey, and upon completion, instantly deliver a voucher or discount code as a token of appreciation, fostering engagement and encouraging feedback.
The following guide will walk you through the process of setting up an Infobip + Voucherify integration flow without any coding necessary to automatically send a personalized WhatsApp birthday message with a discount voucher to your customers.
## Overview of the flow
The flow involves three steps:
1. Triggering the Flow. The trigger can be:
* External source (e.g., CRM, CDP, or e-commerce)
* Action or event,
* Predefined audience in Infobip,
* Inbound message,
* Change in person’s profile.
In this example, an [API call to Infobip](https://www.infobip.com/docs/moments/flow-elements/flow-entry-exit#flow-api-external-source) triggers the flow.
2. Calling Voucherify API: Infobip flow calls Voucherify to generate and retrieve a personalized voucher code.
3. Sending WhatsApp Message: Infobip extracts the voucher code and uses it in a WhatsApp message to the customer.
## Step-by-step configuration
Follow these steps to set up this scenario.
### Creating a flow in Infobip’s Flow Builder
1. Access the Flow Builder: Navigate to the Campaigns section and select Flows to [create a new flow](https://www.infobip.com/docs/moments/manage-flow).
2. Define the Trigger: Choose External Source and Flow API as the starting point. This allows the flow to be triggered externally via an API call.
You will get the Infobip’s API endpoint URL for this specific flow.
Refer to [Infobip documentation for details on how to call this endpoint](https://www.infobip.com/docs/api/customer-engagement/moments/add-flow-participants). You may also need to update [the API Base URL](https://portal.infobip.com/dev/api-keys).
### Making an API call to Voucherify
1. Add “Call API” Block in Infobip flow.
2. Configure the API Call to Voucherify
To generate unique personalized vouchers, a Voucherify [Discount Code Campaign](/build/create-discount-coupons) needs to be configured. Then, the codes can be generated via [Voucherify’s Create Publication API endpoint](/api-reference/publications/create-publication).
* Request URL: `https://{region}.voucherify.io/v1/publications`
* HTTP Method: POST
* Header: Include Content-Type: application/json and the necessary Voucherify API credentials (X-App-Id and X-App-Token).
* Body Payload: Pass the data needed for Voucherify to create the voucher, such as the `customer_id`, `campaign_id`, and any other metadata required in JSON format.
```json theme={null}
{
"campaign": {
"name": "Happy Birthday 2024 Coupons Campaign"
},
"customer": {
"source_id": "{$id}"
},
"metadata": {
"callFrom": "Infobip"
}
}
```
You can pass `customer.source_id` as placeholder so that either ID from external source or Infobip’s internal ID could be used in the runtime. Voucherify can work with any external ID.
### Extracting the voucher code
Once the API call is successful, configure Infobip to extract the voucher code from the API response. On the Response tab of Call API block configuration, turn “Wait until response is received” toggle on.
In Response Body Variable, add a Variable. Use JSON path expression `$.voucher.code` to map the voucher code to a flow variable, e.g., `{voucher_code}`. A flow variable can be either preconfigured in the flow settings or configured in the context of the Call API block configuration.
For the sake of simplicity, the API Call block error handling configuration capabilities is skipped here.
### Sending the WhatsApp message with voucher code
1. Connect “Send WhatsApp Message” block to “Call API” block:
2. Configure WhatsApp Messaging Block:
* Use a message template that includes personalized elements like the customer’s name and the generated voucher code.
* Include the `{voucher\_code}` variable extracted earlier to insert the voucher code dynamically in the WhatsApp message.
* Example message template: `🎉HappyBirthday{firstName}!Here’sa$50discountonyournextbouquet.Usecode{voucher_code}toredeemyourgift!`
`{firstName}` here is a standard Infobip variable; `{voucher_code}` is a flow-specific variable that was configured earlier.
### Launching the flow
Make sure you give a name to the flow and click the **Validate** button. If everything is configured correctly, the flow is ready to launch.
You can observe the flow’s live performance, e.g., the number of engaged users or total engagements, on Infobip canvas.
Voucherify must be integrated with the e-commerce store to enable customers to redeem their voucher codes. This integration ensures that the generated voucher codes sent through the Infobip flow can be validated and redeemed during checkout.
## Throttling
Voucherify limits the number of API requests you can send per month or hour/minute. To avoid surpassing these limits, use the built-in Infobip’s throttling mechanism.
By adding throttling, you can prevent your application from sending more requests than allowed within the allotted timeframe. For example, you could configure your system to send only a maximum of 80 requests per minute if the limit is 100, leaving some buffer space for validation and redemption requests in other parts of the integration.
To introduce throttling, add a defined message-sending speed that’s available in the “Scheduling” tab of Infobip’s Call API block.
# Intercom
Source: https://docs.voucherify.io/integrations/intercom
The Intercom plugin is currently unsupported and won't be developed.
Voucherify provides integration with Intercom that enables you to deliver unique coupon codes through both the live chat window and via email.
The Intercom integration supports data exchange between Intercom and Voucherify.
The integration with Intercom consumes [webhook limits](/guides/limits#webhooks) for sending messages, but actions that are sent from Intercom to Voucherify consume [API limits](/guides/limits#api-limits).
## Voucherify applications for Intercom
You can connect Voucherify with Intercom by using two applications:
* **Voucherify plugin**: Enables you to send messages from Voucherify dashboard to Intercom customers.
* **Voucherify rewards**: Provides predefined messages sent instantly from a Messenger window in response to a complaint or other scheduled events.
## Voucherify plugin – send codes from Voucherify dashboard to Intercom customers
You can use Voucherify distributions to automatically distribute specific coupons, personalized messages, and promotion info to your Intercom customers.
1. [Connect your Intercom account with Voucherify](#voucherify-and-intercom-integration)
2. [Create manual Intercom distribution to existing customers](#manual-distribution) or
3. [Set automatic coupon send out based on specific rules](#automatic-distribution)
### Voucherify and Intercom integration
Firstly, you need to connect your Intercom account to Voucherify.
1. Select **Integrations tab** in the Home section
2. Expand Intercom integration and click **Connect**. You'll be redirected to an Intercom integration website with required Voucherify permissions.
3. Choose Connect to confirm and finish the integration
4. When it's ready, you'll be back to the Voucherify Integrations page. If your account was connected successfully, you'll see it next to the Intercom logo
### Add your customers
When both accounts are connected, you need to add your customers from Intercom to Voucherify. Use [the CSV file and import tool](/prepare/customers) or add customers with [Voucherify API](/api-reference/customers/create-customer).
You can add custom fields (metadata) to pass customer attributes and Intercom tags to customer profiles in Voucherify. For example, you can attach a property source which equals to Intercom and build a customer segment with Intercom audience in Voucherify:
1. Add all custom attributes to [the metadata schema](/prepare/metadata) in the Voucherify dashboard
2. Create a CSV file with customer's data. Map user ID from Intercom to customer's source ID in Voucherify.
3. When you have a CSV file with customers data, you can [import customers](/prepare/customers) to your Voucherify dashboard. Go to the Customers tab in the Engagement section and select the three dots in the upper right corner. While importing your CSV, you need to map added attributes to built-in fields and custom fields visible in the metadata section in the customer profile.
4. Lastly, you can [create a segment](/prepare/customer-segments) of customers who receive a message with code. Voucherify segments can be based on built-in properties or custom attributes (metadata).
5. When the segment filters are set, choose Add and Reload. Then, confirm by clicking SAVE.
Now, you can run distribution and send codes to your Intercom customers from the Voucherify dashboard.
### Intercom distribution
In the Engagement section, go to Distributions.
Decide whether you want to set up manual or automatic distribution.
#### Manual distribution
Manual distribution delivers messages once you confirm its settings with **Save & Send.** Each manual distribution is sent with a 10-minute delay, so you can introduce edits or stop the message delivery within this time.
If you chose a customer segment as your audience, 10 minutes countdown starts when the segment is fully synced. Syncing ends once all customers were validated against segment criteria. Syncing status is displayed next to the segment name so you can monitor if the segment is already synced or if syncing is in progress.
In Distribution Manager, set the name, define the trigger and action, and choose your audience. Manual distribution delivers messages to a single customer or all customers from the chosen segment.
#### Automatic distribution
Automatic distribution can trigger a message in response to one of the following actions:
1. Changes in a chosen customer segment:
* Customer entered segment
* Customer left segment
2. Voucher-related activity:
* Gift credits added
* Loyalty points added
* Loyalty points expired
* Voucher redeemed
* Voucher redemption rollback
* Reward redemption
3. Cart-related activity (once your order data are synchronized with Voucherify, distribution can respond to changes in customers' orders):
* Order update
* Order has been paid
* Order creation
* Order canceled
4. Customer-related activity
* Customer entered loyalty tiers structure
* Customer exited loyalty tiers structure
* Customer loyalty tier upgraded
* Customer loyalty tier downgraded
* Customer loyalty tier prolonged
* Customer rewarded loyalty points
* Customer was referred
5. Successfully published – the message is sent once the code from a campaign is assigned to a customer.
6. Custom event - Send messages to customers when a custom event was created for them.
You can name the distribution and choose the message action, trigger, and audience.
### Channels choice & messages
The next step is about channel(s) configuration. First, enable Intercom as the distribution channel. You can enable many channels within a single distribution.
You can choose between Intercom in-app messages and emails. Provide message details and design the template.
## Intercom Retain Your Customer
Intercom Retain Your Customer is a built-in loyalty and incentives system that lets companies award customers with discounts, credits, or access to special features based on their actions or engagement.
You can trigger a personalized "sorry" coupon or a gift card in response to a submitted complaint. Apologies are sent instantly from the Messenger window before any negative mentions start harming your brand.
Before downloading the app, create campaigns with vouchers that you'd like to send to customers via Intercom.
### Installation
1. In the first step, find **Voucherify Rewards** in the Intercom App Store.
2. Choose **'Install now'** and **'Connect'**
3. While integrating accounts, you'll be redirected to your Voucherify dashboard to choose which of your Voucherify projects should be plugged in.
4. When the installation is done, you'll be back to your Intercom account.
### Configuration
Specify priorities and map them to existing Campaigns. Go to the Integrations directory in the Voucherify dashboard and expand integration details.
If you wish to add a new campaign to your Intercom Retain Your Customer make sure to do the following steps: go to the Intercom Retain Your Customer settings, add a campaign, and then use a Plus button next to the campaign to confirm adding it to the list. You should see an additional empty row added. Then, use an *Update configuration* button and check if the campaign was added.
## Respond to complaints
1. From now on, you can instantly respond to complaints by sending Voucherify codes straight from the Messenger. When the message is ready, choose **'Send'**.
2. Your customers get their codes by clicking on a CTA button in a message.
Auto-increase voucher count mode
It may be worth to choose an auto-increase voucher count campaign mode to manage all complaints without worries that codes will run out. The auto-increase voucher count mode extends campaign with new codes according to your current needs.
# Iterable
Source: https://docs.voucherify.io/integrations/iterable
Iterable is a cross-channel marketing platform that powers unified customer experiences. It allows you to create complex distribution scenarios targeting your customers with personalized messages.
Voucherify can boost customer experience by adding a voucher with a unique coupon code to each message sent to a customer. This voucher can encourage the customer to make a purchase or distribute referral codes to referrers.
You can use Voucherify's Publication request as a data feed in Iterable to track customers who received the voucher from you. You can use this action to start the validity period of the voucher or specify that only the voucher holders can use it.
In this article, you will learn how to configure the integration between Voucherify and Iterable.
The integration with Iterable uses [API limits](/guides/limits#api-limits) for Data Feed.
## Configuration
Voucherify offers different API requests that can be integrated with tools that understand REST APIs. Iterable works similarly: you can add the APIs as data feeds and use the feeds in a template. The data feeds must use Voucherify's API keys for Iterable.
To generate the keys, go to the **Project Settings**. In the **General** tab, scroll down to **Integration Keys** and create a new integration API key for Iterable. In the **Name** field, enter the name for your key. In the drop-down lists, select **User** in **Role** and **Iterable** in **Integration**.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
Once the API keys are generated, you can create data feeds in Iterable. Go to your Iterable account and select **Content** > **Data feeds.**
Select the **CREATE NEW FEED** button in the upper right part of the screen to create a new data feed.
The data feed will use Voucherify's publication mechanisms that assign a voucher to a customer. To add this mechanism to Iterable send-outs, you need to combine:
* Voucherify's publication endpoint URL,
* The application keys,
* A parameter that identifies the customer in Iterable,
* The Voucherify campaign that is the source of the vouchers.
To find your API endpoint in Voucherify, go to **Project settings** > **General** tab and scroll down to **Application Information** > **API endpoint**.
The structure of your API endpoint should be `YOUR API ENDPOINT/v1/publications/create`.
Use the table below to find your endpoint for publications.
| Shared Region | Endpoint for Publications |
| -------------------- | ------------------------------------------------------ |
| **Europe (default)** | `https://api.voucherify.io/v1/publications/create` |
| **United States** | `https://us1.api.voucherify.io/v1/publications/create` |
| **Asia (Singapore)** | `https://as1.api.voucherify.io/v1/publications/create` |
The API URL must contain not only the customer's ID as a parameter but also the name of the campaign. In this section, you will see how to receive a voucher from the Welcome Codes campaign.
Here is an example of a URL: `https://api.voucherify.io/v1/publications/create?customer[source_id]={{#urlEncode}}{{source_id}}{{/urlEncode}}&campaign[name]=Welcome Codes`
Each data feed has to be connected to a separate campaign.
You need to input the data accordingly.
Once the data feed is saved, you can use it in the templates.
### Cache data feed response
Select this option if your data feed returns the **same result for all recipients**. For example, a feed that provides the current list of active promotions.
When enabled, Iterable **caches the feed's response for one hour**.
* If the same feed URL is requested again within that hour, Iterable uses the cached response.
* If not, Iterable sends a new request to the feed.
Iterable builds the feed URL for each recipient by inserting profile data into the predefined URL.
If you **clear the checkbox**, Iterable makes a **new request for every recipient**, even if the response is the same.
## Iterable templates with a data feed
When adding your Voucherify code variable to an Iterable message template, you can reference it directly from the connected data feed.
If your setup involves **a single Voucherify campaign** connected to a single Iterable data feed (the most common and recommended scenario), use: `[[voucher.code]]`
This variable will automatically populate with each recipient's unique code published from Voucherify.
Example:
> Use your exclusive code \[\[voucher.code]] to get 10% off your next order!
If you are using **multiple Voucherify campaigns or data feeds** within the same Iterable project, each feed must have a unique alias.
In that case, you can reference the code with its alias prefix, such as: `[[welcome_codes.voucher.code]]`
Make sure the alias (`welcome_codes` in this example) matches the one defined in your Iterable data feed settings.
This advanced use case is only needed when several Voucherify campaigns feed data into the same Iterable project. For most users, `[[voucher.code]]` is sufficient.
The data feed will trigger the API request every time you send a message to a customer. You can show the end result in the message by providing the voucher code from the data feed. Since the goal is to show the voucher code to the customer and the alias is defined, add the following value to the message `[[voucher.code]]`
The API requests return the complete definition of the coupon code, so if you have added any kind of information to the [metadata](/guides/metadata-mapping), it can also be shown in the same way: `[[voucher.code.voucher.metadata.marketing_text]]`
As a result, the data feed will contain the information about the voucher, which has been assigned to the customer, including the voucher code and the marketing text.
In the image below, you can see how data is fed to the message:
## Iterable → Voucherify integration
Besides pulling data from Voucherify into Iterable using a data feed, it is also possible to send data **from Voucherify to Iterable**.
This section describes an **example integration** where Voucherify uses **custom webhooks** to notify Iterable about events that happen in Voucherify.
Iterable can then react to those events and send customer communication defined as Iterable campaigns.
### Example use case
In this example:
* Customer completes an action, such as a successful referral
* Voucherify publishes a reward, for example a discount code
* Customer receives an email sent from Iterable
Voucherify is responsible for detecting the event and publishing the reward.
Iterable is responsible to send the email.
## Flow
A successful referral assigns a reward to the customer.
Voucherify publishes the reward to the customer profile.
Publishing the reward automatically triggers a Voucherify distribution.
The distribution sends a custom webhook request to the Iterable API endpoint.
Iterable processes the webhook and sends a triggered email to the customer.
This shows that communication between Voucherify and Iterable can work in both directions:
* Iterable can pull data from Voucherify using data feeds.
* Voucherify can send data to Iterable using custom webhooks.
### Create a triggered email campaign in Iterable
In Iterable, create a **triggered email campaign**:
* The campaign is used to define the email content
* No data feed should be selected
* The campaign is triggered directly using an Iterable API endpoint
You can reference dynamic fields sent from Voucherify directly in the email template, using Iterable's Handlebars syntax: double curly braces around the field name.
For example, if the webhook payload includes a `couponCode` field inside `dataFields`, add the following to the template:
`{{couponCode}}`
At send time, Iterable replaces this with the actual value passed in the webhook request.
This syntax only works because the campaign is *triggered* by the same API call that carries the data. If you reference the field anywhere else, for example in a blast campaign, it won't resolve.
### Generate an Iterable API key
To allow Voucherify to send requests to Iterable:
In Iterable, go to **Integrations**.
Create a new **API key**, and set its type to **Server-side**.
Server-side keys have full read/write access and are meant to be used only in server-to-server calls, like the webhook Voucherify sends here. Don't use a client-side key for this integration.
Save the API key for later use.
The API key is used to authorize requests sent from Voucherify.
### Configure a Voucherify distribution trigger
In Voucherify, configure a **distribution** that is triggered when a reward is published.
Example configuration:
* Trigger: `successfully published`
* Reward type: discount code
The distribution does not send any email from Voucherify.
It is used only to trigger a custom webhook.
### Configure a custom webhook in the distribution
In the distribution action, configure a **custom webhook**.
Set the webhook's target URL to Iterable's campaign trigger endpoint:
* **US-hosted (USDC) projects:** `https://api.iterable.com/api/campaigns/trigger`
* **EU-hosted (EDC) projects:** `https://api.eu.iterable.com/api/campaigns/trigger`
Use the base URL that matches the data center your Iterable project is hosted on. An API key from one data center won't authenticate against the other's endpoint. If you're not sure which one your project uses, check with your Iterable account administrator or your Iterable representative.
Add an authorization header using the Iterable API key:
* Header name: `api-key`
* Header value: ``
Voucherify's header-name field requires lowercase. Entering `Api-Key` (capitalized) will be rejected and won't let you proceed. This doesn't affect Iterable's side. HTTP header names are case-insensitive, so `api-key` is delivered and read the same way as `Api-Key` would be.
The webhook payload must follow Iterable API requirements.
Enable the **Send raw payload** checkbox.
Important fields include:
* `recipientUserId` – identifies the Iterable user who should receive the email
* `campaignId` – identifies the triggered email campaign - you will find it in Iterable
* `dataFields` – values used inside the email template
Values from Voucherify, such as the published discount code, are passed as dynamic values. You can search for the right value after entering: `{{`
Payload example:
To send the email to the correct user:
* The Voucherify customer must have a `source_id`
* The same value must exist as the Iterable `userId`
This mapping allows Voucherify to identify the correct recipient in Iterable, so make sure your audience is synchronized.
### Result
When a reward is published in Voucherify:
* The distribution is triggered
* Voucherify sends a webhook request to Iterable
* Iterable sends a triggered email to the customer
* The email includes values such as the published discount code
This section shows **one example** of sending data from Voucherify to Iterable using custom webhooks.
Other Iterable endpoints can be used in a similar way. These options are not described here and are left for customers to explore.
# Klaviyo
Source: https://docs.voucherify.io/integrations/klaviyo
Share Voucherify codes through Klaviyo
Klaviyo is a unified customer platform that gives you complete control of consumer data and interactions. By utilizing over 250 native integrations, you can automate email, SMS, and push communications, providing a more personalized experience for your customers.
Voucherify provides a ready-to-go integration with Klaviyo, enabling you to share Voucherify codes via Klaviyo.
**The integration supports:**
* Sharing of promo codes, referral codes, loyalty card codes, and gift cards.
* Sharing related campaign information such as publication dates or QR codes.
* Saving and updating custom properties in Klaviyo related to the Voucherify distribution.
* Creating and modifying customers in Klaviyo.
The Voucherify integration with Klaviyo uses messages limits for sending codes to Klaviyo. You can read more about messages limits in our [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1).
## Voucherify distribution triggers
When setting up [distribution](/integrations/distributions-overview) in Voucherify, you can use Klaviyo with the following triggers:
* Customer left segment (send and publish unique codes from campaign)
* Customer entered segment (send and publish unique codes from campaign)
* Order updated (send and publish unique codes from campaign)
* Order paid (send and publish unique codes from campaign)
* Order created (send and publish unique codes from campaign)
* Order canceled (send and publish unique codes from campaign)
* Successfully published
* Custom event (send and publish unique codes from campaign)
* Manual message (send and publish unique codes from campaign)
* Loyalty points added
## Bulk import codes to Klaviyo
**Example Business Case: Bulk Voucher Distribution for Large-Scale Campaigns**
This approach covers exporting unique voucher codes from Voucherify and importing them into Klaviyo as a set of unassigned coupons for use in email or SMS campaigns. It allows for easy and efficient distribution of vouchers without complex API integrations and customer data sync processes.
### Step-by-step process
#### Generate voucher codes in Voucherify
* Create a [Bulk Unique Codes Campaign](/build/create-discount-coupons) in Voucherify. This allows you to generate a set of unique codes with all additional features – validation rules, expiration dates, usage limits, etc. You can generate as many codes as you need.
* Export the codes from Voucherify in a CSV file, the **Code** field is required in this scenario.
#### Prepare the CSV file for Klaviyo
* Open the exported CSV file in a spreadsheet editor.
* Rename the column header “Code” to “Coupon Code” or “Coupon” (in the first cell, A1).
* Save the file as a CSV file – with the proper column header, the file is ready to be uploaded in Klaviyo.
Klaviyo coupon code file requirements
* The maximum file size is 50 MB.
* There should be only one column in your file, and the first row of your file should be a header, labeled `Coupon` or `Coupon Code` .
### Import and use codes in Klaviyo
* In Klaviyo, [enable the Coupons tab under the Content section](https://help.klaviyo.com/hc/en-us/articles/115005084727#h_01H9NXQT7NA4R1XBCFZJM9JV67).
* [Upload the unique codes into Klaviyo](https://help.klaviyo.com/hc/en-us/articles/115005084727#h_01H9NXQT7NSXVEYQE2MDWYHG1T).
* [Refer to codes in Klaviyo message templates](https://help.klaviyo.com/hc/en-us/articles/115005084727#h_01H9NXQT7NDZ7WRXRV7WRGVB3X).
In the preview mode, Klaviyo shows a placeholder value like `{your uploaded coupons name}-PREVIEW` to avoid using up any real codes.
### Ensure sufficient codes
It is crucial to ensure that the number of voucher codes imported matches or exceeds the size of your send-out. For example, if you are sending a campaign to 1000 customers, make sure that at least 1000 unique voucher codes have been imported. If the codes run out during the campaign, some recipients will not receive a voucher.
### Summary
This approach is ideal for businesses wanting to execute quick, large-scale campaigns with minimal technical complexity. By leveraging Voucherify as the code generation tool, marketers can efficiently manage large volumes of unique codes and import them into Klaviyo for seamless distribution across their customer base.
## Updating Klaviyo’s profile custom attributes using Voucherify’s plugin
### Integration configuration
The integration requires generating a new API key in Klaviyo. Additionally, the API key needs to be configured to ensure full access to the API Scope – Profiles to allow Voucherify to add and modify customer attributes.
In Klaviyo, go to **Settings** > **Account** tab > **API keys** tab on the left sidebar.
Select **Create Private API Key** to generate a new key and choose **Full Access** for **Profiles**.
Once the API key is added, it will be visible in Klaviyo.
With the Klaviyo API key ready, connect both tools by going to Voucherify **Dashboard** > **Integrations** tab. Select **Klaviyo** and provide the API key in the pop-up screen.
### Distribution and assignment of promo codes
With both platforms connected, you can start a new [Voucherify distribution](/integrations/distributions-overview) that assigns a unique code to the **Custom Properties** in the user profile in Klaviyo. Later, you can use received attributes in your Klaviyo campaigns and emails.
Create a new distribution. Choose the trigger, fill in the name, and choose to send and publish codes from Voucherify. Choose the source of codes from a selected campaign.
Next, select **Klaviyo** as the distribution channel and map the fields you want to transfer to Klaviyo. Note that each published voucher will be transferred alongside the respective barcode and QR code, allowing you to run omnichannel campaigns.
You can map the following fields:
* Voucher code
* Voucher value
* Voucher balance (loyalty and gift cards only)
* Publication date
* Customer preference center URL
In the integration, the customer’s Source ID in Voucherify is used to find the respective Klaviyo ID to update the voucher code. We suggest using a single ID in Klaviyo and Voucherify. The `source_id` in Voucherify should match either the `External_id` of the profile or the `Unique ID` of the profile in Klaviyo. If the customer profile still has not been found, Voucherify sends the customer data with the phone and email address details (but without the name) to Klaviyo. Then, Voucherify’s Customer ID is used to automatically create a new `External ID` in Klaviyo.
### Application of custom properties in Klaviyo
Once the distribution is live, Voucherify will automatically assign codes to Custom properties in user profiles in Klaviyo.
We recommend that Klaviyo ID of the User Profile be the same as Voucherify customer Source ID. The best way to achieve this is to import the User Profiles from Klaviyo (e.g., via a CSV file) into Voucherify. You can also use Voucherify Customer ID as an External ID in Klaviyo. This happens when you distribute coupon codes to a Voucherify customer who is not added in Klaviyo, as described above.
The Voucherify code is added to the Klaviyo user profile as a **Custom property**. In case of issues, check the **Analytics** tab of your Voucherify **Distribution** for effective troubleshooting and transparent logs.
With the Voucherify code saved in Klaviyo user profile, you can personalize your messaging with promo codes. All it takes is using the Klaviyo personalization feature to paste custom properties that will be dynamically upserted when the messages are sent.
Besides being sent, the Voucherify code is also automatically assigned to a respective customer. You can check all owned incentives of a given customer by going to the **Wallet** tab on the customer profile page.
## Fetching coupons from Voucherify in Klaviyo flows
**Example Business Case: Customer Reactivation Campaign**
In this scenario, **the dynamic segmentation in Klaviyo** can trigger Voucherify to create personalized discount coupons. These coupons are then fed back to Klaviyo and sent to customers via email or SMS.
This setup can be used:
* to re-engage customers who have not made a purchase in a while, aiming to bring them back to active status and increase customer lifetime value;
* to re-engage customers who have added items to their cart but left without completing the purchase;
* to automatically send personalized birthday offers to customers, increasing engagement and potentially driving sales.
### Process
#### Concept flow
1. A customer enters a segment in Klaviyo (e.g. as an inactive customer).
2. Klaviyo picks up customer’s profile to be processed through the following flow:
1. A webhook is sent to Voucherify to publish a voucher code from a specific Voucherify campaign and assign it to the customer (as uniquely identified by ID in Klaviyo).
2. Klaviyo waits (e.g. 2 minutes) – meanwhile:
1. Voucherify receives a webhook as a POST call to its Publications API and publishes a voucher code from the defined campaign and assigns it to the customer.
2. Voucherify distribution is triggered to post voucher code to update the Klaviyo customer’s profile via Klaviyo API (using [the Voucherify plugin](#integration-configuration)).
3. Klaviyo receives a request to update a custom attribute (e.g. `voucher`) in the customer’s profile.
4. Klaviyo updates the customer’s voucher code profile attribute or creates a new custom attribute named according to the configuration in Voucherify-Klaviyo plugin.
3. Klaviyo sends out a message to the customer using the template that uses a voucher code placeholder.
3. The customer gets incentivized with a message containing a voucher code.
### Implementation
#### Voucherify configuration checklist
* A discount coupon campaign, e.g. “Customer Reactivation Campaign” for \$10 off of an order, is created;
* Klaviyo is connected via a dedicated plugin (see [the Integration configuration](#integration-configuration) section);
* A distribution is created **on successful coupon publication** from the proper campaign (it is called “Customer Reactivation Campaign” in the example here) and Klaviyo is selected as a distribution channel;
* In the Map fields in the Klaviyo channel configuration within the distribution: the Voucher code property is mapped to a custom attribute in the Klaviyo profile, e.g. it can be called "**voucher**";
#### Klaviyo configuration checklist
In Klaviyo, a flow is created in which:
* A trigger is a segment of customers or any other trigger;
For example, it can be a segment that includes customers who have not made a purchase in a specific timeframe (e.g. 3-6 months). The segment criteria can be based on the "Placed Order" event and the time since the last purchase. In a simplest case, a segment can be based on a certain specific customer profile attribute (e.g. `inactive_customer = TRUE`).
* A webhook action is configured to send a webhook to Voucherify Publications API with the name of the specific campaign (e.g. "Customer Reactivation Campaign") and a placeholder for customer’s KlaviyoID specified.
#### Webhook details
* **Destination URL**: `https://{region}.voucherify.io/v1/publications`
* **Headers**: Include `Content-Type: application/json` and the necessary Voucherify API credentials (`X-App-Id` (Application ID) and `X-App-Token`) (Secret Key) that can be taken from Voucherify **Project settings** under **Application keys** section.
* **JSON body**: Pass the data needed for Voucherify to create the voucher: campaign name and customer ID (here you would normally put a placeholder (variable):
```json theme={null}
{
"campaign": {
"name":"Name of your campaign"
},
"customer": {
"source_id":"{{ person.KlaviyoID }}"
}
}
```
Insert the `source_id` value placeholder into the JSON block to enable the enrichment of the customer’s profile with the voucher attribute when Voucherify sends data to Klaviyo. The placeholder can be either `{{ person.ID }}` or `{{ person.KlaviyoID }}`, depending on whether the profiles in Klaviyo were imported from another system and have an external ID. Contact the implementation team to confirm which customer ID attribute should be used.
* A 2 minute delay is configured to make sure the Voucherify distribution, an asynchronous process, updates the customer profile in Klaviyo with a voucher code before the message is sent.
* Email (or SMS) send-out is configured with a template that uses the custom attribute "voucher".
### Email template
```liquid theme={null}
Hi {{ person.first_name|default:'there'|title }},
It’s been a while since we last saw you, and we’ve been missing you at Awesome Company!
To welcome you back, we’d like to offer you something special – here’s $10 OFF your next order.
Just use the code
{{ person.voucher|default:'DEFAULT-VOUCHER' }}
at checkout. It’s our way of saying we miss you and can’t wait to have you back!
Hurry, your offer expires soon.
See you soon,
The Awesome Company Team
```
### Important considerations
Voucherify has API rate limits, which means that the volume of webhook requests must be managed to avoid exceeding them.
* Customers should prepare their segments in Klaviyo in a way that ensures the number of webhook calls does not exceed 60-70% of their hourly/minute API quota for Voucherify.
* If larger segments need to be targeted, consider breaking them into smaller groups and scheduling the Flow to stagger webhook requests over time.
### Summary
This setup combines Klaviyo's powerful segmentation and automation capabilities with Voucherify's dynamic coupon generation to create a sophisticated customer win-back strategy. By following this guide you can create an efficient workflow for managing vouchers distribution while ensuring API limits are respected.
For additional information or support, refer to the Voucherify and Klaviyo integration guides or contact [the Voucherify support team](https://www.voucherify.io/contact-support).
# Mailchimp
Source: https://docs.voucherify.io/integrations/mailchimp
Create Mailchimp automations with Voucherify promo codes
Learn how to integrate your accounts, sync Mailchimp audiences, and send Voucherify codes in Mailchimp emails.
Sending codes from Voucherify to Mailchimp consumes message limits. You can read more about message limits in our [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1).
## Step 1: Integrate Voucherify with Mailchimp account
To connect your Mailchimp account to Voucherify, follow these steps:
1. Go to the Home section and choose Integrations tab.
2. Find Mailchimp integration and click Connect.
3. Log in to your Mailchimp account to authorize the integration.
## Step 2: Sync Mailchimp audiences
Once your Mailchimp account is connected, sync Mailchimp audiences and customers' attributes with Voucherify.
Go to Settings (Integrations tab -> Mailchimp) to see the details of the integration.
Click Sync Audience to sync your Mailchimp contacts.
* Select an audience to sync with.
* You can also add custom attributes to customer profiles from the list as [metadata](/guides/metadata-mapping). Metadata will be visible in each customer profile in Voucherify (optional).
* Confirm syncing with **Add Audience.**
As a result, the selected audience is connected to Voucherify, and new contacts added through Mailchimp actions that trigger webhooks can be synchronized and used in Voucherify automations.
Customer synchronization
Customer synchronization starts when you connect both accounts and sync a Mailchimp audience. Voucherify syncs contacts based on Mailchimp audience webhook events.
Only contacts added to the audience through actions that trigger Mailchimp webhooks are automatically added and visible in the Voucherify dashboard. Mailchimp triggers webhooks for profile updates and form submissions, but not for contacts added through **Add Contacts** or CSV imports. Contacts added manually in Mailchimp or imported from a file are not synced to Voucherify automatically.
As a result, Voucherify email automations target only customers synced through supported Mailchimp events that trigger webhooks.
## Step 3: Attach Voucherify codes to contact's profiles in Mailchimp
Voucherify codes can be sent to customers' Mailchimp profiles and attached as merge tags to your emails.
To deliver codes to customer profiles, you need to:
1. Create a customer segment for customers from a particular Mailchimp audience.
2. Create unique codes in the Voucherify dashboard.
3. Schedule segment-based distribution of unique codes in the Voucherify dashboard.
### Build a customer segment for the Mailchimp audience
In Voucherify, you can divide your customers into [segments](/prepare/customer-segments). When your Mailchimp account is synced, you can add a customer segment in Voucherify that represents a synced Mailchimp audience.
1. Add [customer's metadata schema](/prepare/metadata) in Project Settings that will store the name of Mailchimp audience.
2. In the Integrations tab, use this metadata when syncing an audience. As a result, every new subscriber synchronized from the Mailchimp audience to Voucherify will be created as a customer. The metadata will be set to the defined value.
3. Go to the Customers tab and click Find and apply filtering button to add a customer segment in Voucherify that represents the synced Mailchimp audience.
4. In Metadata, choose the defined metadata.
5. Click Apply to see the list of customers who are in this segment.
6. Save the segment as a dynamic segment so new users will be added when they meet the segment criteria.
When the segment is ready, you can create unique codes that you will share with your audience.
### Create unique codes
Create unique codes that you will use in the Mailchimp email campaign. The codes will be attached to customer profiles as merge tags. You can create unique discount coupons, gift cards, referral codes, or loyalty cards and forward them to your Mailchimp account.
Follow the respective tutorial to learn more about generating unique codes:
* [Campaign of unique discount coupons](/build/create-discount-coupons)
* [Campaign of unique gift cards](/build/gift-card-overview)
* [Referral program](/build/referral-campaign-overview)
* [Loyalty program](/build/create-loyalty-campaign)
Validation rules
Use [validation rules](/optimize/create-validation-rules) to limit code redemptions to the chosen Mailchimp audience represented by the Voucherify customer segment. As a result, only customers from a particular audience (segment) will make a successful redemption.
When the codes are ready, you will need to create segment-based distribution in Voucherify that sends unique codes to every new customer in the chosen audience.
### Schedule segment-based distribution
1. In the Engagement section, click Distributions.
2. Name the distribution and choose the automation trigger – Customer entered the segment.
3. Define the trigger of the distribution.
Only the following trigger categories can use Mailchimp as a distribution channel:
* Custom events
* Manual messages
* Cart related activity
* Segment related activity
4. In Action, choose the Send and publish unique codes from campaign action and select your voucher campaign
5. In Channels, choose Mailchimp as a distribution channel and add a list of your receivers (a synced Mailchimp audience).
6. Add the name of the [merge tag](http://kb.mailchimp.com/merge-tags/getting-started-with-merge-tags), a unique label that identifies your code in the customer's profile in Mailchimp.To assign codes properly, you need to add the merge tag that identifies your code to the list of merge tags in the Mailchimp audience before you save and start distribution in Voucherify. Go to the [Adding merge tags](#manage-merge-tags-with-voucherify-codes) for more details. When ready, put the added merge tag name into the ***Code presenting published voucher*** field. You can also map optional merge tags with QR code, barcode, and code attributes (value, publication date). QR and barcodes, need to be mapped to **image** merge tags.
7. When mapping is ready, go to Summary to review your distribution configuration. Confirm the distribution with **Save & Send.**
When you confirm the configuration, the distribution starts. When a customer is synced from the Mailchimp audience to Voucherify, Voucherify automatically assigns a code from the chosen campaign to the merge tag in their profile.
Now, you can use assigned codes in your Mailchimp campaigns. For example, you can create a campaign with email automation and send a message with Voucherify codes automatically when a customer is synchronized from the chosen Mailchimp audience to Voucherify.
* To assign codes properly, you need to add the merge tag representing the code to the merge tags list in the Mailchimp audience.
* Keep in mind that this process will only work for contacts synchronized from Mailchimp after audience syncing is enabled. Contacts added through Mailchimp manual add or CSV import flows are not synchronized automatically.
## Step 4: Set up Mailchimp automation
When your codes have been already assigned with the Voucherify distribution, you can set the automation workflow and deliver coupons straight to the customers' mailboxes in a nicely designed email.
1. Create a new email campaign in Mailchimp.
2. Choose Automated mode and then, email trigger (*Welcome new subscribers*) to set a segment-based send out.
3. In the next step, name your automation and choose your audience (receivers). Confirm with **Begin**.
4. Set the automation workflow by switching to advanced settings.
5. In the advanced settings, you can set automation timing and add other conditions to be met to send an email. Add a segment with additional criteria. Filters in the segment provide that the message is sent automatically when the merge tag with the Voucherify distribution code appears in a customer's profile. Mailchimp filters enable you to add this rule by a merge tag name combined with **is not blank** option.
6. Confirm with **Save segment** and then go through three stages of email creation:
1. Setup – put the email subject, signature, etc.
2. Template – choose from saved templates or create a new one.
3. Design – fit your template into a current subject and add merge tags with the code.
7. Once the template is ready, you can confirm the workflow and start sending emails.
In response, the moment a code is assigned, a predefined email with the coupon is sent automatically to the customer’s inbox.
You can get a quick overview of the customers who met the criteria and pending a message in a Mailchimp queue. Open a detailed campaign's view in the Mailchimp dashboard and scroll down to find the Queue.
### Manage merge tags with Voucherify codes
To successfully run a Voucherify distribution and assign codes to Mailchimp contacts, you need to add a merge tag representing a published (assigned) code to merge tags list in Mailchimp audience. The name of the merge tag defined in the merge tags list in Mailchimp needs to be the same as the name of the merge tag defined in the Voucherify distribution.
You can also add a merge tag for a QR code and barcode by using the following syntax:
* The name of the merge tag represents the code's text format (required merge tag): **newsletter\_code** (merge tag type: **text**).
* The merge tag with a QR code: **newsletter\_code\_qr** (merge tag type: **image**).
* The barcode: **newsletter\_code\_barcode** (merge tag type: **image**).
If you do not add the merge tags for a QR code and barcode, only text code format gets to the customer profile.
## Export campaign codes from Voucherify to a Mailchimp audience
Besides distributions, you can use the CSV export to deliver campaign codes to synced audiences. As a result, each contact from the chosen audience will get a new merge tag with a promo code in their profile.
## Step 1: Create a campaign of unique codes
Create a new campaign with unique coupon codes or gift cards. Codes from this campaign will be assigned to customer profiles in Mailchimp audience. Each customer receives only one unique code which is also assigned to their profile in the Voucherify dashboard.
Auto-increase voucher count mode campaign
Enable auto-increase voucher count mode in your campaign or make sure you have enough codes generated for all audience contacts.
## Step 2: Export CSV file with campaign codes
Codes will be exported from Voucherify and automatically imported to your Mailchimp account. Each customer from the chosen audience will get a unique code assigned to their profile under a predefined merge tag.
1. Click the campaign name and choose **Export to Mailchimp** from the right corner menu.
2. Choose the audience and define a name for a merge tag with code.
3. Confirm with **Export.**
When the export is completed, you can see in the contact's profile that a code with a merge tag is assigned.
Export limit
You can export up to 100 codes in a single request. To export codes to more than 100 contacts, **wait until the first export is finished** and start another export. Voucherify will assign the codes to the next 100 contacts who have not received the code yet.
## Birthday campaign with Mailchimp
Learn how to create a birthday campaign with Mailchimp.
1. Add birthday dates to your customers in Mailchimp.
2. Create a [coupon campaign](/build/create-discount-coupons).
3. Set the automatic [distribution](/integrations/distributions-overview#automatic-distribution) of codes.
4. Launch Mailchimp Automation.
You need a Mailchimp account to recreate this workflow.
### Add birth dates to Mailchimp
First, you need to configure birth dates in Mailchimp:
1. Log in to your Mailchimp account.
2. Go to the Audience tab and View Contacts.
3. In the Settings section, go to Audience Fields and Merge tags.
4. Add a new tag, "Birthday".
Make sure that you have some text tags that will be used as fields for Voucherify codes.
After adding the new Birthday merge tag, update your customers' information with birth dates.
### Generate discount codes
In Campaign hub:
1. Go to Campaigns.
2. Create a new discount campaign with 20% discount codes and a maximum discount value of \$300.
3. Name your campaign, determine how many vouchers you want to generate, and play around with [the code pattern](/build/create-discount-coupons#campaign-details) optionally.
4. Set optional [time limitations](/optimize/time-limits).
5. Define the discount type and value.
6. Optionally, add [validation rules](/optimize/create-validation-rules). The codes will be redeemable once per customer to avoid coupon fraud. (Budget constraints -> Redemptions per customer in a campaign)
7. Save the campaign and move on to the Distribution.
### Launch Voucherify distribution (codes assignment)
The Distribution will act differently with this campaign as it does not involve sending a message to a customer but instead attaching discount codes to particular customers.
You can also publish (assign) codes to customers via [Publication API](/api-reference/publications/create-publication).
1. In Engagement, go to Distributions.
2. Click Create Distribution.
3. In Trigger, select the event that will trigger the distribution.
4. Provide the distribution name.
5. In Action, select the kind of distribution you want to create.
6. In Channel, select the Mailchimp distribution channel and prepare a message layout.
7. To add the codes to Mailchimp messages, provide the name of the merge tag that will be filled with a given code in Mailchimp emails.
8. In Summary, check the configuration of your distribution.
9. In Mailchimp, create email automation.
10. Go to Automate and E-mail. For example, create a "Say 'happy birthday'" email.
11. Name your campaign and select the target audience from your Mailchimp Audience list.
12. Next, establish the general workflow of your email campaigns, including triggers, schedules, filters, and post-send actions.
13. Filter the segment to ensure that the messages are received only by the customers who provided their birthday date. All contacts from the list must meet specific criteria: *the birthday tag cannot be left blank*.
14. Fill in general information about the email, such as the name, subject, email snippet, and sender's information.
15. Next, select your template based on a layout or theme. You can also reuse some of your old templates. In the last stage, design your mail. The most important part of the design process for our tutorial are merge tags. Thanks to them, your customers will receive their emails with unique codes. Use the same merge tag in your Mailchimp email as the one provided in Voucherify Distribution.
16. Confirm with Start Sending and enjoy your first Mailchimp and Voucherify automation.
You can achieve similar workflows with integrations with [Intercom](/integrations/intercom) and [ActiveCampaign](/integrations/activecampaign).
# MoEngage
Source: https://docs.voucherify.io/integrations/moengage
Let customers know about promotions and distribute customized coupons
MoEngage is a customer engagement platform that provides a suite of tools to help businesses engage customers, including personalized messaging, web and mobile push notifications, email marketing, and analytics, among others.
## How does the integration work?
MoEngage ContentAPI is a third-party API client that allows businesses to deliver personalized content to their customers in real time.
Thanks to this integration, you can inform your customers of promotions and distribute customized coupons to every one of them. With event-triggered MoEngage campaigns, you can react to various occasions with Voucherify coupons and gift cards, which will be delivered to your customers.
The example below shows the implementation of the following scenario:
* Customers who haven’t visited the store for some time should be offered a discount coupon to draw them back.
* Only the customer who has received the voucher should be able to redeem it.
* The customer should receive personalized coupons via email.
## How to distribute unique coupons with MoEngage?
Follow these steps to distribute coupons.
### Prepare a Voucherify campaign to engage inactive customers
In this example, a unique coupon campaign is used, in which the whole cart is discounted by 20% and capped at \$100. To learn more about creating unique coupon campaigns and how they work, visit [this tutorial](/build/create-discount-coupons).
The important setting here is the **Customers will be allowed to join the campaign only once** option. When it is turned on, the customer will receive only one code from the campaign. Each subsequent code publication for the customer who has already received one will return the original code. If turned off, every time a coupon is requested, the customer will get a new coupon code. With this option, you can decide if you want your customer to receive multiple reactivation codes or just one.
You will need the campaign ID needed later. You can obtain the ID by calling [the get campaign endpoint](/api-reference/campaigns/get-campaign) or copy it from the web browser address bar when you open the campaign dashboard.
### Configure a MoEngage Content API endpoint which will publish a new code from the campaign
In your MoEngage account, go to **Settings** > **Advanced settings** > **Content API,** and select the **Add Content API** button. Fill it in the following way:
1. **API Name**: this is the name of the Content API endpoints. It can’t be changed afterwards. In this case, it is named new\_reactivation\_voucher because it will send out voucher codes from the Customer Reactivation campaign.
2. **API Url**: type in the address of the Create Publications endpoint: `{{API_URL}}/v1/publications/create`. You can find your **API URL** in your Voucherify **Project Settings** in the **Application Information** section under **API endpoint**.
3. In the **URL Parameters** tab:
1. Add a **customer** parameter and fill in the MoEngage field that should be used as the customer’s **source\_id** field in Voucherify. In this case, the customer’s email is used as **source\_id**. Refer to MoEngage documentation to learn more about [user attributes](https://help.moengage.com/hc/en-us/articles/207836953-Derived-Events-Attributes#tracked-standard-attribute-0-15).
2. Add a **campaign** parameter and fill in your Voucherify campaign ID. The API URL is automatically updated with the filled-in parameters.
4. In the **Headers** tab, add `X-App-Id` and `X-App-Token` headers. You can generate the application keys for integration with MoEngage in your Voucherify **Project Settings**. In the **General** tab, scroll down to **Integration Keys** and create a new integration API key for MoEngage. In the **Name** field, enter the name of your key. In the drop-down lists, select **User** in **Role** and **MoEngage** in **Integration**.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
5. After you save the configuration, you can test it with the play icon. If everything is configured correctly, you will see Voucherify’s response.
### Use the Content API endpoint in a MoEngage campaign.
1. Create a new MoEngage campaign. This example is a one-time email outbound campaign that targets customers who have not visited an e-commerce site in 30 days.
2. Prepare the email content. In MoEngage, you can use [the Jinja templating language](https://help.moengage.com/hc/en-us/articles/115002757783-MoEngage-Templating-Language-JINJA-) to insert e.g. the customer’s name into the email content. As a result, the Content API endpoint created in Step 2 will be called, and its response will be parsed to display the desired details to the customer.
1. To call Voucherify’s create publication endpoint and publish a new code to an email’s recipient, use this code snippet:
```
{% set publication = ContentApi.new_reactivation_voucher({({"params":{"customer":"{{UserAttribute['Email (Standard)']}}"}})}) %}
```
2. To extract only the published voucher’s code from the response, use this expression:
```
{{publication.voucher.code}}
```
3. You can preview how the message will appear to a particular customer after you click the preview button in the template editor [in the personalized mode](https://help.moengage.com/hc/en-us/articles/4406091894292). You can also test it by sending an email using the **Test Campaign** field below the template editor.
4. When you publish your campaign and messages will be sent (on a scheduled time or as soon as possible), each message will be tailored to every customer and will contain the voucher code that has been published to them:
5. You can see each publication call made during the email send-out in the **Audit Log** in your Voucherify **Dashboard**.
You can also view the generated codes in the campaign dashboard in the **Vouchers** tab.
### Referral code and loyalty card publication
The process of assigning a referral code or loyalty card is very similar to the one described above. All you need to do is to change the campaign name parameter to the [referral](/build/referral-campaign-overview) or [loyalty campaign](/build/loyalty-campaign-overview) that you have created.
If the **Customer will be allowed to join the campaign only once** option is turned on in the referral program configuration, the customer who is a program member will receive their already-assigned referral code. If a referral code hasn’t been assigned yet to the customer, they will receive the code, which will be present in the response.
First, configure the **Content API** endpoint the same way as before. Remember to paste the referral program ID.
Then, to retrieve the loyalty card, use the following code:
```
{% set ref_code = ContentApi.get_customer_referral_code({({"params":{"customer":"{{UserAttribute['Email (Standard)']}}"}})}) %}
```
The customer’s referral or loyalty card code is accessible with the same snippet:
```
{{ref_code.voucher.code}}
```
## Flows
A **Flow** in MoEngage lets you trigger actions in Voucherify based on what your users do.
Here’s how you can use it:
* **Send custom events** to Voucherify (like when a user opens an email or joins a segment)
* **Sync customer data** to keep your Voucherify profiles up to date
* **Publish referral codes** to new users automatically
It’s a simple way to connect user actions in MoEngage with campaigns and data in Voucherify.
# mParticle
Source: https://docs.voucherify.io/integrations/mparticle
mParticle is a customer data platform that allows businesses to collect, unify, and activate data from various sources, such as websites, mobile apps, and third-party tools. Thanks to the API-first approach connecting Voucherify with mParticle is quick and easy.
The mParticle integration supports two-way data exchange between mParticle and Voucherify.
Data sent from mParticle to Voucherify uses [webhook limits](/guides/limits#webhooks).
Events sent from Voucherify to mParticle do not consume API call or webhook limits.
The integration updates only the defined customer metadata. The undefined metadata or data that does not match the defined data type is omitted.
## Double-sided configuration
Voucherify’s integration with mParticle offers inbound and outbound modes allowing you to receive customer data from mParticle in your Voucherify account. On the other hand, Voucherify can notify mParticle about crucial events such as code validation, redemption, and customers receiving rewards.
The integration enables two-way communication between mParticle and Voucherify. You can synchronize customer data by saving mParticle customer attributes through custom events in Voucherify. This way, businesses can store customer information in Voucherify and use it to build complex campaign eligibility and targeting options. Secondly, you can save mParticle audiences as metadata in Voucherify, which greatly reduces the manual work needed for granular user segmentation.
## Outbound integration between mParticle and Voucherify
The outbound integration provides a continuous flow of customer data from mParticle to Voucherify. The data received from mParticle enable you to:
* Track custom events in Voucherify
* Create or update customers in Voucherify
* Group customers
To create an outbound integration between Voucherify and mParticle, log in to your mParticle account, go to settings, and create a new output.
You will be redirected to Directory. At the top of the page inside of the search box type in Voucherify and select it.
Click **Set up** and decide what kind of integration you want. You can select event, audience, or both. Depending on your choice you might have up to two configurations to make.
After clicking Configure, you will be asked to provide more details such as URL, Secret Key, and Application ID.
The URL has to be based on the region you are using, there are three options:
* EU - `https://eu1.mparticle.voucherify.io`
* US - `https://us1.mparticle.voucherify.io`
* AS - `https://as1.mparticle.voucherify.io`
To grab your integration key, go to **Dashboard** > **Project settings**. If you do not have any, you can create them straight away. Choose a name and select proper integration from the drop-down list, in this case mParticle.
The integration secret key is visible only for 15 minutes when it is generated for the first time or regenerated. Write your key down and keep it in a safe place.
After passing all the necessary information in your configuration process your outputs should now be visible on your mParticle account. Depending on the integration you chose they can appear in the Event tab or Audience, or both.
While creating an outbound integration with Voucherify, first you have to create a connection. The output will have to be set to Voucherify and the input can be some other platform or application, like Braze.
In mParticle, you can create events for referral programs or loyalty earning rules. To use these events, include the following custom attributes in events sent from mParticle:
* for the referral program - `vf_referral_code`, `vf_referral_referrer_id`
* for the loyalty program - `vf_loyalty_code`
* for the event metadata
The event metadata does not have to be predefined in Voucherify, if it is missing, it is going to be added automatically.
All metadata sent from mParticle is in string format. For example, if you send `total_amount` as `"500"`, Voucherify parses it and saves it as the number `500`. Voucherify will try to parse the value to the type defined in the metadata of the event, set up in the [event schema](/prepare/metadata#define-new-metadata-schema). If parsing fails (for example the value is 500A or 500\$) then the value will be rejected.
When creating events you can choose what will be the source of your customer’s id. You can do so by going to settings->identity settings. Put them in the order you wish them to be prioritized, should there be a missing ID the next one will be selected.
## Inbound integration between mParticle and Voucherify
The inbound integration supports the flow of data the other way around – from Voucherify to mParticle. The integration supports the following events to be sent out of the box:
* Redemption events (successful, failed, rolled back with appropriate status - succeeded or failed)
* Validation events (succeeded or failed)
* Customer reward events (reward redemption created, reward redemption completed, customer rewarded main, customer rewarded loyalty points)
To create an inbound integration between Voucherify and mParticle, log in to your mParticle account, head to settings, and create a new input. There will be a choice between platforms and feeds, select feeds. Add feed input from the drop-down list - select Custom Feed (Voucherify will be added to the list shortly).
After selecting the feed you will acquire server key, secret key, and API endpoint URL.
Head to your integrations tab (Dashboard -> Username -> Integrations) in your Voucherify’s dashboard. Look for mParticle, paste your keys, and click **Connect**.
You can also select development mode if you want to test your integration before using it in a production environment.
Information may appear that the process of connection can take up to 5 minutes before becoming active.
Now, Voucherify will know where to send its information – mParticle will also be able to display all the events from Voucherify.
## Examples
Check if the connection works properly and data are sent between mParticle and Voucherify. First, try our inbound integration.
Redeem a voucher in Voucherify dashboard and see if any notification appears in your mParticle account. After redeeming the voucher head to mParticle account and click on Data Master -> Live Stream. There, you can keep track of all the actions that have taken place including the redemption that has been just made.
Having the action in Live Stream, you can click on it to see more details.
Seeing that all the information is properly displayed and sent between the two sources, you can now test the outbound integration.
Voucherify being integrated with mParticle keeps track of actions mentioned in the outbound integration. For example - what happens if a customer leaves a negative review?
First, as in the previous case, you can see the action appearing in your Live Stream on mParticle account.
You can again click on the action to see more details if you wish.
Next, head to the Voucherify dashboard and check whether Voucherify received the same information and whether a new customer was created or not.
Click on the newly created customer and head to the Activity tab. There you can see all the actions that have just occurred and check all the details.
If the details are correct, the integration works both ways.
# Salesforce
Source: https://docs.voucherify.io/integrations/salesforce
You can sync Salesforce data with Voucherify to manage your audience, build customer segments, and launch personalized promotions.
The plugin described below has the ability to map certain SF objects and fields into corresponding Voucherify entities. The sync can be scheduled according to your pre-defined plan.
To reduce the payload size, Voucherify syncs only the fields which have changed their state (diffs).
## Installation
1. Visit [this installation link](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t69000000Aj3P).
2. Acknowledge that you’re fine with the manual installation and confirm with **Install.**
3. Grant the plugin access to call Voucherify API (api.voucherify.io.)
If you use a custom voucherify URL (dedicated Voucherify instance), you need to add it manually.
4. Install Voucherify.
5. After successful installation, go to **Setup** > **Custom Settings** and click **Manage for Voucherify Settings**. On the next view, click **New** to configure organisation level settings.
6. Provide the information from Voucherify dashboard, **Project settings** (mandatory fields: Application ID and Secret Key).
We strongly recommend providing **Error Email Address** - it will be used to send any errors related to the Voucherify-Salesforce plugin (see [Error Handling and Debugging section below](#error-handling-and-debugging)).
The above configuration is done for a project hosted in the EU region, if your project is hosted in US or Asia region, place the API endpoint related to your region:
1. Go to Setup → **Custom Settings.**
2. Select **API Endpoint** option and put in the correct value of your region which you will find in the Project Settings in Voucherify.
3. Make sure that the region is enabled in the **Remote Site Settings**.
## Upgrade
Go to plugin settings and select the "Install for Admins Only" option.
## User guide
1. Go to App Launcher and type 'Voucherify' in the search box.
2. Select **Mappings Summary** tab. If you can see an empty board it means that the plugin doesn’t synchronise any data at this point.
3. Create a New Mapping.
4. As an example, configure the plugin in a way that it syncs Salesforce Contact entity into Voucherify Customer object:
* Use the first auto-complete input to select Contact entity.
* Select customers from the second input.
* Choose which SF fields from the Contact entity will serve as a unique identifier in Customer object (read more about `source_id` in the [API reference](/api-reference/customers/create-customer)). Usually, you might want to choose Id or Email fields.
5. In the next step, you can define which fields should be synced to Voucherify. For security or Salesforce limits reasons, you might want to keep the number of fields small enough to achieve your promotion goals.
* Add the next field with +.
* Provide the following data: Mapping Type - Field (regular object’s field), Constant (what you type in the Salesforce Field input ends up as a string in the Voucherify Field), Tag (an array of strings with tags ends up in the Voucherify Field).
* Save (you can always disable the field sync later on with the ACTIVE flag).
6. You can add other mappings, apart from Customer, Voucherify supports Redemption object.
## Sync schedule
The Configuration board enables you to initiate your connection between Salesforce and Voucherify. It also provides the current and historical sync status.
To make the data flow, schedule a sync job. The plugin allows you to define a custom sync interval.
To sync objects, the plugin creates some temporary objects in Salesforce, you might want to keep them for some time for debugging purposes. But remember to purge them by scheduling a cleaning job.
You can force any sync.
## Error handling and debugging
Email alert threshold - when callouts start failing for some reason, you want to be notified. With this feature, you can define the condition when the plugin should send an email alert. When the number of failed requests reaches the given percentage of total callouts scheduled, a notification is sent.
Stop sync threshold - when the number of failed requests exceeds the provided percentage, the plugin will stop the sync job and send an email notification.
## Requests overview
If you want to get a full overview of requests made to Voucherify, you can go to **Setup** → **Custom Settings** → **Manage**.
Now untick **Clean Successful Immediately** and go to **Voucherify Call Outs** to see the requests list.
By default, you will see the failed call outs (+reason) only.
In Voucherify Sync Requests tab, you’ll find information about the last syncing job, including:
* total call outs
* failed call outs,
* job id in Salesforce,
* json field Debug Mapping.
You can go to Voucherify Sync Request object directly from Voucherify Call Out.
In the case of two consecutive empty Voucherify Sync Request (total call outs - 0), the first one is removed from the list.
# Salesforce Marketing Cloud
Source: https://docs.voucherify.io/integrations/salesforce-marketing-cloud
Follow this tutorial to get unique promo codes from Voucherify and send them to your customers via Salesforce Marketing Cloud.
API call limits and throttling
When scheduling distributions with Voucherify via Salesforce Marketing Cloud, keep your **API call limits** in mind. Salesforce supports [Send Throttle](https://help.salesforce.com/s/articleView?id=sf.mc_es_send_throttle.htm\&type=5) to control the number of messages delivered to your customers in a particular time frame. Note that exceeding your API calls limit blocks your access to Voucherify API and may break the distribution.
It's recommended to set up the limit to 500 per minute to ensure a seamless workflow between Voucherify and Salesforce Marketing Cloud.
## AMPscript configuration
The integration between Salesforce Marketing Cloud and Voucherify allows you to request unique codes from Voucherify campaigns and pass them to your customers via Salesforce Marketing Cloud send-outs. This integration requires you to call Voucherify API using the Salesforce AMPscript.
Using Salesforce AMPscripts and Dynamic Content, we're going to add Voucherify unique codes to Salesforce Marketing Cloud’s send-outs. You can use Voucherify campaigns with unique discount coupons, gift cards, loyalty cards, and referral codes.
Go to your Salesforce Marketing Cloud account and prepare a new send-out script.
To get a unique code for a specific customer, you need to do the following:
* Add the [HTTP Post function](https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/httppost.htm) to communicate with Voucherify. This function will use one of the Voucherify methods to get a unique code.
* Call Voucherify [Create Publication API](/api-reference/publications/create-publication) to retrieve a unique code.
When calling the Create Publication method in Voucherify API, you need to define which customer should be assigned to a particular coupon code.
Here is a code snippet with an example AMPscript configuration.
### Step 1: Add your API endpoint and API keys
If you don't know what your API endpoint is, you can check it in the **Project settings** > **General** > **API endpoint.**
The table below shows an example list of regions and associated endpoints.
| Shared Region | Endpoint for Salesforce Marketing Cloud |
| ---------------- | ----------------------------------------------- |
| Europe (default) | `https://api.voucherify.io/v1/publications` |
| United States | `https://us1.api.voucherify.io/v1/publications` |
| Asia (Singapore) | `https://as1.api.voucherify.io/v1/publications` |
Copy your API keys from the **Project Settings** > [Application Keys](https://app.voucherify.io/#/app/core/projects/current/general).
### Step 2: Add Voucherify campaign
Replace the `campaign_id_value` variable with your Voucherify campaign identifier.
You can find the campaign id in the URL while displaying campaign details in the dashboard. This campaign will be the source of codes for your send-out.
### Step 3: Map your customer to Voucherify
You must include the customer's ID in the publication's payload to send unique codes to each customer.
To send the customer's ID, you need to map the \_subscriberkey (or any other attribute that you use to identify the customers in Salesforce) to Voucherify's customer.
Your AMPscript should be as follows:
```
/* Get customer data from SalesForce Marketing Cloud */ SET @salesforce_customer_id = _subscriberkey
```
### Step 4: Prepare the payload
The payload defines the customer who is to receive the code and the campaign from which the code will be issued.
```
/* Prepare the payload */
SET @payload = Concat(
'{"campaign":"', @campaign_id,
'","customer":"',@salesforce_customer_id,
'","channel":"Salesforce Marketing Cloud"}')
```
### Step 5: Send the request
Salesforce will use the prepared data to send a request to Voucherify. Voucherify will verify if a voucher can be issued and will return it to the AMPscript.
### Step 6: Verify the response (optional)
Verify if the request was successful. If you do not receive a voucher, you can prevent the send-out.
Voucherify may not return a successful response if you have a static campaign. For a static campaign, Voucherify does not generate new codes once all of the codes in the current batch are assigned to customers. You can change your campaign settings using the Auto-increase voucher count feature in the Campaign Manager to ensure that the number of codes initially created does not run out. This way Voucherify will add a new batch of codes once you have assigned all of the coupons in the campaign to other customers.
Finally, you need to add the following code snippet to the body in order to display the published voucher code.
In the Code Snippet Block:
```
script runat="server">
Platform.Load('Core','1');
var resp = Variable.GetValue("@response");
var json = Platform.Function.ParseJSON(resp);
Variable.SetValue("@code",json.voucher.code)
```
In the Content Block:
```
%%=v(@code)=%%
```
### Code example
The above example workflow shows you how to configure the AMPscript to get unique promo codes from Voucherify. You can find an example code block below. Insert the code to a Code Snippet Block.
```
%%[
/* Set connection data */
SET @appID = "VOUCHERIFY-APP-ID"
SET @appSecretKey = "VOUCHERIFY-SECRET-KEY"
SET @targetURL = https://{{region}}.api.voucherify.io/v1/publications
/* Set Voucherify's campaign ID - the source of vouchers */
SET @campaign_id = "campaign_id_value"
/* Get customer data from SalesForce Marketing Cloud */
SET @salesforce_customer_id = _subscriberkey
/* Prepare the payload */
SET @payload = Concat(
'{"campaign":"', @campaign_id,
'","customer":"',@salesforce_customer_id,
'","channel":"Salesforce Marketing Cloud"}')
/* Send the request */
VAR @request, @response
SET @request = HTTPPOST(
@targetURL,
"application/json",
@payload,
@response,
"X-App-Id",
@appID,
"X-App-Token",
@appSecretKey
)
/* If request failed, do not send out the message */
IF @request != '200' THEN
RaiseError('Request failed', true)
ENDIF
]%%
```
If you want to introduce the voucher code returned by the script, insert the following code into the Content Block:
```
%%=v(@code)=%%
```
# Segment
Source: https://docs.voucherify.io/integrations/segment
[Segment.io](https://segment.com/) is a Customer Data Platform that enables the transfer and collection of data between different sources and destinations. Segment.io collects information about events on your application or site and transmits this data to Segment's servers. Segment then transforms the data and passes it to destination tools, usually analytics platforms.
The Segment integration supports two-way data exchange between Segment and Voucherify.
Data sent from Segment to Voucherify uses [webhook limits](/guides/limits#webhooks).
Events sent from Voucherify to Segment do not consume API call or webhook limits.
The integration updates only the [customer metadata](/prepare/metadata) defined in Project settings. The undefined metadata or data that does not match the defined data type is omitted.
## Two-way configuration
With this connector, you can push data from a promotion engine to a Customer Data Platform (CDP) and the other way around and you can leverage customer attributes to create targeted promotions. For example, the promotions can be based on customers' past purchases, browsing history, demographics, and actions, such as leaving a review.
Segment's event tracking and user identification capabilities can be effectively used to automatically trigger Voucherify campaigns, personalize incentives, and measure the effectiveness of campaigns in real-time.
The integration between Segment.io and Voucherify is bidirectional: outbound and inbound. In other words, you can configure Voucherify as both the destination and source of customer data.
## Outbound integration between Segment and Voucherify
The outbound integration provides a continuous flow of customer data from Segment to Voucherify. The data received from Segment enable you to:
* Track custom events in Voucherify
* Create or update customers in Voucherify
* Group customers
To create an outbound integration between Voucherify and Segment.io, create a source on your Segment.io account that you want to integrate. Head to **Sources** and click **Add source**. Inside of the catalog, there are three main categories: **Sources**, **Destinations**, and **Functions**. You can find Voucherify in the destinations category in the referrals section.
For Segment to send information to Voucherify, you first need to connect Voucherify as Segment’s destination.
1. Choose Voucherify from Segment’s Catalog and choose your sources to connect the destination.
2. Use Voucherify’s integrations keys to authenticate the connector. In Voucherify, go to **Dashboard** and **Project Settings**. In the **General** tab, scroll down to **Integration keys**. Fill in the **Name** and choose your **Role** from the drop-down list. Choose Segment from the **Integration** drop-down list and click the **Create Integration API Key** button.
Integration credentials are hidden after saving
When you configure an external integration, API tokens and secret keys are only shown during setup.
After you save the integration, these values are masked and cannot be viewed again in the Dashboard.
This reduces the risk of exposing sensitive credentials through the user interface.
Save your keys securely before closing the window.
3. Paste your keys into the new source settings in Segment.
4. Fill in the **Custom Voucherify URL** field. Go to Voucherify **Dashboard** > **Project Settings** > **General** tab. In the **Application Information** section, scroll down to **API endpoint**. For example, if your API endpoint is `https://api.voucherify.io`, the Custom Voucherify URL will be `https://segmentio.voucherify.io`. You can also use dedicated URLs.
## Inbound integration between Segment and Voucherify
The inbound integration supports the flow of data the other way around – from Voucherify to Segment. The integration supports the following events to be sent to Segment:
* Redemption:
* [EVENTS.CUSTOMER.REDEMPTION.SUCCEEDED](/api-reference/redemption/succeeded)
* [EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.SUCCEEDED](/api-reference/redemption/rollback-succeeded)
* [EVENTS.CUSTOMER.REDEMPTION.FAILED](/api-reference/redemption/failed)
* [EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.FAILED](/api-reference/redemption/rollback-failed)
* [EVENTS.CUSTOMER.REWARD\_REDEMPTIONS.CREATED](/api-reference/customer/reward-redemptions-created)
* [EVENTS.CUSTOMER.REWARD\_REDEMPTIONS.COMPLETED](/api-reference/customer/reward-redemptions-completed)
* Publication:
* [EVENTS.CUSTOMER.PUBLICATION.SUCCEEDED](/api-reference/customer/publication-succeeded)
* [EVENTS.CUSTOMER.PUBLICATION.FAILED](/api-reference/customers/customer-activity-object#event-customer-publication-failed)
* Rewards:
* [EVENTS.CUSTOMER.REWARDED.MAIN](/api-reference/customer/rewarded)
* [EVENTS.CUSTOMER.REWARDED.LOYALTY\_POINTS](/api-reference/customer/rewarded-loyalty-points)
* Validation:
* [EVENTS.CUSTOMER.VALIDATION.SUCCEEDED](/api-reference/customers/customer-activity-object#event-customer-validation-succeeded)
* [EVENTS.CUSTOMER.VALIDATION.FAILED](/api-reference/customers/customer-activity-object#event-customer-validation-failed)
Only the events that have a customer attached will be sent from Voucherify.
When you have set up the outbound integration and created a new source, click your source to see more information such as the **Write Key**. This key is needed for the inbound integration.
If you want to have a two-way integration, you need to paste it in the Voucherify dashboard. Go to the **Integrations** tab, scroll down to Segment.io, and click **Connect**.
The default region is set to US (Oregon), but it is also possible to send data to an EU endpoint. After connecting to Segment, click **Settings** in the integration and select the proper region.
The events which are sent to Segment by Voucherify are flattened. This means that Voucherify will not send highly nested objects.
Voucherify will know where to send its information – Segment will also be able to display all the events from Voucherify, including code publication.
Consequently, you can now connect Voucherify source to a destination that delivers the promo codes via email or push notification to enable discount code redemption.
Remember: in order to have all your customer actions displayed, you must first connect Voucherify **Source** to a given space. Go to **Unify Settings** > **Profile sources** and click **Connect source**.
See the full set-up instructions by viewing Segment’s [integration documentation](https://segment.com/docs/connections/destinations/catalog/voucherify-actions/).
## Choosing the right event type in Segment
To update or modify customer data in Voucherify through Segment, use Update Customer, Create Customer, or Upsert Customer events. These are Identify-type events in Segment, used to update customer traits in Voucherify.
Other event types are sent using the Track Event API call and do not support customer metadata updates. Any metadata added to these events is mapped as event metadata instead of customer traits.
To make metadata work in Segment, follow these steps:
1. Choose an event that supports customer updates, such as Update Customer, Create Customer, or Upsert Customer.
2. Structure the Payload Correctly – Ensure the `"traits"` object includes metadata, as shown in this example:
```json theme={null}
{
"userId": "Segmentuser1302",
"traits": {
"address": {
"city": "Warsaw"
},
"metadata": {
"code": "customercode",
"location_number": 007
}
}
}
```
The **traits.address.city** mapping appears under the address definition. Metadata should be structured the same way to be mapped correctly.\
3\. Check the Mappings – The general and address mappings in your configuration should match the provided example.
4\. Verify Metadata Mapping – Check if the metadata defined in the payload appears in the mappings.
5\. Run a Test Event – When set up correctly, the customer will be properly recorded in Voucherify.
The integration updates only the [customer metadata](/prepare/metadata) defined in Project settings. The undefined metadata or data that does not match the defined data type is omitted.
## Examples
You can check if the connection works properly and data are sent between Segment.io and Voucherify. First, try the inbound integration.
1. Redeem a voucher in Voucherify dashboard
2. See if any notification appears on the Segment account; head to your Segment account and click **Connections** > **Sources**. Select your source and click **Debugger**. There, you can keep track of all the actions that have taken place including the redemption that was made seconds ago.
3. Click the redemption to see more details regarding the event.
If all the information shows proper data that were sent between the two sources, you can test the outbound integration.
1. Go to **Connections** > **Destinations**. Select your destination and go to **Mappings**.
2. Choose between already existing mappings or add a new one by clicking **New Mapping** in the upper right corner.
3. Follow the **Create** or **Update Customer** mapping, click on the three dots and edit the mapping.
4. In the second step, select the **Load Sample Event** option.
5. The third step shows information defining mappings that can be used. You can see these changes being also implemented at the bottom of step 3 window.
6. When ready, select test mapping at the bottom of the page.
You can check the details of this event by going to your [Audit Log](/analyze/audit-logs) with Voucherify.
This shows that the integration works both ways the way it is intended.
# Send data from Braze to Voucherify
Source: https://docs.voucherify.io/integrations/send-data-from-braze
Synchronize Braze customer segments and send events with webhooks
Prerequisite: Add Braze credentials to Voucherify
To send data from Braze to Voucherify, [generate API credentials in your Voucherify project](/integrations/braze-overview#connect-braze-with-voucherify "Braze overview: Connect Braze with Voucherify") first.
Use Braze Canvas webhooks to synchronize customer data from Braze to Voucherify or to send Braze events as Voucherify custom events.
This lets you create promotions targeted at Braze segments or trigger Voucherify actions based on custom events.
## Synchronize customers with Braze Canvas
Use Braze Canvas webhooks to synchronize Braze customer data with Voucherify.
In Braze, [create a new Canvas](https://www.braze.com/docs/user_guide/engagement_tools/canvas/create_a_canvas/create_a_canvas/) using the [Canvas Flow](https://www.braze.com/docs/user_guide/engagement_tools/canvas/ideas_and_strategies/launching_canvas_flow/#launch-with-canvas-flow) editor.
Create a **Message** and select **Webhook** to **Compose webhook**.
Set the following details:
* In **Webhook URL**, enter the URL of the endpoint: `https://{yourRegion}.braze.voucherify.io/braze/customer-webhook`.
* In **HTTP method**, set `POST`.
* In **Request body**, set **JSON Key/Value Pairs**.
Use the webhook URL for your region.
| Region | Webhook URL |
| --------------------- | ----------------------------------------------------------------------------------------- |
| **Europe** | `https://braze.voucherify.io/braze/customer-webhook` |
| **United States** | `https://us1.braze.voucherify.io/braze/customer-webhook` |
| **Asia** | `https://as1.braze.voucherify.io/braze/customer-webhook` |
| **Remaining regions** | `https://{region}.braze.voucherify.io/braze/customer-webhook` (use your dedicated region) |
Enter the **required** parameters in the **Request Body**:
* `action`: Use `add` to add members to the audience or `delete` to remove them.
* `user_id`: Use personalization in the editor to add a Braze user ID, for example, `{{${user_id}}}`.
* `audience_id`: Add the ID of the audience to update, for example, `608`.
You can use the following optional fields to synchronize additional details.
| Parameter | Definition / Options / Mapping |
| --------------- | ------------------------------------------------------------- |
| `email_address` | Maps directly to Voucherify's `email` field |
| `first_name` | Concatenates with last name into the customer’s `name` field |
| `last_name` | Concatenates with first name into the customer’s `name` field |
| `country` | Maps to Voucherify customer address (`country`) |
| `city` | Maps to Voucherify customer address (`city`) |
| `phone_number` | Maps to Voucherify customer address (`phone`) |
Add the required parameters in the **Request headers**:
* `applicationId`: Integration application ID.
* `secretKey`: Integration application token.
Go to **Test** tab and **Send test** message to check if your configuration is correct.
In Voucherify, go to **Audit log** to check if the test message has been successfully sent. You'll get a **200** status for **POST** method and the `/v1/customers` URL with **Braze Outbound** channel.
Go to that log to see more details.
Once everything's correct, click **Done** to save your message.
Your message is now saved in the Canvas.
The `brazeAudiences` array in Voucherify customer metadata as well as other optional data will be updated whenever the relevant event occurs.
Go to the [Canvas portal](https://www.braze.com/docs/user_guide/engagement_tools/canvas "Canvas portal in Braze documentation") in Braze documentation to learn more.
## Sending events with Braze webhook messages
Use Braze [Canvas](https://www.braze.com/docs/user_guide/getting_started/campaigns_canvases/#canvas-flow) with webhooks as a message channel to send Braze events to Voucherify.
### Configure general settings of the Canvas
Configure general settings of your Canvas.
As **Entry schedule**, select [Action-Based](https://www.braze.com/docs/user_guide/engagement_tools/canvas/create_a_canvas/create_a_canvas/?tab=action-based%20delivery).
A user must perform an action to enter the Canvas workflow.
In **Action Based Options**, select the **Perform Custom Event** and **Add trigger**. Select the custom event the customer needs to perform.
If you [stream Voucherify events to Braze](/integrations/stream-events-to-braze), you can also select a Voucherify event as a custom event.
In **Entry window**, provide a start time when customers will start entering the Canvas.
Optionally, you can set up an **End time**.
In [Target Audience](https://www.braze.com/docs/user_guide/engagement_tools/canvas/create_a_canvas/create_a_canvas/?tab=action-based%20delivery#step-2c-set-your-target-entry-audience), choose **All Users**.
In [Send Settings](https://www.braze.com/docs/user_guide/engagement_tools/canvas/create_a_canvas/create_a_canvas/?tab=action-based%20delivery#step-2d-select-your-send-settings), choose **All users including unsubscribed users**.
### Build Canvas
Configure your Canvas to send events from Braze to Voucherify.
Create a **Message** and select **Webhook** to **Compose webhook**.
Set the following details:
* In **Webhook URL**, enter the URL of the endpoint: `https://{yourRegion}.voucherify.io/v1/events`.
* In **HTTP method**, set `POST`.
* In **Request body**, set **Raw Text**.
In **Insert Raw Text**, add the payload for the [track event](/api-reference/events/track-custom-event) endpoint, for example:
```json theme={null}
{
"event": "user_registered",
"customer": {
"source_id": "{{${user_id}}}"
}
}
```
Add the required parameters in the **Request headers**:
* `X-App-Id`: Integration application ID.
* `X-App-Token`: Integration application token.
Go to **Test** tab and **Send test** message to check if your configuration is correct.
In Voucherify, go to **Audit log** to check if the test message has been successfully sent. You'll get a **200** status for **POST** method and the `/v1/events` URL with **API** channel.
Go to that log to see more details.
Once everything's correct, click **Done** to save your message.
Your message is now saved in the Canvas.
## Related features
Combine data sent from Braze to Voucherify with the following features for better incentive optimization.
Use synchronized Braze audiences as [customer segments](/prepare/customer-segments) in Voucherify.
Use `brazeAudiences` metadata to create a dynamic segment for use in:
* [Validation rules](/optimize/validation-rules-reference) to target incentives to specific Braze audience.
* [Distributions](/integrations/distributions-overview) to trigger additional distribution layers or for tracking using Distribution webhooks based on segments.
* Dynamic formulas to calculate discounts or loyalty points.
As you can use Braze Canvas webhook messages to call the POST [Track custom events](/api-reference/events/track-custom-event) endpoint in Voucherify, you can further experiment with the following cases:
* Mark a referral as complete by forwarding a Braze event to Voucherify.
* Give a free item voucher to a customer when they register on your website.
* Add points to a customer loyalty card when they left a review in your portal.
* Give a discount coupon when a customer abandoned their cart.
You can base Braze distributions on Voucherify events in two ways:
* Use Braze Canvas with [events Voucherify streams to Braze](/integrations/stream-events-to-braze). These events work as **Entry rules** with **Action-based** delivery.
* Use Voucherify Distributions with Braze as a channel. This covers more event types, such as publishing codes in response to order-related events like order canceled. Read the [Getting Started with Distributions](/integrations/distributions-overview) guide to learn more.
# SendGrid
Source: https://docs.voucherify.io/integrations/sendgrid
Learn how to connect your SendGrid account with Voucherify and send transactional emails with promo codes.
Sending messages with the SendGrid integration consumes message limits. You can read more about message limits in our [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1).
## Connect SendGrid
In Voucherify Home section, go to the **Integrations** tab.
Click **Connect** next to the SendGrid integration and provide the SendGrid API key and sender details.
## Send email distribution
**SPAM prevention**
To prevent false spam reports, you need to inform your recipients of how they got on your email list. Go to the Project settings > Brand Details to compose a short message before creating a distribution. Voucherify automatically places this information in your message footer.
Voucherify offers manual and automatic distributions. Manual distribution sends an email message to a selected customer/[customer segment](/prepare/customer-segments) as a one-time action. Manual messages are sent 10 minutes after you confirm the distribution. Automatic distributions trigger a message whenever a customer performs a predefined action and meets the distribution conditions.
With your SendGrid account, you can send both manual and automatic messages.
To start a new distribution, go to the Distributions tab in the Engagement section.
Click **Manual message** for a one-time delivery or select an automatic distribution type.
### Step 1: Distribution trigger
Name your distribution and select the trigger.
In a trigger, define your audience. Some distributions have the audience defined by their type (for example, Order canceled distribution sends messages to every customer who canceled the order). Otherwise, you need to choose a customer or a customer segment that will be your recipients.
### Step 2: Action
Select the proper action:
* Notify customers about a [promotion](/build/create-discount-promotions) – select a promotion or promotion tier.
* Send a unique code from a campaign – select a campaign.
* Send a plain message – create a distribution without promo codes.
### Step 3: Channel choice & messages
In the next step, you can configure distribution channels. You can choose many channels within a single distribution.
1. Enable email as your channel and choose SendGrid. If you connect your SendGrid account in the Integrations, you can choose it from the list when configuring an email provider.
2. Choose a message template. You can choose between built-in Voucherify templates and dynamic SendGrid templates created in your account. If you choose a SendGrid template, you can place Voucherify variables in it. They will be mapped to fields added to the SendGrid dynamic template.
**You can choose from the following message variables:**
* customer name,
* customer email,
* voucher code,
* voucher value,
* voucher QR URL,
* voucher barcode URL,
* voucher publication date.
If you want to place the Voucherify variable in the message template, type the SendGrid field name but skip the curly brackets.
If you decide to use Voucherify templates, you can learn more about the email settings in [Project settings](/manage/project-settings#email-settings) guide.
### Step 4: Summary
In Summary, check your email distribution configuration. If there are no other modifications needed, Save & Send the message.
You can [analyze and track the performance](/analyze/analyze-overview) of your email campaign with built-in analytics. After you confirm distribution, manual messages will be sent with a 10-minute delay, while automatic distribution will be triggered every time a customer performs the required action.
# Shopify
Source: https://docs.voucherify.io/integrations/shopify
Voucherify - Shopify integration enables you to enhance e-commerce experiences with personalized promotions. In this tutorial, you are going to learn everything you need to know about installing, using, and succeeding with Voucherify promotions in your Shopify store.
To successfully manage the integration, log in with your Voucherify account owner credentials.
**The app is available to everyone in the [Shopify marketplace](https://apps.shopify.com/voucherify)**.
The Shopify integration supports data exchange between Shopify and Voucherify.
Sending codes from Voucherify to Shopify consumes message limits. You can read more about message limits in our [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1).
Data sent from Shopify to Voucherify, including redemption information, uses [webhook limits](/guides/limits#webhooks).
## Introduction
What you get with the Voucherify - Shopify plugin:
* The **synchronization** of the customer, order, and product data can be used to build [earning rules in loyalty programs](/build/loyalty-campaign-overview), [dynamic segmentation](/prepare/customer-segments), or set up [validation rules](/optimize/create-validation-rules).
* **Published Voucherify codes will work in Shopify**, allowing you to save time on creating separate codes for different e-commerce sites.
* **Shared tracking and reporting** for Shopify and Voucherify redemption rates.
* Shopify can be used as a distribution channel for **loyalty rewards and referral codes** – e.g. discount codes will be distributed to the connected Shopify store when the customer redeems a loyalty reward (e.g. discount code). This version of the integration allows you to synchronize data only when it is being created or updated. Old data won’t be automatically synchronized.
Shopify supports only amount off and percentage off vouchers, both in discount coupons campaigns and referral programs.
**For vouchers to work, they have to be published in Shopify first**. This process enables Shopify to create a copy of the vouchers. Note that not all Voucherify’s validation rules are processed by Shopify.
### Supported validation rules
The following validation rules are supported by the Voucherify plugin for Shopify:
* **redemption per customer per incentive** or **redemption per customer in a campaign** – if you set the values to **is less than or equal to 1**, the discount in Shopify will be redeemable only once per customer.
* **only for customers who are holders of the code** – set the discount in Shopify to be redeemable only by the customer who owns a coupon in Voucherify. The customer must exist in Shopify.
### Unsupported features in the integration
The following features are not supported by the Voucherify plugin for Shopify:
* Validation rules other than the ones mentioned above (e.g. validation rules set in a campaign will not be taken into consideration, including the validation rules based on metadata)
* Discounts that are applicable to items (e.g. when a discount is meant only for a specific product or group of products, this rule will be omitted and the discount will be applied to an entire order)
* Discount cap in Voucherify’s discount (e.g. when you set a limit to a percentage discount, for example 20% discount with a maximum discount value of 100\$, the latter condition will be omitted, making it 20% discount without any limitations)
* Usage and synchronization of metadata
## Installation
To integrate with Voucherify, you need to have a Shopify store.
After the successful [installation of the app](https://apps.shopify.com/voucherify), you will be able to configure the integration via your Shop Admin page.
After installing the plugin, you should be able to see the name of your store and other details of the integration in the Integrations Directory. Keep in mind that the whole configuration process is done via Shopify Admin Page and Voucherify Integrations Directory serves only as your integration overview.
## Configuration
You can activate/deactivate synchronization for:
* Customers,
* Orders,
* Products.
By synchronizing these resources, you ensure that meaningful data is transferred from Shopify into Voucherify.
The synchronization operates only from Shopify to Voucherify. Resources created in Voucherify won’t be automatically synchronized to Shopify.
### Test the synchronization
Test whether the synchronization between your Shopify store and Voucherify works. The easiest way to do so is to create a new customer in Shopify (Customers tab – Add customer) and to check whether the customer appeared in your Voucherify account.
After saving the customer, go to your Voucherify account and check whether the new client was added to your customer list.
You may need to refresh the page if you are still waiting to see a new customer record.
## Voucherify discounts in Shopify
First, create a new unique codes campaign in Voucherify.
If you want the created code to appear in Shopify, you need to use Voucherify [Distribution Manager](/integrations/distributions-overview) and use Shopify as the channel of distribution. Shopify distribution is available only for those triggers that have the Send and publish unique codes from campaign action. Note that you may combine Shopify distribution with email in order to not only send the code to Shopify but also to send the code directly to the selected customer or customer segment.
Now, you should see the code in both Voucherify and Shopify accounts.
The purpose of the distribution via the Shopify channel is not to send a message to the customer but to assign (publish) a particular code to the given customer profile.
By going into the details view of the discount code in Shopify, you can see that the voucher inherited all the properties from the original.
You may overwrite the properties of the voucher (e.g., change its type). However, they will not be automatically synchronized with data in Voucherify.
### Test the discount
Since the code is already synchronized with Shopify, it can now be used at the checkout by your customers. All you need to do is to type in the code. Voucherify codes automatically work in your Shopify storefront, so you don't have to create separate codes for Shopify stores.
You will see all the redemptions in the Redemptions Log and on the Dashboard reports in your Voucherify account, letting you stay in control of your incentives.
## Referral codes and loyalty rewards
Besides discount codes and launching separate distribution, you may also transfer Voucherify codes to Shopify as **a part of your referral and loyalty program rewards.** What that means is that codes that act as rewards in your loyalty/referral programs will be redeemable in Shopify.
In the Distribution step of launching a referral/loyalty program, **use Shopify as your notifications channel**. What that means is that you will be able to use referral codes and loyalty rewards (e.g., discount codes) in Shopify.
In referral programs, you may use Shopify as your channel twice:
1. As a notification for the referrer’s reward (if the referrer meets the criteria for getting the reward, they will receive a discount code that will work in Shopify).
2. As the referral code is assigned to the referrer (when referees redeem the code, the referrer’s profile is updated with new invited friends).
When it comes to the loyalty program, Shopify can be used as a **channel for reward redemption**, which means that when the customer purchases the reward (e.g., discount code) with their loyalty points, the code will be automatically sent to the customer and to Shopify so that they can redeem it at the checkout. To learn more about notifications, [follow this tutorial](/build/create-loyalty-campaign#notifications).
# Stream events to Braze
Source: https://docs.voucherify.io/integrations/stream-events-to-braze
Set up action-based delivery by tracking customer activity in Braze with Voucherify events
Prerequisite: Add Braze credentials to Voucherify
To send events to Braze, [connect your Voucherify project with Braze](/integrations/braze-overview#connect-voucherify-with-braze "Braze overview: Connect Voucherify with Braze instructions").
Voucherify streams customer events to Braze so you can trigger messages, build segments, and react to promotion activity in real time.
Voucherify sends the following events to Braze:
* [`EVENTS.CUSTOMER.REDEMPTION.SUCCEEDED`](/api-reference/customer/redemption-succeeded): A customer successfully redeems an incentive.
* [`EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.SUCCEEDED`](/api-reference/customer/redemption-rollback-succeeded): A redemption is successfully rolled back.
* `EVENTS.CUSTOMER.REDEMPTION.FAILED`: A redemption attempt fails.
* `EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.FAILED`: A redemption rollback fails.
* [`EVENTS.CUSTOMER.REWARD_REDEMPTIONS.CREATED`](/api-reference/customer/reward-redemptions-created): A reward redemption is created.
* [`EVENTS.CUSTOMER.REWARD_REDEMPTIONS.COMPLETED`](/api-reference/customer/reward-redemptions-completed): A reward redemption is completed.
* [`EVENTS.CUSTOMER.PUBLICATION.SUCCEEDED`](/api-reference/customer/publication-succeeded): A code (a discount coupon, gift or loyalty card, referral code) is successfully published to a customer.
* `EVENTS.CUSTOMER.PUBLICATION.FAILED`: A publication attempt fails.
* [`EVENTS.CUSTOMER.REWARDED.MAIN`](/api-reference/customer/rewarded): A customer receives a reward.
* [`EVENTS.CUSTOMER.REWARDED.LOYALTY_POINTS`](/api-reference/customer/rewarded-loyalty-points): A customer earns loyalty points.
* `EVENTS.CUSTOMER.VALIDATION.SUCCEEDED`: A validation succeeds.
* `EVENTS.CUSTOMER.VALIDATION.FAILED`: A validation fails.
## Action-based delivery
Use Voucherify events to trigger Braze messages automatically. When creating a Braze campaign:
1. In the **Schedule** step, select **Action-Based Delivery**.
2. Select **Perform Custom Event** and add it as a trigger.
3. Choose a Voucherify event from the list.
Experiment ideas:
* Trigger a follow-up message when `REDEMPTION.FAILED` is sent. Test whether offering an alternative incentive recovers the customer.
* Notify customers when `REWARDED.LOYALTY_POINTS` is sent. Test timing and messaging to drive repeated engagement.
Read the [Action-based delivery guide](https://www.braze.com/docs/user_guide/engagement_tools/campaigns/building_campaigns/delivery_types/triggered_delivery "Braze documentation: Action-based delivery guide") in Braze documentation to learn more.
## Tracking Voucherify events in Braze
Track Voucherify events in Braze to understand how customers interact with your incentives.
### Historical search
View event history in your Braze account:
* **Data Settings** > **Custom Events**,
* **Analytics** > **Custom Events Report** in a new view.
Select the time period and events you want to analyze. Events streamed from Voucherify are automatically available in the search list.
### Customer-specific events
To check events for a specific user instead of aggregate statistics, go to:
* **Users** > **User Search**,
* **Audience** > **Search Users** in a new view.
## Related features
Explore the related features to optimize your Braze and Voucherify use.
Braze campaigns can include a [Connected Content script](/integrations/braze-connected-content-overview) to call Voucherify API endpoints at send time, for example to publish a code. Braze delivers the message while Voucherify handles incentive eligibility and protects your budget with guardrails like [validation rules](/optimize/validation-rules-reference).
# Twilio
Source: https://docs.voucherify.io/integrations/twilio
Send personalized text messages with coupons straight from Voucherify dashboard
Twilio allows you to schedule segment- or event-based SMS send outs to engage your customers in the right place and time.
Sending messages with the Twilio integration consumes message limits. You can read more about message limits in our [Fair Use Policy](https://www.voucherify.io/legal/fair-use-policy-v2-1).
## Integration
The integration doesn’t require any line of code and comes down to 3 steps:
1. In Home section in Voucherify, open the Integrations tab and choose Twilio.
2. Provide the required credentials from your Twilio account: Account SID, Auth Token, and Sender phone number.
3. Confirm with **CONNECT**.
From now on, you can set the default prefix (Project Settings) for each country and launch multiple international campaigns. The setting affects any future customer added without a specified dialing prefix.
## Coupon distribution with Twilio
When your Twilio account is already integrated, let’s see how to distribute [SMS](https://www.voucherify.io/coupon-distribution) with coupons from the Voucherify dashboard. Setting up the distribution starts from running the Distribution Manager. Go to the Distributions tab in the Engagement section in your dashboard.
Now, decide whether you want to set up [manual](#manual-distribution) or [automatic](#automatic-distribution) distribution:
### Manual distribution
Manual distribution delivers messages once you confirm its settings with **Save and send**. Each manual distribution is sent with a 10-minute delay, so you can introduce edits or stop the message delivery within this time.
1. Provide the distribution name.
2. In Trigger – Manual message, choose your audience: either a single customer, or a [customer segment](/prepare/customer-segments). You can define a new customer segment by clicking the funnel icon and Add new segment in the pop-up window.
3. Define the action:
* Notify customers about promotion
* Send and publish unique codes from campaign
* Send plain message to customers
4. In Summary, check your configuration and click Save & Send.
If you choose a newly-created customer segment, 10 minutes countdown starts when the segment is fully synced. Syncing ends once all customers were validated against segment criteria. Syncing status is displayed next to the segment name so you can monitor if the segment is already synced or if syncing is in progress.
### Automatic distribution
Automatic distribution can trigger a message in response to one of the following events:
1. Changes in a chosen customer segment:
* Customer entered segment
* Customer left segment
2. Voucher-related activity:
* Gift credits added
* Loyalty points added
* Loyalty points expired
* Voucher redeemed
* Voucher redemption rolledback
3. Customer rewards:
* Reward redemption
4. Cart-related activity (once your order data are synchronized with Voucherify, distribution can respond to changes in customers' orders):
* Order update
* Order has been paid
* Order creation
* Order canceled
5. Customer-related activity:
* Customer entered loyalty tiers structure
* Customer exited loyalty tiers structure
* Customer loyalty tier upgraded
* Customer loyalty tier downgraded
* Customer loyalty tier prolonged
* Customer rewarded loyalty points
* Customer was referred
6. Publishing codes:
* Successfully published – the message is sent once the code from a campaign is assigned to a customer.
7. Custom events – Send messages to customers when custom event was created for them.
You can name the distribution and choose the message action, trigger, and audience.
### Channel choice & messages
In Channels, enable SMS channel settings. You can enable many channels within a single distribution. Choose Twilio as your provider.
Edit the message template and add variables.
# WooCommerce
Source: https://docs.voucherify.io/integrations/woocommerce
This tutorial will guide you through the installation and configuration of a Voucherify-WooCommerce plugin. Then, you'll learn how to use it to leverage Voucherify coupons and cart-level promotions on your WordPress site.
## Supported features
Before you start creating promo campaigns for your WooCommerce audience, read the summary of Voucherify features that are supported in the plugin and make sure your use cases are covered.
Features:
* Syncing orders, products, SKUs, and customers
* Gift cards
* Percentage discount coupons
* Amount discount coupons
* Free shipping coupons
* Unit discount coupons with free products (no support for product variants)
* Cart-level discounts:
* percentage
* amount
* free shipping
* unit discount with free products (no support for product variants)
* All discounts are applied to the whole cart.
* Paying with Loyalty Points
* Referral coupon codes
* Fixed discount effect
* Dynamic Discounts
* Applying discounts to order-line items
* Capping discounts to a number of units
Unit discount
**Checkout**
When it comes to applying the discount, a customer needs to add a free item in the required number to the cart in order to get a discount. The discount will equal the price of the item multiplied by the number defined by the unit discount. For example, if a coupon code gives 1 item X for free, a customer that has item X in the cart and applies the code at the checkout gets a discount equal to product X price.
**Effects**
Effects for unit discounts aren't supported in the plugin yet. It means that no matter what effect you are going to choose, the discount is always applied the same way as described in the ***Checkout*** section.
## Installation
To start with, log into your WooCommerce account and follow these steps:
1. Go to the Plugins and choose **Add New.**
2. Search for Voucherify plugin.
3. Click **Install Now.**
4. After installation, select **Activate.**
## Configuration
When the plugin is active, you can connect both accounts in four steps:
1. Log into your Voucherify account and go to the **Project settings.**
2. Copy your Application ID and a Secret Key.
3. Enter your WordPress account and select Voucherify.
4. Paste “App ID” and “App Secret Key” and mark **Voucherify integration enabled**. Confirm with **Save Changes**, and you're ready to go!
## Use Voucherify coupons on your WordPress site
Now, your visitors can redeem Voucherify coupon codes to get a discount while shopping on your WordPress site. The workflow looks as follows:
1. A customer selects products and adds them to the cart.
2. In a cart summary, they can see a field for a coupon code.
3. The customer enters a Voucherify code, and after choosing the **Apply coupon**, their order is automatically updated. Applied discounts are also visible on a checkout page and order summary.
4. You can see redeemed coupons in your WordPress dashboard. Go to the Orders section and choose which order you'd like to display. If any coupon has been applied, you'll see it in the details.
## Synchronize
The Synchronize button synchronizes all products, SKUs, customers, and orders that have not been synchronized yet. The resources that have already been synchronized are skipped in this action.
Remember that under normal circumstances, all resources are synchronized automatically when they are created or edited. Synchronize your resources if:
* You have resources in your WooCommerce platform and you have just installed the Voucherify plugin.
* You have temporarily disabled the Voucherify plugin and added new resources.
* The API has been temporarily unavailable.
* You have added resources manually to a database and not through Wordpress or WooCommerce.
## Resynchronize all
The Resynchronize button synchronizes all existing products, SKUs, customers, and orders, including those that have been already synchronized.
Resynchronize all your resources if:
* You have a WooCommerce shop integrated with Voucherify, but you have changed the Voucherify project and you need to add your resources to a new project.
* There have been issues that caused resources to be marked as synchronized, but they are not present in Voucherify.
## Cart-level promotions
Besides the coupon campaigns, you can use Voucherify cart-level promotions on your WordPress site.
1. Firstly, create promotion tiers and define rules in the campaign manager ([read more details here](/build/create-discount-promotions)).
2. While shopping, customers can see current promotions defined in your Voucherify account.
3. If a cart meets the required conditions, a box with available promotions appears. When the customer selects **Apply promotion**, the cart updates automatically following the promotion rules. If more than one promotion is available for a single cart, the customer selects which one to apply during the purchase.
4. Similarly to the coupon codes, you can see applied promotions in the WordPress dashboard.
### Tracking performance
Once the plugin is configured, you will be able to use coupon codes, gift vouchers, referral codes, promotions, and loyalty cards. For more tracking data, you can visit the Voucherify dashboard. In the Redemptions and Customers sections, Voucherify collects and presents detailed up-to-date information. You can read more about tracking in this [guide](/optimize/validations-and-redemptions).
## WooCommerce custom snippets
Without any additional development work, the plugin itself provides a set of features that you can work with. You can extend the capabilities of the plugin by adding custom scripts to WooCommerce.
With these scripts you can, for example:
* **Synchronize customer creation** [(described in this document)](#synchronize-customers)
* **Synchronize orders**, allowing your customers to gain points for making a purchase [(described in this document)](#synchronize-orders)
* **Get balance on Loyalty Cards** [(described in this document)](#show-loyalty-balance)
* **Show your customers unique coupon codes in a popup** using the [Create Publication](/api-reference/publications/create-publication) API call
* **Show the list of vouchers for a single customer** using the [List Vouchers](/api-reference/vouchers/list-vouchers) API call
* And many more!
Go to [API reference](/api-reference/introduction-api) to get the most out of Voucherify.
This tutorial will provide the details on how to introduce custom scripts to WooCommerce. These scripts will allow you to use Voucherify’s API with no development work required. However, note that supporting complex cases will require some development assistance.
### Code snippets
While there are a couple of ways to introduce custom code to WordPress and WooCommerce, we will use the Code Snippets plugin available from the WordPress marketplace. You can download it using [this link](http://wordpress.org/plugins/code-snippets/).
Once the Code Snippet plugin is installed, you will have the option to add your snippets.
#### Creating a custom script
To introduce a custom script, you need to define when this script should be run and the outcome of the script. When a specific action is taken in WooCommerce, the custom code is triggered and we will explain how this action will affect Voucherify.
#### WooCommerce hooks
Hooks in WordPress essentially allow you to change or add code without editing core files. They are used extensively throughout WordPress and WooCommerce and are very useful for developers.
There are two types of hooks: **actions** and **filters**.
* **Action** hooks allow you to insert custom code at various points (wherever the hook is run).
* **Filter** hooks allow you to manipulate and return a variable which it passes (for instance, a product price).
To add an action to your hook, use the following code:
```
add_action('action_name', 'your_function_name');
function your_function_name()
{
// Your code
}
```
To hook your custom code to an action, you need to define the action that should trigger your script. You can view the list of all action hooks under this [WooCommerce documentation](https://woocommerce.github.io/code-reference/hooks/hooks.html).
We will provide an example of synchronizing orders between WooCommerce and Voucherify. In our case, we use the `woocommerce_order_status_changed` action hook, but the hook might be different depending on your cases.
```
add_action('woocommerce_order_status_changed', 'synchronize_orders');
function synchronize_orders($order_id)
{
// Your code
}
```
The documentation states that the `woocommerce_order_status_changed` hook returns the `order_id`. Therefore, we will use the `order_id` to get the status of the order later on.
You can learn more about the idea of action hooks in [WooCommerce’s documentation](https://woocommerce.com/document/introduction-to-hooks-actions-and-filters/).
#### Code snippets tutorial
This part of the tutorial will focus on the script itself. The script will have to connect to Voucherify using an API call.
To send out an API call from WordPress, you need to use the `wp_remote_post` function documented under [this link](https://developer.wordpress.org/reference/functions/wp_remote_post/). This method contains two arguments:
* **\$url** - URL to the API endpoint
* **\$args** - Request arguments.
One of the arguments is going to be the payload of the POST request. You need to align the payload to the API requests noted in Voucherify’s API reference. In our case, we are going to use the [Create Order API call](/api-reference/orders/create-order).
Here is the payload providing the customer and the amount they needed to pay.
```
$body = [
'source_id' => $order->get_id(),
'customer' => array(
'source_id' => $order->get_customer_id(),
),
// Voucherify requires the amount in cents.
'amount' => $order->get_total() * 100,
'status' => $status,
'metadata' => array(
'origin' => 'WooCommerce'
)
];
$body = wp_json_encode($body);
```
The API calls sent to Voucherify must contain your API keys. To get the keys, you can find them in your [project settings](/guides/authentication).
You provide the API keys and the previously created body to the \$args array:
```
$args = array(
'method' => 'POST',
'data_format' => 'body',
'headers' => array(
'Content-Type' => 'application/json ',
'X-App-Id' => 'API key',
'X-App-Token' => 'API token'
),
'body' => $body
);
```
The \$url is the URL link to the API method:
```
$url = 'https://api.voucherify.io/v1/orders/';
```
Finally, you can send the request:
```
$response = wp_remote_post( $url, $args );
```
### Example snippets
#### Synchronize orders
This code snippet will synchronize orders between WooCommerce and Voucherify. It will synchronize only the customer who is making the purchase, the status of the purchase, and the amount of the whole cart.
```
add_action('woocommerce_order_status_changed', 'synchronize_orders');
function synchronize_orders($order_id)
{
// Get the order status
$order = wc_get_order($order_id);
$status = $order->get_status();
if ($status == 'completed') :
$status = "PAID";
else :
$status = "CREATED";
endif;
// Get the newly created user data
$body = [
'source_id' => $order->get_id(),
'customer' => array(
'source_id' => $order->get_customer_id(),
),
// Voucherify requires the amount in cents.
'amount' => $order->get_total() * 100,
'status' => $status,
'metadata' => array(
'origin' => 'WooCommerce'
)
];
$body = wp_json_encode($body);
$url = 'https://api.voucherify.io/v1/orders/';
$args = array(
'method' => 'POST',
'data_format' => 'body',
'headers' => array(
'Content-Type' => 'application/json ',
'X-App-Id' => 'API key',
'X-App-Token' => 'API token'
),
'body' => $body
);
$response = wp_remote_post($url, $args);
}
```
#### Synchronize customers
This code snippet will create a customer in Voucherify once a customer is created in WooCommerce.
```
/* This code is run after a user (regardless of the role) has been created */
add_action('user_register', 'create_customer_in_Voucherify');
function create_customer_in_Voucherify($user_id)
{
// Get the newly created user data
$body = [
'source_id' => $user_id,
'name' => $_POST['first_name'],
'email' => $_POST['email']
];
$body = wp_json_encode($body);
$url = 'https://api.voucherify.io/v1/customers/';
$args = array(
'method' => 'POST',
'data_format' => 'body',
'headers' => array(
'Content-Type' => 'application/json ',
'X-App-Id' => 'API key',
'X-App-Token' => 'API token'
),
'body' => $body
);
$response = wp_remote_post($url, $args);
}
```
#### Show loyalty balance
This code will show how many points the customer has. The HTML should be styled. To use the “GET” HTTP method you need to use the [wp\_remote\_get](https://developer.wordpress.org/reference/functions/wp_remote_get/) function.
```
add_action('storefront_before_content', 'show_Voucherify_balance');
function show_Voucherify_balance()
{
$user_id = get_current_user_id();
$url = 'https://api.voucherify.io/v1/customers/' . $user_id;
$args = array(
'headers' => array(
'Content-Type' => 'application/json ',
'X-App-Id' => 'API key',
'X-App-Token' => 'API token'
)
);
$response = wp_remote_get($url, $args);
$json = json_decode($response['body']);
echo 'Hello ' . $json->name . '
';
echo '';
echo 'Number of credits:' . $json->summary->redemptions->gift->amount_to_go . '
';
echo '';
echo 'Loyalty points: ' . $json->summary->redemptions->loyalty_card->points_to_go . '
';
echo '';
echo 'Number of referrals: ' . $json->loyalty->referred_customers . '
';
echo '';
}
```
### Troubleshooting
This section explains how to debug your scripts and find the issues.
#### Code Snippet's safe mode
Your code can crash the site. In some cases, you might even lose access to the dashboard because your code has a bug that crashes every time you log in. Code Snippets team provides a safe mode that helps in that case.
You can learn more about the safe mode under this [link](https://help.codesnippets.pro/article/12-safe-mode).
#### WooCommerce logs
Logs can be found on the dashboard of a site. To view the logs:
* Go to WooCommerce > Status
* Click on the Logs tab
* Choose a log from the drop-down
#### Voucherify logs
If you want to know how Voucherify reacted to the request, you can find that information under the Project Logs in Voucherify.
You can access Voucherify’s logs by following [this tutorial](/analyze/audit-logs).
# Wyng
Source: https://docs.voucherify.io/integrations/wyng
Wyng is a customer activation platform that supports developing and deploying various digital experiences - including quizzes, gamified promotions, sweepstakes, user-generated content, and preference centers - that engage consumers and collect zero-party data. These experiences can be integrated across multiple marketing channels, such as websites, mobile apps, ads, emails, and SMS.
## Exporting promo codes from Voucherify into Wyng
To distribute Voucherify codes via Wyng, follow these steps:
1. **Export codes from Voucherify:**
Begin by [exporting](/api-reference/exports/create-export) the desired set of codes from Voucherify. Ensure that these codes are not published or distributed directly through Voucherify.
2. **Import codes into Wyng:**
[Import](https://help.wyng.com/s/article/How-do-I-apply-Code-Validation-to-a-sign-up-form) the exported codes into the Reward and Validation Codes section in Wyng. This allows Wyng to store and manage the codes internally for later distribution.
3. **Distribute codes via Wyng:**
Set up a campaign in Wyng to distribute the imported codes. When a customer completes the required action (e.g., form submission), Wyng will display a unique code on the confirmation page.
This process ensures that codes remain unpublished in Voucherify and are exclusively distributed through Wyng’s landing pages and widgets.
Pros:
* Automatic code display – codes will be automatically displayed to customers as they are retrieved directly from Wyng's database.
Cons:
* Manual code import – codes must be manually imported into Wyng.
* Manual code tracking – codes can be exported; the list will show you which codes have been issued to which customers. You can see an example at the bottom of [this article](https://help.wyng.com/s/article/Reward-Component).
## Custom webhook integration
With the custom [webhook integration](https://help.wyng.com/s/article/Send-form-entries-through-webhook-integration?r=46\&ui-knowledge-components-aura-actions.KnowledgeArticleVersionCreateDraftFromOnlineAction.createDraftFromOnlineArticle=1), Wyng will call the Voucherify APIs after completing the form page. This can be used, for example, to publish the code, create/update customer profiles, send custom events, and more. You can define a custom payload and use variables to pass data provided by the customer to Voucherify.
To create a custom webhook integration with Wyng, follow these steps:
1. Define the webhook in Wyng:
Navigate to the Integrations tab (More > Integrations), and create a new webhook integration. Specify the data source and the experience data that you want to share via the webhook.
2. Specify the webhook URL and payload:
Next, you can add custom HTTP headers and form variables using the custom request body.
Pros:
* Automated code management – no need to manually import codes.
* Data sharing – webhooks allow automatic data transfer between Wyng and Voucherify.
* Expiration date configuration – issuing the code to the customer can automatically set the expiration date.
Cons:
* Limited visibility – the code will not be displayed directly on the Wyng form. The workflow will proceed as follows:
1. The customer fills out the form: The customer completes the Wyng form with the required information.
2. Confirmation message: After submission, the customer receives a message confirming that the form has been completed.
3. Code delivery: The customer receives the code through an alternative channel, such as an email sent via Voucherify.
## CDP integrations
Wyng offers ready integrations with [Segment](https://help.wyng.com/s/article/Twilio-Segment-Integration) and [Braze](https://help.wyng.com/s/article/Braze-Integration).
### Segment integration with Wyng
Wyng provides an integration with Segment that you can use to transmit form data to Segment. Voucherify offers a [bidirectional integration](/integrations/segment#two-way-configuration) (i.e., Segment -> Voucherify and Voucherify -> Segment), which lets you build an integration between Wyng and Voucherify through Segment.
If you use Segment as your CDP, you can establish the connection between Wyng and Voucherify via Segment. The integration process could follow this sequence:
1. The customer fills out the Wyng form.
2. Form data or form submission event is sent to Segment.
3. Segment sends a notification to Voucherify about the submission of the form or a specific event.
4. Voucherify responds to the action received from Segment, for example, by issuing a voucher, applying loyalty points, etc.
### Braze integration with Wyng
Wyng also integrates with Braze, allowing the transfer of form data or form submission events to Braze. Similarly, you can transmit data to Braze. However, through Braze’s [Connected Content](/integrations/braze-connected-content) feature, Braze can pull data from Voucherify.
While the integration between Wyng and Voucherify via Braze does not provide the full capabilities of the Segment integration, you can still trigger specific actions based on 'Connected Content'. The integration process with Braze could look like this:
1. The customer fills out the Wyng form.
2. Form data or form submission event is sent to Braze.
3. A campaign in Braze, defined to react to data from Wyng, could trigger actions such as sending vouchers. Using 'Connected Content', the campaign could also pull voucher data from Voucherify.
## Custom JavaScript integration
For security reasons, use the [client-side API](/guides/api-overview#client-side-api-browser-and-mobile) for a custom JS integration. Ensure proper client-side settings by:
1. **Limiting access** to specific actions only.
2. **Allowing traffic** from trusted domains.
This helps secure your integration and prevent unauthorized access.
To define a custom JS integration, use the custom JavaScript option in Wyng.
Here is a sample JavaScript that can be used for voucher publication:
```js theme={null}
(function () { // Define your API keys and campaign name
const voucherifyBaseUrl = 'https://api.voucherify.io/client/v1'; // Replace with your API endpoint
const campaignName = 'campaign_name'; // Replace with your campaign name from which the voucher should be published
const apiKey = 'apiKey'; // Replace with your client-side Application ID
const secretKey = 'secretKey'; // Replace with your client-side Secret Key
const customer_id = window.wyng['_WYNG_ID_'].getLocalUserId(); // By this function, you can get the unique customer ID generated by Wyng
// Function to call Voucherify publication API. Pass variables as parameters you want to send to Voucherify, e.g., email, first_name, last_name, etc.
async function publishCode(email, first_name, last_name) {
try {
const response = await fetch(`${voucherifyBaseUrl}/publish`, {
method: 'POST',
headers: {
'X-Client-Application-Id': apiKey,
'X-Client-Token': secretKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({
campaign: campaignName,
customer: {
source_id: customer_id,
email: email,
name: first_name + " " + last_name},
})
});
if (!response.ok) {
throw new Error('Failed to publish voucher');
}
// Below data will be displayed on the Wyng page
const publishedVoucher = await response.json();
document.getElementById('voucher_code').innerHTML =
publishedVoucher.voucher.code; // Get published voucher code
if(publishedVoucher.voucher.expiration_date){ // Optional: get voucher
expiration date published and display it in customer’s local timezone
document.getElementById('voucher_expiration_date').innerHTML = (new
Date(publishedVoucher.voucher.expiration_date)).toLocaleString()
}
else{
document.getElementById('voucher_expiration_date_containere').remove()
}
document.getElementById('voucher_qr_code_img').setAttribute("src",
publishedVoucher.voucher.assets.qr.url) // Optional: get voucher QR code published
} catch (error) {
console.error('Error publishing voucher:', error);
}
}
// Function to get data entered by the customer on the form
function listener(event) {
console.log(event) // Optional: to see event details in the console (may be useful to find
fields from which data should be passed)
const email = event.email;
const first_name = event.fields.find(field => field.field_type === 'first_name')?.answer;
const last_name = event.fields.find(field => field.field_type === 'last_name')?.answer;
publishCode(email,first_name,last_name)
}
window.wyng['_WYNG_ID_'].addEventListener('form_submit_success', listener);
})();
```
After defining JavaScript, you can specify what content should be displayed on the first page after submitting the form.
In the source code view, use HTML to specify what should be displayed, such as the voucher code, expiration date, and a QR code.
```html theme={null}
Here is your Voucher:
Expiration date:
![]()
```
Based on the above configuration, here's the final result: The page displays a form to be completed, and once submitted, it shows the voucher code along with the expiration date and a QR code.
## Example use cases
### Wheel of fortune / Spinning the wheel / Scratch card / Mystery box
You can distribute Voucherify codes in various Wyng-powered landing pages and web widgets using Voucherify imports or webhooks.
Note that in the case of webhooks, the codes will not be displayed directly on the Wyng form but will be delivered to the customer through other channels.
You can grant access to all customers or limit it to specific groups. Access can be one-time or allow multiple entries with varying time restrictions (e.g., once per day, week, or month). You can keep access open or restrict it so that customers must provide a unique coupon code from Voucherify, such as codes printed inside products or on packaging. You can configure instant win opportunities with single or multiple rewards based on predefined probabilities. Rewards can include coupon codes, gift cards, or loyalty points managed through Voucherify.
For more instructions, visit Wyng's documentation on [spin the wheel](https://help.wyng.com/s/article/How-can-I-build-a-Spin-to-Win-with-a-Linked-Reward) scenario and [scratch-off](https://help.wyng.com/s/article/How-can-I-build-a-Scratch-Off-with-a-Linked-Reward).
### Lottery / sweepstake
You can use Voucherify coupon codes, gift cards, or loyalty points as rewards in Wyng-powered lotteries and sweepstakes. In a lottery or sweepstake, you can open access to all customers or restrict it to a specific group. Participation can be free or require a unique coupon code from Voucherify. Winners may be determined instantly or through a draw after the event concludes.
For more instructions, visit Wyng's documentation on [promo code unlock](https://help.wyng.com/s/article/How-can-I-build-an-experience-with-the-Unlock-Promo-Code-use-case).
### Loyalty program enrollment
Customers can register for a loyalty program with minimal details, such as an email or phone number. To complete their profile and gain full access, they provide their email or phone number to receive a one-time code (OTP). After entering the correct OTP, they can access the profile page, complete their information, and submit the form, with the data passed to Voucherify.
### In-store voucher redemption
The voucher codes are imported from Voucherify into Wyng. Customers or cashiers enter the page and submit the coupon code. Once the coupon code is validated, a successful page with more details about the applicable discount is displayed. The cashier applies the discount in the POS.
Once a code is validated and used, it can be marked as used in Voucherify either manually or via the Voucherify API.
### Wyng live demo: Loyalty marketing with Voucherify
Learn more about the possible use cases from the [demo](https://www.youtube.com/watch?v=ox5cd1uOvSg).
# ZOHO CRM
Source: https://docs.voucherify.io/integrations/zoho-crm
Configure Voucherify and ZOHO CRM to publish codes to your customers
ZOHO CRM is a customer relationship management software designed to help businesses of all sizes manage their customer relationships, streamline sales processes, and improve overall customer engagement.
Voucherify can boost customer experience by adding a voucher with a unique coupon code to each message sent to a customer. This voucher can encourage the customer to make a purchase or distribute referral codes to referrers.
You can use Voucherify’s Publication request as a function in ZOHO to track customers who received the voucher from you. You can use this action to start the voucher's validity period or specify that only the voucher holders can use it.
## Configuration
Voucherify offers different API requests that can be integrated with tools that understand REST APIs. ZOHO works similarly: you can add the APIs as functions and use them in a template. The functions must use Voucherify’s API keys.
To find Voucherify’s keys, go to the **Project Settings**. In the **General** tab, scroll down to Application Keys.
Once you have your API keys, you can create functions in ZOHO. Go to your ZOHO account and select Setup > Functions.
Before creating a new function, complete one more necessary step. In the Contacts tab, select any contact you have and click the **Edit** button. You can add new custom fields inside your contact by selecting **Edit Page Layout** in the upper left corner. Create a field called Voucher.
When it is done, you can return to creating your new function.
Click the **+ New Function** button and add the name of your new function. Select the category to Automation.
Now you need to create an appropriate request. This is the code you need to use, copy, and paste it into ZOHO:
```
params = Map();
customer = Map();
campaign = Map();
customer.put("source_id",source_id);
campaign.put("name",campaign_name);
params.put("customer",customer);
params.put("campaign",campaign);
response = invokeurl
[
url :"https://api.voucherify.io/v1/publications"
type :POST
parameters:params.toString()
headers:{"X-App-Id":"App-id","X-App-Token":"Secret"}
content-type:"application/json"
];
//contact.put("Voucher",response.get("voucher").get("code"));
voucher = response.get("voucher").get("code");
zoho.crm.updateRecord("Contacts",source_id,{"Voucher":voucher});
```
In the headers line in place of “App-id” and “Secret”, paste your Voucherify keys.
When you have pasted the code, select Edit Arguments, visible at the top of the page, and add two new function arguments - `source_id` and `campaign_name` with a string as value.
The last step is to create a new workflow in ZOHO. Head to the Automation section and select + Create Rule button.
While creating a new workflow, edit the function and map the fields properly. Voucherify’s `source_id` will be equal to the value of the Contacts - Contact Id field in ZOHO (you must first click ‘#’ within the field to map it properly). You also need to add the name of the campaign that you created in Voucherify.
The integration is ready, and now every time you create a new contact in ZOHO, a code will be published automatically.
# Account security
Source: https://docs.voucherify.io/manage/account-security
Learn how to protect your Voucherify account using authentication options, access controls, and monitoring tools
Voucherify provides tools that help you protect your account and monitor important activity. Some settings apply only to your user account, while others can be enforced for the whole team.
You can manage security settings in two places:
* **My profile** > **Security** for personal settings
* **Team settings** > **Security** for account-level rules (account owner only)
## Security checklist
To improve the security of your Voucherify account, consider enabling the following features:
* Enable **two-factor authentication (2FA)** for all users
* Configure **SAML single sign-on (SSO)** with your identity provider
* Review **user roles and permissions**
* Monitor **account activity logs**
* Set **API usage threshold alerts**
* Enable **webhook failure notifications**
These features help prevent unauthorized access and allow your team to react quickly to security issues.
## Two-factor authentication
Two-factor authentication (2FA) adds an extra layer of security to the login process. In addition to your password, you must confirm your identity using another verification method.
### Enforce two-factor authentication for the team
Only the **account owner** can enforce two-factor authentication for all users.
To enable enforcement:
1. Go to **Team settings** and open the **Security** tab.
2. Turn on **Enforce two-factor authentication**.
3. Click a start date or select **Now**.
4. Save the changes.
After enforcement, each user must set up two-factor authentication during their next login.
### Set up two-factor authentication for your account
Each user configures two-factor authentication in **My profile > Security**.
Voucherify supports the following methods:
* Google Authenticator: Use the Google Authenticator app on your mobile device. Scan the QR code or enter the code manually. The app generates a verification code for each login.
* SMS codes: Provide your phone number to receive a one-time verification code by text message each time you log in.
* Backup codes: Voucherify generates ten one-time backup codes. Store them in a safe place and use them only if you cannot access your phone.
Backup codes or SMS codes alone are less secure. Voucherify recommends using Google Authenticator as your main method.
## Password management
You can change your password at any time.
To update your password:
1. Go to **My profile** > **Security**.
2. Click **Change password**.
3. Enter your current password and a new password.
4. Save the change.
You receive an email notification whenever your password is changed.
## Single sign-on with SAML
SAML single sign-on (SSO) allows users to log in using a company identity provider instead of a Voucherify password.
Voucherify supports providers such as Azure, Auth0, OneLogin, Okta, and PingIdentity.
### How SAML login works
Before users can log in with SAML:
* The user must be added to the SAML application in the identity provider.
* The same user must be invited to the Voucherify dashboard using the **same email address**.
After configuration:
* Users can log in from the identity provider dashboard or a SAML login page.
* The email address must match the email used in Voucherify.
* Users are not automatically synced from the identity provider to Voucherify. Each user must be created in Voucherify separately.
If SAML is enforced, users cannot log in using email and password.
### Enable SAML authentication
To enable SAML:
1. Create a SAML application in your identity provider.
2. Copy the **Identity provider entry point URL** and the certificate.
3. Go to **Team settings** > **Security**.
4. Enable SAML and paste the required values.
5. Save the configuration.
Voucherify generates a **Callback URL**. Add this URL to your identity provider configuration.
Always test SAML login before enforcing it. Enforcing SAML without testing may block user access.
### Advanced SAML options
For advanced security setups, you can:
* Sign SAML requests.
* Encrypt or decrypt SAML responses.
These options are available for specific integration needs.
## Provider-specific configuration
Follow the procedures of respective providers.
To enable Microsoft Azure (Entra ID):
1. Open **Microsoft Entra admin center**.
2. Go to **Applications** > **Enterprise applications**.
3. Select **New application**.
4. Click **Microsoft Entra SAML Toolkit**.
5. Name the application and create it.
6. Go to **Single sign-on**.
7. Select **SAML**.
8. Edit **Basic SAML Configuration**.
9. Set **Identifier (Entity ID)** to your chosen value.
10. Add a placeholder **Reply URL**.
11. Add a placeholder **Sign-on URL**.
12. Save the configuration.
13. Copy the **Login URL**.
14. In Voucherify, go to **Team settings** > **Security**.
15. Enable SAML authentication.
16. Paste the Login URL into **Identity provider entry point URL**.
17. Download the **Base64 certificate** from Azure.
18. In Voucherify, choose **Add certificate**.
19. Paste the certificate.
20. Set **Issuer** to the same Entity ID.
21. Save the configuration.
22. Copy the **Callback URL** from Voucherify.
23. Return to Azure and edit **Basic SAML Configuration**.
24. Replace the placeholder Reply and Sign-on URLs with the Callback URL.
25. Save changes.
26. Assign users or groups in **Users and Groups**.
27. Create matching users in Voucherify with the same email addresses.
28. Users log in via the Azure application.
To enable Auth0:
1. Log in to Auth0.
2. Go to **Applications**.
3. Select **Create application**.
4. Enter a name.
5. Click **Regular Web Application**.
6. Create the application.
7. Open **Settings**.
8. Scroll down and open **Advanced settings**.
9. Go to the **Endpoints** tab.
10. Copy the **SAML protocol URL**.
11. In Voucherify, go to **Team settings** > **Security**.
12. Enable SAML authentication.
13. Paste the SAML protocol URL into **Identity provider entry point URL**.
14. In Auth0, open the **Certificates** tab.
15. Copy the **Signing certificate**.
16. In Voucherify, choose **Add certificate**.
17. Paste the certificate and save.
18. Save the SAML configuration in Voucherify.
19. Copy the **Callback URL**.
20. In Auth0, go to **Settings**.
21. Add the Callback URL to **Allowed callback URLs**.
22. Save changes.
23. Open the **Addons** tab.
24. Enable **SAML2 Web App**.
25. Save changes.
26. Users log in using the Callback URL.
To enable OneLogin:
1. Log in to OneLogin.
2. Go to **Applications**.
3. Select **Add app**.
4. Search for **SAML Custom Connector (Advanced)**.
5. Add the application.
6. (Optional) Set name, icon, and description.
7. Save and go to **Configuration**.
8. Set SAML encryption to **AES-128-CBC**.
9. Save changes.
10. Go to **SSO**.
11. Copy **SAML 2.0 Endpoint (HTTP)**.
12. In Voucherify, go to **Team settings** > **Security**.
13. Enable SAML authentication.
14. Paste the endpoint URL as **Identity provider entry point URL**.
15. Save.
16. In OneLogin, open **Certificate**.
17. Copy the **X.509 certificate**.
18. In Voucherify, add the certificate and save.
19. Save SAML configuration.
20. Copy the **Callback URL**.
21. In OneLogin, paste the URL into **ACS URL**.
22. Save changes.
23. Users log in using the Callback URL.
To enable Okta:
1. Log in to Okta.
2. Go to **Applications**.
3. Select **Create App Integration**.
4. Click **SAML 2.0**.
5. Click **Next**.
6. Enter application name and optional logo.
7. Click **Next**.
8. In **Configure SAML**, enter a placeholder Single Sign-On URL.
9. Set **Audience URI (SP Entity ID)**.
10. Set **Name ID format** to EmailAddress.
11. Set **Application username** to Email.
12. Finish setup.
13. Open **SAML Signing Certificates**.
14. View SAML setup instructions.
15. Copy **Identity provider SSO URL**.
16. In Voucherify, enable SAML authentication.
17. Paste the SSO URL as **Entry point URL**.
18. Copy the **X.509 certificate**.
19. Add the certificate in Voucherify.
20. Set **Audience** to match Okta value.
21. Save configuration.
22. Copy the **Callback URL**.
23. Edit SAML settings in Okta.
24. Replace the placeholder URL with the Callback URL.
25. Assign users to the application.
26. Users log in using the Callback URL.
To enable PingID:
1. Log in to PingID.
2. Go to **Applications**.
3. Select **Add new application**.
4. Set application name.
5. Click **SAML application**.
6. Select **Manual configuration**.
7. Set placeholder **ACS URL**.
8. Set **Entity ID**.
9. Download the **X.509 certificate**.
10. Copy **Initiate SSO URL**.
11. In Voucherify, enable SAML authentication.
12. Paste the Initiate SSO URL as **Entry point URL**.
13. Set **Audience**.
14. Add the certificate.
15. Save configuration.
16. Copy the **Callback URL**.
17. Return to PingID configuration.
18. Replace placeholder ACS URL with Callback URL.
19. Edit **Attribute mappings**.
20. Map subject to user ID or username.
21. Add email attribute mapping.
22. Mark email as required.
23. Enable the application.
24. Create matching users in PingID and Voucherify.
25. Test login using the Callback URL.
## Activity logs
Logs help you review account and project activity.
### Account activity logs
Account activity logs are available in **My profile** > **Security**.
They include:
* Login events.
* Password changes.
* Updates to security settings.
### Project audit logs
Project-level activity is available in the [Audit log](/analyze/audit-logs) section of the dashboard.
Audit logs show:
* API requests and responses.
* Request source.
* Related objects such as campaigns or orders.
These logs help track technical activity and data changes.
## Monitoring and alerts
Voucherify provides alerts that help you monitor account usage and important events. Alerts do not block access, but they help you react quickly when attention is needed.
You can manage alerts in the **Notification center**.
### User notifications
These settings apply only to the logged-in user.
User notifications relate to project activity and background processes.
You can manage them in **Notifications (sidebar)** > **Go to Notification center** > **User settings**.
For example, you can set up notifications for:
* Campaign updates.
* Voucher generation results.
* Imports and exports.
* Background tasks.
Each notification has predefined delivery channels:
* **In-app notifications**
* **Email notifications**
* **In-app and email notifications**
You can turn delivery channels on or off with **Show details**.
### Account-level notifications
These settings apply to the whole account and are managed by the account owner.
Account-level notifications relate to system limits and technical delivery.
You can manage them in **Notifications (sidebar)** > **Go to Notification center** > **Account settings**.
Available notifications include:
* **Webhook delivery failures**: Alerts when Voucherify cannot successfully deliver a webhook. This helps you detect integration problems and fix failing endpoints.
* **API usage thresholds**: Alerts when your API usage approaches a defined limit. Setting thresholds helps you react early and avoid reaching account limits that could temporarily block API requests.
* **Message limits**: Alerts when your account approaches configured messaging limits.
Most account-level notifications support **in-app and email delivery**. Some notifications require at least one email address to be set.
Account-level notifications are informational. They do not block API calls or user access.
## Related features
Account security can be combined with the following features.
Control who can access your account, assign roles, and manage permissions for team members.
Read [members and roles](/manage/members-and-roles) to learn more.
Go to [Project settings](/manage/project-settings) to manage API keys, webhooks, brand details and to check usage limits.
# Approval requests
Source: https://docs.voucherify.io/manage/approval-requests
Create and manage approval workflows to protect campaigns from errors and unauthorized changes
Enterprise feature
Approval requests are available on Enterprise plans upon request. Contact your Voucherify account manager to enable this feature.
Approval requests help you protect campaigns from internal errors or fraud. When approval policies are enabled, selected changes must be reviewed and approved before they are applied in the system.
## How approval requests work
Approval workflows are enabled through **custom user roles with limitations**. When a user with such a role performs a restricted action, Voucherify creates an approval request instead of applying the change immediately.
The approval logic is as follows:
* You can assign up to **5 approvers** to a single request.
* Approval is granted as soon as **one approver** approves the request.
* Until approval, changes remain **inactive** in the system.
### Supported actions
You can require approval for the following actions:
* **Campaigns**:
* Creating campaigns
* Updating campaigns
* **Vouchers**:
* Adding vouchers to existing campaigns
* Updating vouchers
* Creating standalone (generic) vouchers
* **Validation rules**:
* Creating or updating validation rules
Changes are applied only after the request is approved.
### Create behavior
When a restricted user **creates a new object** (for example, a campaign or voucher):
* The object is **not visible in the dashboard lists**.
* The proposed object appears only in the **Approval requests** view for approvers.
* The object is created in the system **only after the request is approved**.
### Update behavior
When a restricted user **modifies an existing object** (for example, a campaign, voucher, or validation rule):
* The **current object remains unchanged** in the system.
* The proposed changes are stored as an **approval request**.
* After an approver approves the request, the **changes are applied**.
## Approval request statuses
Each request has a clear status that shows its current state:
* **Pending**: Waiting for an approver's action.
* **Approved**: Approved and applied in the system.
* **Changes requested**: The approver asked for updates before approval.
* **Rejected**: The request was declined and will not be applied.
* **Draft**: The request was started but not submitted.
You can always check the status in the **Approval requests** view.
## Where to find approval requests
To open approval requests in the dashboard, go to the left sidebar, click your user name, and click **Approval requests**.
Both requesters and approvers use this view to manage requests.
## How to create an approval request
If your role requires approval, Voucherify automatically opens the approval flow when you try to save a restricted change.
Begin an action that requires approval, such as creating a campaign or editing a validation rule.
Complete the configuration in the creation or editing wizard as usual.
In the final step of the wizard, click **Add approvers** and select one or more **Admin users** who can approve the request.
Use the **Comment** field to explain the purpose of the change.
Click **Save**. The request is sent for approval and marked as **Pending**.
## Managing requests (requester view)
After submitting a request, you can track it in **Approval requests**.
For each request, you can:
* **Details**: view request information
* **Delete**: remove the request
* **View wizard**: return to the editor for complex requests and make changes
If an approver requests changes, you receive an email notification. You can edit the request and submit it again.
## Reviewing requests (approver view)
Approvers see pending requests in **Approval requests**.
### Simple operations
For quick changes:
1. Select **Details** to see the request.
2. Add a comment.
3. Click **Approve** or **Reject**.
### Complex operations
For larger changes:
1. Click **View wizard** to review all settings the requester has chosen.
2. For some requests, you may also see an **Open dialog** button.\
This opens the original action dialog in read-only mode, so you can review all configuration details before making a decision.
3. After reviewing the steps, add a comment.
4. Choose one of the following:
* **Approve**: applies the changes to the system immediately.
* **Request changes**: sends the request back to the requester for edits.
* **Reject**: cancels the request. The proposed changes are discarded and the object remains unchanged. If the request was for a new object (for example, a campaign), it is not created.
## Notifications
You can control how you receive updates about approval requests.
To configure notifications:
1. Open the **Notification center**.
2. Go to **Personal settings**.
3. Find **Approval requests changed**.
4. Enable or disable **In-app** or **Email** notifications.
Approvers receive notifications for new requests. Requesters receive notifications when the status of their request changes.
## Related features
Approval requests depend also on the following features.
[Team settings](/manage/team-settings) define who can manage roles and approvals. Only account owners can configure role limitations that trigger approval requests.
# Manage Voucherify overview
Source: https://docs.voucherify.io/manage/manage-voucherify-overview
Configure your Voucherify account, projects, team, and organization security from one place
The Manage section brings together everything you need to run Voucherify day to day: your subscription and billing, account-wide team settings, per-project configuration, and the security controls that protect your data and members.
Use this section to set up your account, structure access for your team, and keep your organization aligned with security and compliance requirements.
## What you can manage
Manage your subscription, billing, API packages, and consultation services across the account lifecycle.
Configure account-wide settings such as team members, projects, invoices, and other options reserved for the account owner.
Control how an individual project works: general details, branding, data schemas, usage limits, and advanced options.
Set up authentication, role-based access, approval workflows, and data protection controls to secure your organization.
## Why Manage matters
Voucherify scales with your team and your business. A clear setup of accounts, projects, and access policies helps you:
* Keep billing under control: Track subscription stages, usage limits, and extra API packages in one place.
* Separate environments cleanly: Use projects to isolate configuration, data, and integrations for different brands, regions, or stages.
* Give the right people the right access: Invite members, assign roles, and scope permissions per project.
* Stay compliant and secure: Enforce 2FA and SSO, require approvals for sensitive changes, and follow GDPR and CCPA procedures.
## How the pieces fit together
The Manage section is organized around three levels:
* Account level: [Voucherify account](/manage/voucherify-account) and [team settings](/manage/team-settings) cover subscription, billing, and options that apply to your entire organization.
* Project level: [Project settings](/manage/project-settings) configure how an individual Voucherify project behaves, including branding, schemas, and limits.
* Security level: [Organization security](/manage/security-overview) ties everything together with authentication, members and roles, approval requests, and data protection.
## What's next?
If you're setting up Voucherify for the first time, start with [Voucherify account](/manage/voucherify-account) to review your subscription, then move to [team settings](/manage/team-settings) and [project settings](/manage/project-settings) to configure your workspace. Once your account is in place, head to the [organization security overview](/manage/security-overview) to harden access and protect customer data.
# Members and roles
Source: https://docs.voucherify.io/manage/members-and-roles
Learn how to invite members and control access with roles in Voucherify
Voucherify uses **members**, **projects**, and **roles** to control access to data and actions. This setup keeps access structured and permissions clear.
## Key concepts
Read the key concepts related to managing members and roles.
The owner is not a role but a special status assigned to a member account that creates the account for your organization in Voucherify.
The owner status:
* Grants access to **Team settings**.
* Allows managing team-level settings such as members, roles, billing, and security.
The owner status does not change role permissions. An owner still operates within the permissions of their assigned role (for example, Viewer or User).
The owner status can be requested by an existing owner and is granted by Voucherify support.
Your organization account can have multiple members with the owner status. It's recommended to grant the owner status to several members so that there's always someone with access to **Team settings**.
**Members** are people invited to work in the Voucherify dashboard.
After accepting the invitation:
* The member receives an email with a link to set a password and log in.
* The member gains access only to the assigned projects.
**Projects** are separate workspaces within Voucherify that contain campaigns, customers, and related data. Each project has its own API keys, as well as separate member access and permissions.
Access is managed per project, which means:
* A member can have access to selected projects only.
* A member's role can differ between projects.
**Roles** define what actions a member can perform, such as viewing data, creating campaigns, or managing settings.
Custom roles are defined at the organization level, while members are assigned roles within projects.
## Invite a new team member
Prerequisite
Only an account owner can invite new members.
Follow the steps below to invite a new member to your Voucherify organization.
Select your username in the bottom-left corner and go to **Team settings**.
Open the **Team** tab and click **Invite member**.
Enter the member's email address, first name, and last name.
Select at least one project and assign a **Role** within that project (required to send the invitation).
Confirm with **Invite member**. The member receives an email to activate their account.
After activation, the member appears in the team list. You can later update their roles or project access.
## User roles
Voucherify has two types of roles:
* Predefined roles
* Custom roles (enterprise feature)
### Built-in roles
Voucherify includes the following predefined roles:
* **Admin**: Full access to data and **Project settings** within assigned projects. An admin cannot access **Team settings**.
* **User**: Can create, edit, and export data in assigned projects but cannot manage **Project settings** or **Team settings**.
* **Viewer**: Can view and export data but cannot make changes.
* **Restricted user**: Can work only within assigned areas or stores (enterprise feature), defined by an Admin or owner.
* **Merchant**: Has limited dashboard access focused on operations. A merchant can validate and redeem single incentives (not stacked incentives) and view related data, but cannot create or modify resources or manage settings.
### Custom roles (enterprise feature)
With an Enterprise plan, Admins can create custom roles with specific permissions.
To create a custom role:
1. Go to **Team settings** > **Roles**.
2. Duplicate an existing role.
3. Enable or disable selected permissions.
4. Save the role.
You can then assign the custom role to members within selected projects.
## Manage member access
Prerequisite
Only an account owner can manage members.
You can manage a member by going to **Team settings** > **Team** and opening the three-dot **⋮** menu to **Edit** the member.
You can:
* Assign a new project to the member
* Change the member's role in a project
* Remove the member from a project
* Update member details
To delete the member, go to the three-dot menu next to the member.
## Merchants: Access for partners and affiliates
If partners do not need full dashboard access, you can provide API-based access with limited permissions.
Merchants:
* Can access the dashboard with limited permissions
* Can validate and redeem single incentives
* Cannot use stackable redemptions
* Use dedicated API keys assigned to them
To create **merchant API access**:
1. Go to **Project settings** > **General** > **Application keys**.
2. Create a new API key.
3. Assign the **Merchant** role.
4. Share the key securely with the partner.
## Related features
Learn more about features that are tied to managing members and roles.
Manage application keys, client-side permissions, and security options that affect member access.
Read the [Project settings](/manage/project-settings) page to learn more.
Use areas and stores to limit access for restricted users and manage teams by location.
Read more about areas and stores:
* [Areas and stores](/orchestrate/areas-and-stores)
* [Manage areas and stores](/orchestrate/manage-areas-and-stores)
Manage members, roles, and project assignments using the [Management API](/guides/management-api).
Go to the [Audit log](/analyze/audit-logs) to review activity and changes made in the dashboard for security and compliance.
# Project settings
Source: https://docs.voucherify.io/manage/project-settings
Learn what you can find and configure in Voucherify project settings
**Project settings** let you control how a Voucherify project works. A projects is a separate workspace within Voucherify that contains campaigns, customers, and related data. In **Project settings**, you can manage basic project details, security, branding, and data schemas, and review usage limits and advanced options.
Go to the **Home** section in the left side panel and click **Project settings**.
Creating a new project
A new project can be created only by an account owner. You can create a new project in [Team settings](/manage/team-settings#create-a-project "How to create a new project documentation").
## General
The **General** tab contains the main configuration for your project.
### Application information
This section shows basic information about the project:
* **Application name**: The name of your Voucherify project.
* **Time zone**: The default time zone used for dates and expiration rules.
* **Currency**: The currency shown in the dashboard. After changing the project currency, log out and log in again to apply the change.
* **Locale**: Select one of the available locale options. The selected locale automatically sets the date format and the first day of the week (for example, Monday, Saturday, or Sunday).
* **Advanced code settings**: The default character set used to generate voucher codes.
* **Default international dialing prefix**: Used when a customer is added without a phone prefix.
* **Description**: A short description of the project's purpose.
* **Region**: The geographic region where the project operates. It can't be edited.
* **API version**: The API version used by the project. This is the only Voucherify API version currently supported.
* **Case-sensitive voucher codes**: Defines whether uppercase and lowercase letters create different codes (for example, whether `newcode1` and `NEWCODE1` are treated as the same code).
Case sensitivity can be set only during project creation and cannot be changed later.
* **API endpoint**: The base URL for API requests assigned when selecting the project region. It can't be edited.
### Project members
The **Project members** section lists all users assigned to the project, along with their roles and access status.
Account owners can manage members and roles in **Team settings**.
Read [Members and roles](/manage/members-and-roles) to learn more about managing members in your organization.
### Email settings
**Email settings** allow you to send emails from your custom domain using the Voucherify Distribution manager. By entering your domain in **Email sending domain**, you ensure that recipients recognize your brand and that messages are less likely to be marked as spam.
To send emails on your behalf, Voucherify uses DKIM (DomainKeys Identified Mail) to sign outgoing messages. Verify your domain ownership by adding specific records to your DNS provider.
* DKIM signatures: The signatures you must add to your domain's DNS records.
* Verification status: A **Success** indicator appears once the DNS records are correctly propagated and verified.
* Shared domain: If you use multiple sender addresses (e.g., `info@yourdomain.com` and `sales@yourdomain.com`), you only need to configure the DNS entry once for that domain.
Many DNS providers only require you to enter the subdomain name rather than the full domain string. Check your provider's documentation for specific entry requirements.
### Webhooks
Webhooks let you send real-time data from Voucherify to your systems.
You can add webhook URLs, check their status, and manage which webhooks you want to receive.
Read more about webhooks in Project settings and how to configure them:
* [Introduction to Voucherify webhooks](/api-reference/introduction-to-webhooks)
* [Project setting webhooks](/api-reference/project-settings-webhooks)
### API keys
This section shows API keys used to connect with Voucherify and this project's data.
* **Application keys**: Used for server-side API calls. Edit the key to add an IP address to the IP whitelist.
* **Integration keys**: Used for specific integrations with limited access.
* **Client-side keys**: Used in browser-based flows.
Secret keys are visible only for a short time after creation or regeneration. Save them in a safe place.
Sandbox project keys are always visible.
If an API key is marked as **Blocked**, this means that it reached the limit of allowed API calls. Keys can be blocked only by Voucherify; if you want to get more information about the reason for blocked API keys, contact [Voucherify support](https://www.voucherify.io/contact-support).
### Client-side settings
Client-side settings control which actions are allowed from the browser or widgets.
Set your website URL to allow client requests from this domain.
The following client-side settings can affect security or data exposure.
You can enable options such as:
* Client-side voucher redemption: Useful for redemption of referral codes.
* Client-side voucher publication: Useful for assigning codes through widgets, for example subscriber forms.
* Client-side voucher listing: Useful for listing vouchers that a customer has.
* Client-side customer creation: Useful for sign-up or subscriber forms.
* Client-side voucher expiration updates: Useful for creating a sense of urgency to use the voucher.
* Client-side loyalty and referral events: Useful for tracking referral events.
## Brand details
The **Brand details** tab stores information required for marketing emails and legal compliance, like GDPR.
Here you can provide:
* Brand name
* Physical mailing address
* Contact details
* Links to Privacy Policy and Terms of Use
* Website URL
* Logo
This information is added automatically to the footer of Voucherify email templates.
## Event schema
In the **Event schema** tab, you can define custom events and their attributes.
These events can be sent to Voucherify through the API and used as triggers in referral programs or loyalty earning rules.
Read [Custom events](/prepare/custom-events) to learn more about configuring custom event schemas.
## Metadata schema
In the **Metadata schema** tab, you can define custom attributes for different objects, such as campaigns, customers, orders, or products.
Metadata helps you store extra information and use it later in validation rules, segments, and reports.
Read [Metadata](/prepare/metadata) to learn more about configuring metadata (custom attribute) schemas.
## API usage
In the **API usage** tab, you can see how your project uses API calls and messages compared to the limits in your plan.
You can use this view to monitor usage, spot spikes, and avoid reaching limits.
### Charts
The charts provide a visual overview of usage over time:
* **API calls per hour**: Shows how many standard API calls are made each hour.
* **API calls per subscription cycle**: Shows total API usage within the current billing period.
* **Bulk API calls per hour**: Shows usage of bulk endpoints over time.
* **Integration webhook calls per day**: Shows how many webhook calls are triggered by integrations.
* **Messages per day**: Shows how many messages are sent each day.
* **Messages per month**: Shows total message usage within the current month.
Each chart also shows how much of the allowed limit is used.
### Notifications
**Set notifications** to receive alerts when usage reaches a selected percentage of the limit.
Notifications can be sent as in-app alerts or emails.
## Error messages
The **Error messages** tab allows you to manage custom error messages or translations for validations and redemptions.
You can save only one translation group for the default locale.
## Areas and stores
In the **Areas and stores** (enterprise feature) tab, you can organize campaigns by region or point of sale.
You can:
* Create areas that represent regions or markets
* Assign stores to areas
* Control access for users working in specific locations
This helps teams work independently without affecting campaigns in other regions.
Read more about Areas and stores:
* [Areas and stores](/orchestrate/areas-and-stores): Basic principles regarding managing users and resources in areas and stores
* [Manage areas and stores](/orchestrate/manage-areas-and-stores): Configure and manage areas, stores, users, and API keys.
* [Areas and stores access scenario](/orchestrate/areas-and-stores-scenario): Example of a use case for areas and stores.
## Related features
**Project settings** are related to the following topics and features.
New Voucherify projects are created by your account owner in **Team settings**.
Apart from that, the account owner can manage the members assigned to a project and their roles.
Read [Team settings](/manage/team-settings) to learn more about creating projects and other settings available in **Team settings**.
To secure your Voucherify projects and the whole organization, you can apply various tools and methods:
* Two-factor authentication (2FA) and other methods of authentication to improve [account security](/manage/account-security).
* [Default and custom user roles](/manage/members-and-roles)
* [Approval requests](/manage/approval-requests) for checking and approving changes to your campaigns introduced by your organization members
Additionally, the data you share with Voucherify is [secure and compliant](/manage/security-and-data-protection) with various data protection policies, such as GDPR.
# Security and data protection
Source: https://docs.voucherify.io/manage/security-and-data-protection
Data privacy regulations and instructions on how to execute data protection procedures
If you sell or offer products or services to customers based in the EU, you must adhere to the *General Data Protection Regulation* (GDPR). Moreover, if your business operates in California, your services need to be compliant with the *California Consumer Privacy Act* (CCPA).
Here are key resources regarding security and data protection:
* [Visit Data processing agreement](https://www.voucherify.io/legal/data-processing-agreement)
* [Contact Data Protection Officer](mailto:dpo@voucherify.io)
* [Visit Security and data protection policy](https://www.voucherify.io/legal/security-policy)
## Voucherify commitment to data privacy and GDPR compliance
The [General Data Protection Regulation](https://gdpr-info.eu/) (GDPR) is a European privacy law approved by the European Commission and it aims at strengthening, modernizing EU data protection law, and enhancing individual rights and freedoms, consistent with the European understanding of privacy as a fundamental human right.
Voucherify is a GDPR-compliant data processor. To find the comprehensive security and data protection measures implemented at Voucherify, visit [the legal section](http://www.voucherify.io/legal).
Read the overview of GDPR requirements met at Voucherify.
Voucherify offers a Data Processing Addendum (DPA) for customers who collect data from individuals in the EU. The DPA provides contractual terms that meet GDPR requirements and reflect Voucherify's data privacy and security commitments.
Voucherify uses trusted vendors and maintains signed data processing agreements with all partners that subprocess sensitive data. This vendor management approach ensures that customer data is stored and processed in secure, compliant environments.
The Voucherify Data Protection Officer (DPO) ensures all employees receive training on handling sensitive data and avoiding social engineering attacks. Access to the Voucherify platform is controlled by a managed and audited security policy.
Voucherify maintains updated [Terms of Service and Privacy policy](https://www.voucherify.io/legal "Voucherify policies and procedures portal") to remain fully compliant with GDPR. These documents describe what personal data Voucherify collects, the purpose of processing, and how long the data is stored.
Voucherify uses a Data Protection Impact Assessment (DPIA) process to identify and minimize data protection risks. Every change to the software or organizational procedures triggers a privacy review to mitigate potential consequences for clients.
Voucherify includes features to support data regulations regarding the right to portability, the right to be forgotten, and the right to rectification. You can manage these requirements through the dashboard or API.
### Data Protection Officer
Voucherify works with clients to answer any questions and address any concerns regarding how their data is protected in compliance with the GDPR standards. If you have any questions, [contact Voucherify compliance](mailto:compliance@voucherify.io).
### How to execute GDPR procedures in Voucherify?
Learn more about standard procedures in Voucherify related to GDPR regulations.
Submit a ticket through the [support page](https://www.voucherify.io/contact-support). The Voucherify team will remove your account and all underlying data from the data center and third-party providers.
To remove a team member permanently, you can use one of the following methods:
* Voucherify dashboard: The account owner can remove user data directly through the dashboard:
Log in to the dashboard and go to **Team settings** > **Team**. Find the specific member you want to remove.
Open the three-dot menu **⋮**, select **Delete**, and confirm the action.
Once the user is deleted, click **Remove permanently** in the three-dot menu **⋮** and confirm the action.
* Contact support: The account owner can remove a team member by reaching out to [Voucherify support](https://www.voucherify.io/contact-support).
The member data is removed permanently.
You can update or remove customer data using these options:
* Dashboard Edit: An account admin can go to **Customers**, locate the specific customer profile, and edit the information.
Read [Manage customers](/prepare/customers) to learn more about customer management.
* Contact support: The admin or the customer can contact [Voucherify support](https://www.voucherify.io/contact-support) directly, for example when you no longer have access to Voucherify dashboard. Customers must provide the necessary information to identify their organization and records. Voucherify will notify the organization administrator if a customer requests a manual update.
You can export your customer data as CSV or JSON files through two primary methods:
* Dashboard: Use the [dashboard export tool](/prepare/customers#export-customer-data).
* API: Use the [Create export endpoint](/api-reference/exports/create-export).
To delete customer data permanently, use one of these three methods:
* Dashboard settings: Go to **Team settings** > **Delete people data** to delete data permanently.
Read more about [Team settings](/manage/team-settings) and deleting people data.
* API endpoint: Use the [Delete customer permanently API endpoint](/api-reference/customers/delete-customer-permanently) for automated permanent deletion.
* Manual request: The account admin or customer can contact [Voucherify support](https://www.voucherify.io/contact-support), for example when you no longer have access to Voucherify dashboard. If a customer makes this request, they must provide identification details. The organization administrator will be notified.
All data management actions described above are compliant with the GDPR.
## Email subscriptions from Voucherify
You can manage communication you receive from Voucherify in **My Profile** > **Email subscriptions**.
## California Consumer Privacy Act (CCPA)
Voucherify is fully compliant with [California Consumer Privacy Act (CCPA)](https://www.oag.ca.gov/sites/all/files/agweb/pdfs/privacy/ccpa-proposed-regs.pdf). As a result, Voucherify:
* Informs customers that their personal data is being collected by the Service Provider.
* Informs customers whether their personal data is sold or disclosed and to whom.
* Allows customers to reject the sale of their personal data.
* Allows customers to access their personal data.
* Allows customers to request deletion of any personal information about them.
* Does not discriminate against customers who exercised their privacy rights.
If you have any questions regarding CCPA and Voucherify, [contact Voucherify support](https://www.voucherify.io/contact-support).
# Organization security overview
Source: https://docs.voucherify.io/manage/security-overview
Protect your Voucherify account with authentication, role-based access, approval workflows, and data protection controls
Voucherify gives you a layered set of tools to secure your organization: from how members sign in, through what they can change, to how customer data is processed and protected. Use this section to configure authentication, manage access, enforce review workflows, and stay aligned with privacy regulations.
## What you can secure
Enable two-factor authentication, configure SAML SSO, monitor account activity, and set alerts for API usage and webhook failures.
Invite members, assign roles, and use projects to control who has access to data and actions across your organization.
Require review for sensitive operations on campaigns, vouchers, and customers to prevent errors and unauthorized changes.
Review Voucherify's GDPR and CCPA commitments and follow the procedures for executing customer data protection requests.
## Why organization security matters
Promotions touch sensitive parts of your business: customer data, marketing budgets, and revenue. A clear security setup helps you:
* Prevent unauthorized access: Strong authentication and SSO reduce the risk of compromised accounts.
* Limit unforeseen consequences: Role-based access and project scoping ensure members only reach the data and actions they need.
* Protect campaigns from mistakes: Approval workflows catch risky changes before they go live.
* Stay compliant: Built-in data protection processes help you meet GDPR, CCPA, and other privacy requirements.
## How the pieces fit together
The security offered by Voucherify combines as follows:
* Account security controls how members sign in and how you detect suspicious activity.
* Members and roles define what each signed-in user is allowed to do.
* Approval requests add a review step on top of roles for high-impact changes.
* Security and data protection covers how Voucherify processes customer data and how you respond to data subject requests.
## What's next?
Start with [account security](/manage/account-security) to enable 2FA and SSO, then review [members and roles](/manage/members-and-roles) to structure access for your team. Use [approval requests](/manage/approval-requests) to protect critical operations, and consult [security and data protection](/manage/security-and-data-protection) for privacy and compliance procedures.
# Team settings
Source: https://docs.voucherify.io/manage/team-settings
Learn what you can configure in Team settings as an account owner
Team settings control your whole Voucherify account. Only a member with the **account owner** status can access and manage Team settings.
Open the profile menu in the bottom-left corner of the dashboard and click **Team settings**.
## Subscription
In the **Subscription** tab, you can manage your plan, billing details, and check usage:
* Create, update, or cancel a subscription with **Create subscription**.
* Update your payment method.
* Edit billing details in the **Billing details** section.
* Review usage and limits.
Your billing cycle starts on the day you confirm your subscription. Usage limits reset at the start of each cycle.
If you exceed your usage limits, API access is blocked until the next cycle starts or you upgrade your plan.
Team settings show usage across projects (API, messages, and integration webhooks). Click the down arrow to select a project and view its usage.
**Set notifications** for usage (API, messages, and integration webhooks) to define:
* Threshold that triggers a notification (percentage of your limit).
* Notification channel (email or in-app notification in the dashboard).
* Recipients.
Go to the following pages:
* [Voucherify account](/manage/voucherify-account) to learn more about managing your subscription.
* [Performance analytics](/analyze/performance-analytics) to learn more about monitoring usage and other data for your campaigns, project, and whole account.
## Invoices
**Invoices** lists all your invoices and their details. Download the invoices you need.
Voucherify issues invoices based on your subscription (monthly or annual).
## Team
In the **Team** tab, you can manage account users:
* Use filters to find team members.
* Invite a new member with **Invite member**.
* Edit or delete a user using the three-dots **⋮** (**Actions**) menu.
When you invite a user, select projects they can access and assign a role for each project.
## Security
In the **Security** tab, you can enforce account-level security rules and check if all users are enrolled.
You can enforce two-factor authentication (2FA) for your team. Voucherify supports:
* SMS codes
* Google Authenticator
* Backup codes
You can also enable SAML authentication.
Read [Account security](/manage/account-security) to learn more about protecting Voucherify accounts in your organization.
## Projects
In the **Projects** tab, you can manage all projects in your account.
To modify project configuration, go to **Project settings** of a given project.
Switch between projects using the actions menu to start working in another project.
Delete a project using the actions menu. You must be in a different project to delete it; otherwise, the option is disabled.
Data is not shared between projects. Each project has separate customers, campaigns, and configuration.
### Create a project
You can add as many projects as your subscription limit allows. The Sandbox project is not counted towards the project limit.
Create a new project with **Create project**.
When you create a project, define the following fields in the **Details** section:
* **Name**: Provide a unique name for your project.
* **Description**: Add an optional summary of the project's purpose.
* **Region**: Select **Europe**, **United States**, or **Asia (Singapore)**.
You cannot change the **Region** once the project is created.
* **Time zone**: Set the local time for campaign scheduling.
* **Currency**: Choose the primary currency for your transactions.
* **Default international dialing prefix**: Add an optional prefix for SMS distributions.
In the **Permanent settings** section, define the voucher code case sensitivity. This setting determines how the system validates codes.
* **Case sensitive**: The system treats `cOdE1` and `CODE1` as different codes.
* **Case insensitive**: The system treats `cOdE1` and `CODE1` as the same code.
You cannot change voucher code case sensitivity after you create the project.
During project creation, assign **Users** to the project and define their specific roles. Roles determine the access levels and permissions for each team member.
A project must have at least one member.
Select from built-in roles:
* **Admin**: Full access to projects and **Project settings** (cannot access Team settings)
* **User**: Can read and change data in assigned projects
* **Viewer**: Can read and export data, but cannot change it
* **Merchant**: Can validate and redeem incentives
* **Restricted user**: Required when using areas and stores (enterprise feature); access is limited to assigned areas or stores set in Project settings
You can also assign a custom role.
Once you complete these steps, the project is ready for further configuration.
## Roles
In the **Roles** tab, you can review role permissions for the built-in roles. You can also create and manage custom roles (enterprise feature).
Read [Members and roles](/manage/members-and-roles) to learn more about built-in and custom roles.
## Legal and compliance
In the **Legal and compliance** tab, you can review legal documents and add compliance contact details:
* Review policies, subscription agreements, and data processing agreements.
* Review and accept updates to policies.
* Add your company details.
* Add contact details:
* EU representative
* Data protection officer
* Security contact person
* Access compliance documents available in the dashboard.
Voucherify is a GDPR-compliant data processor. Read more in the [Security and data protection](/manage/security-and-data-protection) article.
## Delete people data
In the **Delete people data** tab, you can permanently remove customer history for GDPR requests.
Search for a customer using Customer ID, source ID, or email address, then delete and confirm.
Delete customer and delete people data
Deleting a customer in the **Customers** list deletes their profile. However, customer data is not fully deleted from Voucherify databases.
To completely delete customer data, you need to provide their customer ID assigned by Voucherify in the **Delete people data** tab. This way, you can locate the deleted customer profile and delete their data permanently.
## Management API
Management API is available for enterprise plans.
In the **Management API** tab, you can define and manage API keys that let you create and manage projects through the API.
**Create new** to generate a new pair of management API ID and secret keys. You can limit the use to a specific IP address.
Click the three-dot **⋮** menu to manage your key.
You can review the management API usage in the **Subscription** tab.
## Related features
**Team settings** are related to the following settings and features in Voucherify.
Once you've created a new project in **Team settings**, go to **Home** > **Project settings** in the left-bar menu to configure project-level options. There, you can create and manage API keys, webhooks, currency, metadata and custom event schemas, and check usage.
Read the [Project settings](/manage/project-settings) page to learn more about configuring your project.
Only members with the admin role can view and configure project settings.
You can use [the Delete customer permanently API endpoint](/api-reference/customers/delete-customer-permanently) to completely delete customer data.
Once you've generated Management API keys, you can manage your projects programmatically through the API.
For example, you can create projects, invite members, assign roles, and configure other project details.
Go to [Management API](/guides/management-api) to learn more.
# Voucherify account
Source: https://docs.voucherify.io/manage/voucherify-account
Learn how to manage your Voucherify account, subscription, buy extra API packages, request consultation services, and handle subscription cancellation
Required permissions: Account owner
Only the account owner can manage subscription and billing settings. These options are available in **Team settings** > **Subscription**.
## Subscription lifecycle
A Voucherify subscription goes through the following stages: trial, paid use, and cancellation.
### Trial period
Every Voucherify account starts with a **60-day free trial**, giving you time to explore the platform and test integrations.
During this time, you can:
* Use a free **Sandbox project** for testing.
* Explore features with the demo shop.
* Test the Voucherify API.
Once you upgrade to a paid plan, the Sandbox project remains available and it does not count toward your project limit. You can continue using it as a testing environment. Your existing data will not be reset.
### Continue after the trial
To keep using Voucherify after the trial ends, you need to create a paid subscription:
1. Go to **Team settings** > **Subscription**.
2. Click **Create subscription** and choose a plan.
3. Enter billing information and credit card details.
4. Click **Create**.
Your billing cycle starts on the day you confirm the subscription.
### Update your pricing plan
If your needs change, you can upgrade your plan at any time from the subscription settings:
1. Go to **Team settings** > **Subscription**.
2. Click **Change plan**.
3. Confirm billing and payment details.
If you need custom limits or additional features, contact the [Voucherify team](https://www.voucherify.io/contact-support) about the enterprise plan.
### Cancel subscription
Only the account owner can cancel a subscription or request cancellation.
Enterprise clients
Enterprise subscriptions follow a slightly different process due to contract-based agreements.
If you are on an enterprise plan (typically annual contracts), contact your Technical Account Manager to discuss cancellation. Cancellation terms may depend on your individual agreement.
You can cancel your Voucherify subscription in **Team settings** > **Subscription** or by contacting Voucherify support.
If you contact support, your subscription is considered canceled only after you receive confirmation from the Voucherify team.
After cancellation, your account remains active for the remainder of the billing period. You retain full access to your projects and data during this period. No further charges are applied after the current billing cycle ends.
After cancellation, your data is preserved for a limited time in case you decide to return. Account data (including projects and configurations) is retained for up to 1 year after cancellation. After the retention period, data may be permanently deleted. You can't undo cancellation, but you can create a new subscription and restore your setup within the data retention period.
## Buy extra API packages
If you expect higher traffic or temporary spikes, you can increase your API limits by buying API packages. These packages temporarily increase your limits and expire 30 days after purchase.
Additional API packages do not apply to the Sandbox project. The Sandbox project has a fixed limit of 100 API calls per hour.
Go to **Team settings** > **Subscription**.
Choose whether to increase:
* API calls per minute or per hour
* API calls per subscription cycle
The available options depend on your subscription plan.
Specify how many packages you want to buy:
* For API calls per minute/hour: Maximum 5 packages.
* For API calls per cycle: Unlimited packages.
Fill in billing information, confirm payment details, and click **Buy**.
Your API limit increases by the package bought.
You receive a separate invoice for this purchase.
## Buy consultation services
If you need expert guidance from Voucherify team members, you can buy consultation hours to help with implementation or optimization.
Consultations can cover integration, configuration, feature setup, troubleshooting, and other topics related to everyday Voucherify usage.
Go to **Team settings** > **Subscription**.
Click **Request consultation**.
Specify the number of consultation hours you want to buy.
Fill in billing information, confirm payment details, and click **Buy**.
After the purchase is completed, the Voucherify team will contact you to schedule the consultation.
## Related features
Explore the following guides to manage your team, projects, and account security after setting up your subscription.
The [Team settings](/manage/team-settings) article explains what an account owner can configure at the team level, including subscription, billing, members, and account-wide preferences.
The [Members and roles](/manage/members-and-roles) guide shows how to invite teammates, assign roles, and control access to projects and features across your Voucherify account.
The [Account security](/manage/account-security) article covers authentication options such as SAML and 2FA, access controls, and monitoring tools you can enable to protect your Voucherify account.
The [Security and data protection](/manage/security-and-data-protection) guide outlines Voucherify's approach to GDPR, CCPA, and data privacy, and how to execute data protection procedures for your account.
The [Project settings](/manage/project-settings) article explains what you can configure within an individual project, useful when scaling from your Sandbox into production projects after upgrading.
The [Approval requests](/manage/approval-requests) guide shows how to set up approval workflows that protect campaigns from errors and unauthorized changes – a common next step once multiple members join your account.
# Create dynamic formulas
Source: https://docs.voucherify.io/optimize/create-dynamic-formulas
How to create dynamic discount and loyalty point formulas
Use dynamic formulas to calculate discounts, product units, replacement units, or loyalty points based on order, customer, item, metadata, or campaign-related values.
For supported operands, functions, operators, and expression syntax, see [Dynamic formula reference](/optimize/dynamic-formula-reference).
The formula builder helps you create formulas by typing them directly, selecting variables, metadata, functions, and operators, using templates, or working in the diagram view. Templates provide starting points for common logic, such as calculations based on order amount, customer metadata, or order currency.
The formula field shown in the builder depends on the selected discount type, product discount setup, or earning rule configuration. Before you create a formula, the required value field uses the label of the configured value. After you create a formula, this field changes to **Fallback** and is used when the formula cannot be calculated.
Amount formula fields are shown when the selected configuration calculates a monetary value.
Formula fields:
* **Discount Amount formula**: calculates the discount amount
* **Fixed amount formula**: calculates the fixed discount amount
* **New price formula**: calculates the new product price
Example formula:
```wrap theme={null}
IF(ORDER_AMOUNT > 200;ORDER_AMOUNT * 0.15;ORDER_AMOUNT * 0.05)
```
Percent formula fields are shown when the selected configuration calculates a percentage value.
Formula field:
* **Percent of discount formula**: calculates the discount percentage
Example formula:
```wrap theme={null}
IF(CUSTOMER_METADATA("tier") is "VIP";25;10)
```
Quantity formula fields are shown when the selected configuration calculates a unit quantity.
Formula fields:
* **Units quantity formula**: calculates the number of discounted units
* **Free units quantity formula**: calculates the number of free units
* **Replacement Quantity per Unit formula**: calculates the replacement quantity per unit
Example formula:
```wrap theme={null}
IF(ORDER_UNITS_QUANTITY > 5;FLOOR(ORDER_UNITS_QUANTITY / 3;0);1)
```
Points formula fields are shown when the selected earning rule configuration calculates loyalty points.
Formula field:
* **Points formula**: calculates the number of awarded loyalty points
Example formula:
```wrap theme={null}
IF(ORDER_AMOUNT > 500;ROUND(ORDER_AMOUNT * 1.5;0);ROUND(ORDER_AMOUNT;0))
```
## Type a formula
Type or paste a formula directly into the formula field.
Use the supported expression syntax. For example, to return a different value depending on the order amount, enter:
```wrap theme={null}
IF(ORDER_AMOUNT > 100;15;5)
```
## Add formula elements
Select the formula field to show the formula toolbar.
Use the toolbar to add formula elements.
Available controls:
* **Add variable**: Adds predefined operands, such as order, customer, or item values.
* **Add metadata**: Adds metadata operands.
* **IF**: Adds conditional logic.
* **SWITCH**: Adds switch logic.
* **+**: Adds an operator.
* **Add FUNCTION**: Adds a function.
* **Templates**: Opens predefined formula templates.
After adding an element, fill in the required arguments in the formula field, such as metadata keys, comparison values, or values returned by conditional logic.
## Use templates
Open **Templates** and click a template.
Available templates:
* **Based on order amount**: Creates formula logic based on the order amount.
* **By customer metadata condition**: Creates conditional formula logic based on customer metadata.
* **By customer metadata value**: Creates formula logic that uses a customer metadata value.
* **By order currency**: Creates formula logic based on the order currency.
Templates add predefined formula logic that you can modify after inserting it. After selecting a template, update the generated values and conditions to match your promotion or loyalty logic.
## Use the diagram view
Click **Show diagram** to open the formula in a diagram view.
If the formula field is empty, the diagram view shows **Click to add** and template shortcuts. Use **Click to add** to start creating the formula visually, or select one of the displayed templates.
If a formula is already defined, the diagram view shows the formula as connected nodes and keeps the editable expression below the diagram.
In the diagram view, you can also use:
* **Formula toolbar and inline formula editor**: Add or edit formula elements without leaving the diagram view.
* **Zoom controls**: Adjust the diagram view.
You can use the diagram view to inspect existing logic and add new conditions or cases directly to the formula.
## Format, validate, and save
Use **Format** to format the expression.
Available options:
* **Format now**: Formats the current formula
* **Auto-format**: Reformats the formula automatically while editing
To remove the formula, click **Clear**.
Review the validation message below the formula editor. If the formula is correct, the builder shows **Formula is valid**.
Click **Save** to save the discount configuration or earning rule.
After the campaign is saved, you can edit the formula by editing the campaign from the campaign view.
# Create rewards
Source: https://docs.voucherify.io/optimize/create-rewards
Learn how to create and manage rewards for loyalty and referral campaigns
Use rewards to incentivize customers in loyalty and referral campaigns in Voucherify. You can use the following reward types:
* **Digital rewards**: Discount coupons, gift card credits, or loyalty points delivered automatically to customers.
* **Material rewards**: Physical products from your catalog that require manual fulfillment.
* **Pay with points**: Allows customers to exchange loyalty points for cash value on their orders.
You can add a reward to an existing:
* [Loyalty campaign](/build/loyalty-campaign-overview)
* [Referral campaign](/build/referral-campaign-overview)
## Create a reward
Create rewards in the **Reward catalog** to use them across your campaigns.
Go to **Campaign hub** > **Rewards** and click **Create reward**.
Optionally, you can create a reward directly when creating:
* Loyalty campaign > [Reward catalog step](/build/create-loyalty-campaign#reward-catalog)
* Referral campaign > Create tier > Rewards step
Choose from:
* **Discount coupon**
* **Credits on gift card**
* **Points on loyalty card**
* **Material reward**
* **Pay with points**
Configure the details of a selected reward type.
The **Discount coupon** reward can give a customer a coupon for:
* Order discounts
* Product discounts
* Rewards (free items)
* Free shipping
* Bundles
Configure the reward as follows:
1. **Name** the reward.
2. Select **Campaign** as the source of coupons.
3. Alternatively, click the **+** button to open a simplified campaign builder.
4. Optionally, add **Metadata**.
Read the [Discount types and effects](/build/discount-types-and-effects) article to learn more about different discounts.
The **Credits on gift card** reward adds balance to a customer's gift card. If a customer doesn't have a gift card yet, redeeming the reward automatically publishes a new gift card and adds credits to it.
Configure the reward as follows:
1. **Name** the reward.
2. Define **Gift amount** to add to the customer's gift card.
3. Select **Campaign** as the source of gift cards.
4. Alternatively, click the **+** button to open a simplified campaign builder.
5. Optionally, add **Metadata**.
The **Points on loyalty card** reward adds points to a customer's loyalty card. If a customer doesn't have a loyalty card yet, redeeming the reward automatically publishes a new loyalty card and adds points to it.
Configure the reward as follows:
1. **Name** the reward.
2. Define **Loyalty points** to add to the customer's loyalty card.
3. Select **Campaign** as the source of loyalty cards.
4. Optionally, add **Metadata**.
When creating a **Points on loyalty card** reward in a loyalty campaign builder, you can't select this loyalty campaign as the reward source. A loyalty campaign can't reward itself with loyalty points.
**Material rewards** are physical products from your catalog. [Upload your products](/prepare/products) to the dashboard before using them as rewards.
Configure the reward as follows:
1. **Name** the reward.
2. Select an existing product or SKU, or click **Create new** to add a product.
3. Optionally, define **Quantity/Stock** of available units.
4. Optionally, enter **Reward description** to display a text to customers.
5. Optionally, **Upload image** to show visuals to customers.
6. Optionally, add **Metadata**.
Pay with points allows customers to use loyalty points to pay for orders. Define the exchange ratio by mapping the number of points to a cash amount.
Configure the reward as follows:
1. **Name** the reward.
2. Define the exchange rate between **Loyalty points** and **Cash value**.
3. Optionally, add **Metadata**.
Review the configuration and **Save** the reward.
The reward is added to the reward catalog.
You can now assign the created reward to loyalty or referral campaigns.
## Rewards – additional options
Some of the rewards have additional options or require special workflows.
### Material reward – fulfillment workflow
Material rewards require manual confirmation:
1. When a customer redeems a material reward, the status changes to **PENDING**.
2. After you physically deliver the reward, confirm it in the dashboard.
3. Go to the campaign's **Reward redemptions** tab and click the check mark to change the status to **COMPLETE**.
### Pay with points reward – validation rules
When a **Pay with points** reward is added to loyalty campaign, you can limit its redemption with validation rules. These rules create limits based on customer, order, and metadata attributes.
To add a validation rule:
1. Open the reward in the **Reward catalog** in the loyalty campaign builder.
2. Click the **+** button to open the rule builder.
3. Create or select a validation rule.
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
## Related options and features
Explore other features for better use of rewards in Voucherify.
Track rewards in the dashboard to monitor how customers interact with your rewards.
Go to the reward's detail view to see:
* Reward dashboard.
* Assignments: campaigns to which the rewards are assigned.
* Metadata.
* Activity to track reward assignments, redemptions, awards, and other details. Use filters to narrow down the results.
Use this data to optimize your reward strategy and identify popular incentives.
Add custom attributes to rewards using metadata. Metadata allows you to store additional information that isn't part of the standard reward schema.
When creating or editing a reward, you can:
* Add values to keys from an existing metadata schema.
* **Add unknown property**: Add a custom attribute not defined in the schema.
* **Add to schema**: Define a new attribute and add it to the metadata schema.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
You can also upload rewards with the [POST Create reward](/api-reference/rewards/create-reward) endpoint.
Check [Voucherify reward API](/api-reference/rewards/reward-object) for more endpoints to manage your rewards.
# Create validation rules
Source: https://docs.voucherify.io/optimize/create-validation-rules
A step-by-step guide to building validation rules that limit redemptions, control loyalty earning, or trigger distributions
Validation rules define the conditions customers must meet to redeem incentives, earn loyalty points, or trigger distributions in Voucherify. All validation logic is configured in the **validation rule builder**.
Validation rules – description
Read the [Validation rules](/optimize/validation-rules-reference) article to learn how each rule works.
## Access the validation rule builder
You can open the validation rule builder from:
* **Campaign builder**: Create a validation rule while configuring a campaign. A validation rule is then automatically assigned to the campaign.
* **Campaign details**: Open an existing campaign and go to the **Rules** tab. Enable edit mode to create a validation rule or edit an existing one.
* **Validation rules** in the **Campaign hub**: Create reusable rules for future use across campaigns.
## Build a validation rule
Follow these steps to create or edit a validation rule.
The builder looks slightly different when it's opened in different places.
**Name** your validation rule.
If left unchanged, Voucherify uses the default name.
Builder in Validation rules
When creating a validation rule in **Validation rules** section of the dashboard, you can also select **Context**.
Use **Context** to prepare a rule for validating a specific resource. **Context** determines which rule types are available and it's recommended for advanced use cases.
**Add rules** to choose conditions from available categories:
* **Audience**: Customer segments, loyalty tiers, or customer metadata.
* **Products**: Specific products, SKUs, collections, or prices of items.
* **Prices & quantities**: Order value, item quantity, or price thresholds.
* **Budget constraints**: Campaign spend restrictions, like total order or discount values, number of redemptions per period or customer.
* **Redemptions**: Limits for redeeming users and API keys.
* **Metadata**: Limits related to custom attributes covering customer, order, redemption, or custom event metadata.
Some rules also have subrules that can set additional conditions.
**Edit rule** by clicking the three-dot menu.
Context-dependent rules
Depending on the **Context** defined in the **Name the rule** step or the dashboard context (campaign builder, earning rule, distribution, and so on), the number and types of rules will vary.
For each rule, select operators such as **is**, **is more than**, **after**, and so on.
You can add multiple conditions within a single rule to refine the logic.
For example, you can create a rule where the order initial amount is more than \$100 and less than \$150.
Combine rules using logical connectors:
* **AND**: All rules must be met.
* **OR**: At least one rule must be met.
Click the junction to change it.
Use **brackets** to group conditions into complex logic. You can nest rules by dragging them into bracket groups.
The following actions are available when configuring rules and brackets.
After adding a rule, use the three-dot menu next to the rule name to manage rule actions.
Available rule actions:
* **Error message**: Defines a custom validation message for the selected rule.
* **Edit rule**: Updates the selected rule configuration.
* **Duplicate rule**: Creates a copy of the selected rule.
* **Add next rule**: Adds another rule after the selected rule.
* **Add next brackets**: Adds a new bracket group after the selected rule.
* **Remove rule**: Removes the selected rule from the spending configuration.
* **Surround with brackets**: Groups the selected rule inside brackets.
Use the three-dot menu on the right side of the bracket group to manage bracket actions.
Available bracket actions:
* **Add rule**: Adds a new rule inside the selected bracket group.
* **Add next rule**: Adds a new rule after the selected bracket group.
* **Add brackets**: Adds a nested bracket group inside the selected bracket group.
* **Add next brackets**: Adds a new bracket group after the selected bracket group.
* **Remove brackets and rules inside**: Removes the selected bracket group together with all rules inside it.
**Add error message** to define a custom message returned in the API response when a specific rule is not met.
You can also **Add fallback error message** to the whole validation rule when an error is not specified for a particular rule.
If no validation rule error message and no fallback message are defined, the API response will not include the `error` object for validation rule violations in some cases.
**Save** your validation rule.
Builder differences
If you configure validation rules through the **Validation rules** section in the dashboard, you will have a **Summary** step where you can **Save** the validation rule.
The rule is assigned to the campaign once the campaign builder is saved or added to the validation rule list.
## Using existing validation rules
In the campaign manager and campaign details, you can:
* Create a new validation rule
* Select an existing validation rule
* Clone and edit an existing rule
* Remove an assigned validation rule
Changes made to assigned rules are applied immediately.
## Validation rules with bundles and product discounts
For **bundle** campaigns and **product discount** campaigns, Voucherify automatically creates a validation rule that includes the configuration of the bundle and discounted products.
This auto-generated validation rule cannot be removed from the campaign in the campaign manager or campaign details. You can, however, edit the rule to add or remove conditions.
## Related features
Validation rules connect to other Voucherify features. Use the resources below to prepare data and apply rules effectively.
[Customer segments](/prepare/customer-segments) group customers based on shared attributes or behavior. Use segments in **Audience** rules to target specific customer groups.
Segments update dynamically, so a rule that targets a segment always checks the current membership.
[Product collections](/prepare/product-collections) group products based on attributes or filters. Use collections in **Products** rules to define required or excluded cart items.
Dynamic collections update automatically when products match the defined filters.
[Metadata](/prepare/metadata) lets you store custom attributes on customers, orders, products, and redemptions. Use metadata in validation rules to create conditions based on any custom data.
Define metadata schemas in **Project Settings** to ensure consistent data types across rules.
[Custom events](/prepare/custom-events) track customer actions sent via API. Use custom event metadata in validation rules for distributions or earning rules.
For example, trigger a distribution only when a custom event includes specific metadata.
Validation rules control eligibility for:
* [Discount coupons](/build/create-discount-coupons) and [promotions](/build/create-discount-promotions)
* [Loyalty earning rules](/build/earning-rules)
* [Referral campaigns](/build/create-referral-campaign)
Each campaign type supports different rule categories based on its context.
Developers can manage validation rules using the [Validation Rules API](/api-reference/validation-rules/validation-rule-object).
The API supports creating rules, assigning them to campaigns, and listing all assignments.
Because validation rules often include complicated logic and many rules, it's recommended to create validation rules through the dashboard to avoid any misconfiguration.
# Dynamic formula reference
Source: https://docs.voucherify.io/optimize/dynamic-formula-reference
Reference for dynamic discount and loyalty point formulas using operands and operators
The dynamic formula builder defines how discount or loyalty point values are calculated.
Instead of using a static value for discounts or loyalty points, you can create formulas using mathematical and logical operators combined with metadata values. The final value is calculated dynamically during redemption.
The formula builder requires a **fallback value**. The fallback value is used if the dynamic formula cannot be evaluated due to missing parameters.
## Application scope
Dynamic formulas can be used as follows.
### Dynamic discount formulas
The dynamic discount formula builder applies to:
* Order discount
* Product discount
* Reward
Used in:
* Coupon campaigns
* In-cart promotions
* Referral codes
### Dynamic points formulas
The dynamic points formula builder applies to:
* Fixed earning rules
* Proportional earning rules
Used when creating **loyalty programs**.
To create formulas in the dashboard, see [Create dynamic formulas](/optimize/create-dynamic-formulas).
## Operand reference
Operands represent the values used inside formulas.
Example (paste the expression to the Expression output tab and switch to the Formula builder tab to see the result).
### Data type
You can use the following data type operands. In some contexts, only number is allowed.
| Operand | Definition | Example |
| ------- | ------------------ | ------- |
| Number | Value is a Number. | `2` |
| Text | Value is a String. | `"VIP"` |
### Metadata operands
You can use the following metadata operands.
| Operand | Definition | Example |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| Order metadata | Order metadata attribute of type Number or String. | `ORDER_METADATA("day_of_week")` |
| Voucher metadata | Voucher metadata attribute of type Number or String. Available in dynamic discount formulas only. | `REDEEMABLE_METADATA("active_on_calendar_month")` |
| Customer metadata | Customer metadata attribute of type Number or String. | `CUSTOMER_METADATA("customer_life_time_value")` |
| Redemption metadata | Redemption metadata attribute of type Number or String. Available in dynamic discount formulas only. | `REDEMPTION_METADATA("store_list")` |
| Publication metadata | Publication metadata attribute of type Number or String. Available in dynamic discount formulas only. | `PUBLICATION_METADATA("year")` |
| Promotion tier metadata | Promotion tier metadata attribute of type Number or String. Available in dynamic discount formulas only (promotion). | `REDEEMABLE_METADATA("membership_duration")` |
Depending on the context, the formula builder may accept either metadata with a number type only, or any type (string, boolean, array, and so on).
### Order item operands
You can use the following operands in dynamic discount formulas only (product discounts).
| Operand | Definition | Example |
| --------------------------- | ------------------------------------------------------- | ----------------------------------------- |
| Order item price | Returns order item price. | `ORDER_ITEM_PRICE` |
| Order item amount | Returns order item amount before stacked discounts. | `ORDER_ITEM_AMOUNT` |
| Order item subtotal | Returns order item subtotal used for stacked discounts. | `ORDER_ITEM_SUBTOTAL` |
| Order item units quantity | Returns order item quantity. | `ORDER_ITEM_UNITS_QUANTITY` |
| Order item metadata | Returns order item metadata. | `ORDER_ITEM_METADATA("Size")` |
| Order item product metadata | Returns product metadata. | `ORDER_ITEM_PRODUCT_METADATA("category")` |
```
(order item price) × 0.01 + 1
```
If the item price is **6.00**, the discount is **1.06**.\
If the item price is **10.00**, the discount is **1.10**.
### Cheapest order item operands
You can use the following cheapest order item operands.
| Operand | Definition | Example |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| Cheapest order item price | Returns the price of the cheapest line item in the order. | `CHEAPEST_ORDER_ITEM_PRICE` |
| Cheapest order item amount | Returns the amount of the cheapest line items in the order; for stacked discounts, returns the original amount without any modifications due to other discounts. | `CHEAPEST_ORDER_ITEM_AMOUNT` |
| Cheapest order item subtotal | Returns the subtotal of the cheapest line items in the order; for stacked discounts, each additional discount is based on the result obtained after calculating the previous discount. | `CHEAPEST_ORDER_ITEM_SUBTOTAL` |
| Cheapest order item units quantity | Returns total units of the cheapest order line items. | `CHEAPEST_ORDER_ITEM_UNITS_QUANTITY` |
| Cheapest order item metadata | Returns the cheapest order item metadata of type Number or String. | `CHEAPEST_ORDER_ITEM_METADATA("Size")` |
| Cheapest order item product metadata | Returns the cheapest order item product metadata. | `CHEAPEST_ORDER_ITEM_PRODUCT_METADATA("category")` |
The cheapest order item is determined as follows when there are several items with the same price.
1. First, the formula tries to find the order item with the cheapest price. If there is one item, the formula returns this item. Otherwise, it proceeds to step 2.
2. If there are **n items that have the same cheapest price**, from this n, the formula finds the items with the lowest subtotal. If there is only one item, the formula returns this item. Otherwise, if there are many items, it proceeds to step 3.
3. Finally, it returns the **first item from the list of the cheapest items with the lowest subtotal**.
### Most expensive order item operands
You can use the following most expensive order item operands.
| Operand | Definition | Example |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Most expensive order item price | Returns the price of the most expensive line item in the order. | `MOST_EXPENSIVE_ORDER_ITEM_PRICE` |
| Most expensive order item amount | Returns the amount of the most expensive line items in the order; for stacked discounts, returns the original amount without any modifications due to discounts. | `MOST_EXPENSIVE_ORDER_ITEM_AMOUNT` |
| Most expensive order item subtotal | Returns the subtotal of the most expensive line items in the order; for stacked discounts, each additional discount is based on the result obtained after calculating the previous discount. | `MOST_EXPENSIVE_ORDER_ITEM_SUBTOTAL` |
| Most expensive order item units quantity | Returns the total units of the most expensive order line items. | `MOST_EXPENSIVE_ORDER_ITEM_UNITS_QUANTITY` |
| Most expensive order item metadata | Returns the most expensive order item metadata of type Number or String. | `MOST_EXPENSIVE_ORDER_ITEM_METADATA("Size")` |
| Most expensive order item product metadata | Returns the most expensive order item product metadata. | `MOST_EXPENSIVE_ORDER_ITEM_PRODUCT_METADATA("category")` |
The most expensive order item is determined as follows when there are several items with the same price.
1. First, the formula tries to find the order item with the most expensive price. If there is one item, the formula returns this item. Otherwise, it proceeds to step 2.
2. If there are **n items that have the same most expensive price**, from this n, the formula finds the items with the lowest subtotal. If there is only one item, the formula returns this item. Otherwise, if there are many items, it proceeds to step 3.
3. Finally, it returns the **first item from the list of the most expensive items with the lowest subtotal**.
### Order-level operands
You can use the following order-level operands.
| Operand | Definition | Example |
| -------------------- | ------------------------------------- | ---------------------- |
| Order amount | Returns order total value. | `ORDER_AMOUNT` |
| Order items quantity | Returns item count. | `ORDER_ITEMS_QUANTITY` |
| Order units quantity | Returns the sum of the units ordered. | `ORDER_UNITS_QUANTITY` |
### Voucher operands
You can use the following voucher operands. These operands are unavailable for earning rules.
| Operand | Definition | Example |
| --------------------------- | --------------------------------------------------------------- | ----------------------------- |
| Voucher redemption quantity | Returns voucher redemption limit. | `VOUCHER_REDEMPTION_QUANTITY` |
| Voucher redeemed quantity | Returns number of redemptions. | `VOUCHER_REDEEMED_QUANTITY` |
| Voucher publish count | Returns the number of times the voucher was published (0 or 1). | `VOUCHER_PUBLISH_COUNT` |
| Voucher start date | Returns voucher start date. | `VOUCHER_START_DATE` |
| Voucher expiration date | Returns voucher expiration date. | `VOUCHER_EXPIRATION_DATE` |
### Promotion tier operands
You can use the following promotion tier operands.
| Operand | Definition | Example |
| ------------------------------ | --------------------------------------- | -------------------------------- |
| Promotion tier start date | Returns promotion tier start date. | `PROMOTION_TIER_START_DATE` |
| Promotion tier expiration date | Returns promotion tier expiration date. | `PROMOTION_TIER_EXPIRATION_DATE` |
### Customer operands
You can use the following customer operand. It can be combined only with date operands and operators.
| Operand | Definition | Example |
| ------------------ | --------------------------------- | -------------------- |
| Customer birthdate | Returns the customer's birthdate. | `CUSTOMER_BIRTHDATE` |
### Date operands
You can use the following date operands.
| Operand | Definition | Example |
| ------------ | ----------------------------------------- | --------------------------------------- |
| Day of month | Returns number of day of month in a date. | `DAY_OF_MONTH(CUSTOMER_BIRTHDATE)` |
| Month | Returns number of month in a date. | `MONTH(TODAY)` |
| Year | Returns year in a date. | `YEAR(CUSTOMER_BIRTHDATE)` |
| Today | Returns today's date. | `TODAY` |
| Now | Returns current date and time. | `NOW` |
| Date | Returns chosen date value. | `DATE("2023-08-17")` |
| Date time | Returns chosen date and time. | `DATE_TIME("2023-08-17T14:05:00.000Z")` |
## Expression functions
You can use the following formula operators to create complex expressions.
| Operand | Definition | Example |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Brackets | Groups expression elements together (adds parentheses). | `(10 - ORDER_METADATA("number_of_store_visits"))` |
| Min | Lowest value in a range. | `MIN(PUBLICATION_METADATA("year"); CUSTOMER_METADATA("customer_life_time_value"))` |
| Max | Highest value in a range. | `MAX(PUBLICATION_METADATA("year"); CUSTOMER_METADATA("customer_life_time_value"))` |
| Power | A number raised to a power. | `POW(ORDER_METADATA("number_of_store_visits");2)` |
| If | Value based on a logical expression. | `IF(ORDER_METADATA("number_of_store_visits") > 5;10;3)` |
| Default to | Returns the first non-null value of range. | `DEFAULT_TO(REDEMPTION_METADATA("store_list") / 2;5)` |
| Round | Round a number to a specified number of digits. Positive precision refers to a decimal place indicator. Negative precision indicates an integer place indicator. | Assume the customer lifetime value is 75.55.
`ROUND(CUSTOMER_METADATA("customer_life_time_value");1)`
= 75.60 (precision value equal to 1)
`ROUND(CUSTOMER_METADATA("customer_life_time_value");0)`
= 76.00 (precision value equal to 0)
`ROUND(CUSTOMER_METADATA("customer_life_time_value");-1)`
= 80.00 (precision value equal to -1) |
| Floor | Round down to a specified number of digits. Positive precision refers to a decimal place indicator. Negative precision indicates an integer place indicator. | Assume the customer lifetime value is 75.55.
`FLOOR(CUSTOMER_METADATA("customer_life_time_value");1)`
= 75.50 (precision value equal to 1)
`FLOOR(CUSTOMER_METADATA("customer_life_time_value");0)`
= 75.00 (precision value equal to 0)
`FLOOR(CUSTOMER_METADATA("customer_life_time_value");-1)`
= 70.00 (precision value equal to -1) |
| Ceil | Round up to a specified number of digits. Positive precision refers to a decimal place indicator. Negative precision indicates an integer place indicator. | Assume the customer lifetime value is 74.44.
`CEIL(CUSTOMER_METADATA("customer_life_time_value");1)`
= 74.50 (precision value equal to 1)
`CEIL(CUSTOMER_METADATA("customer_life_time_value");0)`
= 75.00 (precision value equal to 0)
`CEIL(CUSTOMER_METADATA("customer_life_time_value");-1)`
= 80.00 (precision value equal to -1) |
## Operator reference
You can use the following operators depending on the data type.
### Number operators
You can use the following operators with the number type.
| Operator | Description | Example |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| Add (+) | Adds numbers or expressions. | `A + B` |
| Subtract (-) | Subtracts values. | `A - B` |
| Multiply (x) | Multiplies numbers. | `ORDER_METADATA("day_of_week") x 2` |
| Divide (÷) | Divides values. | `CUSTOMER_METADATA("customer_months_active") ÷ 8` |
| Modulo (%) | Returns the remainder after division, meaning it returns the amount "left over" after dividing one number or expression by another. | `A % B` |
| Greater than | Logical operator returns the **Value if true** if the value on the left is greater than the value on the right. Otherwise, it returns the **Value if false**. | `A > B` |
| Less than | Logical operator returns the **Value if true** if the value on the left is less than the value on the right. Otherwise, it returns the **Value if false**. | `A < B` |
| Equal to | Logical operator returns the **Value if true** if the value on the left is equal to the value on the right. Otherwise, it returns the **Value if false**. | `A = B` |
| In array | Logical operator returns the value true if the value on the left is one of the values provided on the right. Otherwise, it returns false. | `IN_ARRAY` |
| Not in array | Logical operator returns the value true if the value on the left is NOT one of the values provided on the right. Otherwise, it returns false. | `NOT_IN_ARRAY` |
### String operators
You can use the following operators with the string type.
| Operator | Description | Example |
| ------------ | ---------------------------------- | ------------------------ |
| Is | True if strings are equal. | `is "VIP"` |
| Is not | True if strings are NOT equal. | `isNot "Beginner"` |
| Contains | Checks substring presence. | `contains "California"` |
| Starts with | Checks prefix match. | `startsWith "store_"` |
| Ends with | Checks suffix match. | `endsWith "_sms"` |
| In array | Checks if value is from a set. | `IN_ARRAY "EU,EMEA"` |
| Not in array | Checks if value is NOT from a set. | `NOT_IN_ARRAY "EU,EMEA"` |
### Date operators
You can use the following operators with the date type.
| Operator | Description | Example |
| ------------ | -------------------------------- | -------------------- |
| Days since | Days between today and a date. | `DAYS_SINCE(date)` |
| Months since | Months between today and a date. | `MONTHS_SINCE(date)` |
| Years since | Years between today and a date. | `YEARS_SINCE(date)` |
| Days until | Days until future date. | `DAYS_UNTIL(date)` |
| Months until | Months until future date. | `MONTHS_UNTIL(date)` |
| Date is | Date equality check. | `DATE_IS` |
| Date is not | Date inequality check. | `DATE_IS_NOT` |
| Is after | Date comparison. | `IS_AFTER` |
| Is before | Date comparison. | `IS_BEFORE` |
## Complex expression operators
Complex expressions combine multiple logical conditions.
### AND operator
All conditions must evaluate to **true**.
Give a customer **20% off** when:
* they have more than **10 store visits**
* AND the purchase occurs on **Friday**
Otherwise they receive **3% discount**.
```wrap theme={null}
IF(CUSTOMER_METADATA("number_of_store_visits") > 10 AND ORDER_METADATA("day_of_week") = 5;20;3)
```
### OR operator
At least **one condition** must evaluate to **true**.
Example use case:
Give a customer **20% off** when:
* they have more than **10 store visits**
* OR the purchase occurs on **Friday**
Otherwise they receive **3% discount**.
```wrap theme={null}
IF(CUSTOMER_METADATA("number_of_store_visits") > 10 OR ORDER_METADATA("day_of_week") = 5;20;3)
```
## Nested formulas
Nested formulas allow expressions inside logical conditions.
If a condition is true, the logical expression will follow the nested path defined inside the condition. If the condition is false, the logical expression will follow the other path.
```wrap theme={null}
IF(ORDER_ITEMS_QUANTITY > 4;IF(ORDER_AMOUNT > 200;25;15);10)
```
Example logic:
* more than 4 items AND order > 200 → **25% discount**
* more than 4 items only → **15% discount**
* otherwise → **10% discount**
## Switch function
Switch expressions allow different values depending on a factor.
Example: discount based on store location.
```wrap theme={null}
SWITCH(ORDER_METADATA("store_city");SWITCH_CASE("Boston";10) SWITCH_CASE("New York";15);5)
```
Example:
* Boston customers get **10% discount**
* New York customers get **15% discount**
* Customers from other locations get **5% discount**
# Fraud prevention best practices
Source: https://docs.voucherify.io/optimize/fraud-prevention-best-practices
Learn how to prevent promotion fraud, protect your campaigns, and monitor suspicious activity using Voucherify features and external tools
Fraud in promotion systems usually falls into two categories:
* Promotion fraud: misuse of incentives such as vouchers, discounts, or loyalty points
* Identity fraud: abuse of user accounts, such as fake accounts or account takeovers
Voucherify helps prevent promotion fraud using built-in campaign controls.
Identity fraud prevention must be implemented on your side using external systems.
## Campaign security
Use built-in controls to limit how incentives are distributed and redeemed.
Voucherify supports fraud prevention through:
* **Validation rules**: Define conditions and limits for incentive usage
* **Time limits**: Restrict when incentives can be used
* **Activity tracking**: Monitor usage and detect suspicious behavior
## Anti-fraud limits
Use validation rules and campaign settings to define limits and conditions for incentive usage.
These limits help prevent misuse, protect your campaign budget, and ensure incentives are used as intended.
Control who can receive and redeem incentives.
* Use **Customer segment** to restrict access to selected users
* Use **Customer loyalty tier** to limit eligibility
* Use **Redemption only by code holder** to prevent sharing of codes
These controls reduce the risk of unauthorized access and limit incentive exposure to selected audiences.
Limit how often incentives can be redeemed.
* **Total number of redemptions**: Limits how many times a campaign can be used in total, preventing overuse
* **Redemptions per customer in a campaign**: Prevents a single user from repeatedly using the same promotion
* **Redemptions per customer per incentive**: Limits how many times one user can redeem a specific code
You can also apply time-based limits:
* **Total number of redemptions per day / week / month**: Slows down large-scale abuse and bot activity
* **Redemptions per customer per period**: Prevents repeated use within defined time frames
These limits protect your budget and reduce the impact of automated or repeated abuse.
Control how much value is distributed through incentives.
* **Total discounted amount**: Caps the total value of discounts applied in a campaign
* **Total orders value**: Limits the total value of orders using incentives
* **Total redeemed gift amount**: Restricts how much balance can be used from gift campaigns
These limits protect your campaign from unexpected overspending and financial abuse.
Define when an incentive can be applied based on order structure.
You can use rules such as:
* **Total amount before discounts**: Ensures minimum cart value before applying incentives
* **Total amount after discounts**: Controls final pricing after applying discounts
* **Items quantity**: Limits usage based on the number of items
* **Price of any item / each item**: Restricts incentives to specific product price ranges
You can also control which items qualify:
* **Any order item**
* **Every order item**
* **None of the order items**
* **Most expensive item**
* **Cheapest item**
These conditions prevent misuse by ensuring incentives apply only to valid purchases.
Percent discounts can apply a high discount amount for large orders.
To protect your margins, you can set up a **Maximum discount amount** for order- and product-based percent discounts. Customers won't receive higher discounts from the percent discount when they would exceed the maximum limit.
Learn more about [Discount types and effects](/build/discount-types-and-effects).
Restrict how incentives are redeemed.
* Use **Redeeming API key** to limit which integrations can perform redemptions
* Use **Redeeming user** to control which internal users can redeem incentives
These controls help prevent unauthorized or unintended redemptions.
Rate limiting per IP must be implemented on your backend or API gateway.
Restrict when incentives are valid.
You can define:
* Campaign start and expiration dates
* Specific time windows
* Validity period after publication
These limits prevent reuse of expired incentives and reduce long-term abuse.
Learn how to configure [time limits](/optimize/time-limits)
Undo redemptions when needed:
* Restore redemption limits
* Restore balances such as gift cards or loyalty points
This allows you to correct mistakes or reverse suspicious activity.
Rollback is available up to 3 months after redemption.
## Activity tracking
Monitor campaign activity to detect unusual patterns.
Voucherify lets you track:
* Campaign performance
* Customer behavior
* Redemption history
* API requests
Each object (campaign, voucher, customer, order) includes logs and history in the dashboard.
Use this data to identify suspicious activity such as sudden spikes in usage or repeated failed attempts.
## Notifications and reports
Use notifications and reports to detect issues early.
### Webhooks
Use webhooks to receive real-time notifications about events such as redemptions or customer updates.
This lets you detect unusual activity and react immediately, for example by blocking suspicious requests, flagging accounts, or triggering internal alerts.
You can configure webhooks in [Project settings webhooks](/api-reference/project-settings-webhooks). For an overview, see [Introduction to webhooks](/api-reference/introduction-to-webhooks).
Recommended events for fraud monitoring:
* [**redemption.succeeded**](/api-reference/redemption/succeeded): Track sudden spikes in usage
* [**redemption.failed**](/api-reference/redemption/failed): Detect repeated failed attempts
* [**voucher.updated**](/api-reference/voucher/updated): Monitor changes to incentives
* [**customer.updated**](/api-reference/customer/updated): Track suspicious customer activity
### Dashboard reports
Use dashboard reports to identify unusual patterns.
Focus on:
* Spikes in redemptions, which may indicate abuse or bot activity
* High failure rates, which may signal repeated invalid attempts
* Unexpected changes in campaign performance, which can reveal misuse patterns
## External fraud prevention tools
Use external tools to detect and prevent identity fraud, such as fake accounts, account takeovers, and suspicious user behavior.
* [AtData](https://atdata.com): Email and identity verification for detecting disposable or risky addresses.
* [Sift](https://sift.com): Machine learning-based fraud detection.
* [SEON](https://seon.io): Fraud detection using data enrichment and behavioral analysis.
* [Nethone](https://nethone.com): Behavioral analytics and device intelligence.
* [FingerprintJS](https://fingerprint.com): Visitor identification across sessions.
## Recommended fraud prevention practices
These practices are not provided by Voucherify. You can implement them in your authentication or backend systems.
### Account protection
Protect user accounts from unauthorized access:
* Limit failed login attempts to reduce brute-force attacks
* Use CAPTCHA to block automated account creation
* Enable multi-factor authentication to protect user accounts
### Customer verification
Reduce fake accounts and improve data quality:
* Block suspicious email domains to prevent fake registrations
* Normalize email addresses to avoid duplicate accounts
* Require email or SMS verification to confirm user identity
## Related features
Combine fraud prevention mechanisms with the following features.
Most anti-fraud mechanisms in Voucherify are based on validation rules.
Use them to define limits, restrict access, and control how incentives are used.
Learn how to [create validation rules](/optimize/create-validation-rules) or explore the [validation rules reference](/optimize/validation-rules-reference).
Use customer data to restrict access to incentives and detect suspicious behavior patterns.
Learn more in the [customer overview](/prepare/customer-overview).
Use distributions to control how incentives are delivered and reduce the risk of sharing or misuse.
Learn more in the [distributions guide](/integrations/distributions-overview).
# Optimize overview
Source: https://docs.voucherify.io/optimize/optimize-overview
Move from static discounts to always-on experimentation that drives revenue, repurchase, and smarter growth
After you build campaigns, use the Optimize section to fine-tune how customers interact with your incentives. Control eligibility, set time windows, create rewards, and track redemptions.
## What you can optimize
Track code usage, validation attempts, and redemption activity. Monitor success rates and troubleshoot failures.
Build rules that control who can redeem incentives based on audience, products, order value, and budget limits.
Explore all available rule types: audience targeting, product conditions, budget constraints, and metadata filters.
Set validity windows, expiration dates, and recurring schedules for campaigns and vouchers.
Configure loyalty and referral rewards: discount coupons, gift card credits, points, material rewards, and pay with points.
## Why optimization matters
Voucherify validates every redemption against your rules. The more precise your targeting and limits, the better your ROI:
* **Prevent abuse**: Budget constraints and redemption limits protect campaign spend.
* **Control timing**: Time limits and validity windows align promotions with business needs.
* **Reward loyalty**: Configure rewards that drive repeat purchases and customer retention.
## How optimization connects to campaigns
Optimization settings work alongside your campaigns:
* **Validation rules** attach to campaigns, vouchers, and earning rules to control eligibility.
* **Time limits** define when campaigns and codes are active.
* **Rewards** power loyalty and referral programs.
* **Redemptions** track all customer interactions with your incentives.
Start with basic validation rules, then add complexity as you learn what works for your customers.
## What's next?
Start with [validation rules](/optimize/create-validation-rules) to control who can redeem your incentives, or [time limits](/optimize/time-limits) to set when campaigns are active. Use [rewards](/optimize/create-rewards) to configure loyalty and referral payouts.
# Time limits
Source: https://docs.voucherify.io/optimize/time-limits
Learn about time-related campaign limits, validity timeframes, and recurring schedules in Voucherify
Use time limits to control when campaigns, vouchers, and promotion tiers are active.
All time-related limits follow the **time zone** defined in your **Project settings**.
Campaign calendar
Once you save your campaign or save it as a draft, you can see when it will be active in **Campaign Calendar** in the **Marketer Hub** sidebar section. **Campaign Calendar** shows an overview of all campaigns and their time frames and additional information when you click on a given bar.
## Start and expiration dates
These settings define the main period when customers can redeem codes.
Voucherify blocks redemption attempts before the start date and after the expiration date.
### Starts on
This setting defines when the campaign becomes active:
* **Creation**: The campaign starts immediately after you save it.
* **Specific date**: The campaign starts at a chosen date and time.
### Expires
This setting defines when the campaign ends.
* **Never**: The campaign runs until you manually disable it.
* **On specific date**: The campaign ends automatically at the chosen date and time.
## Time limitations
You can add recurring validity windows using the **Add limitation** option.
These limitations work inside the main campaign timeframe.
### Add duration & interval time frame
This setting makes vouchers or promotions valid for a specific duration at regular intervals.
For example:
* Valid for **1 hour**
* Repeated every **1 day**
The validity window starts based on the campaign start time.
You can combine this limit with **Valid days of the week**.
### Add valid days of the week
This setting limits redemptions to selected weekdays.
For example, only on Mondays, Wednesdays, and Saturdays.
You can combine this limit with **Duration & interval time frame**.
### Add valid hours per day
This setting lets you define the exact hours and days when customers can redeem vouchers or promotions.
For example:
* Tuesdays and Thursdays
* Between 9:00 AM and 11:00 AM
This creates a typical “happy hour” scenario.
You can add multiple hour limitations, but they can't overlap.
This limitation can't be combined with the other recurring limitations.
## Valid for a specific amount of time after publishing
This setting allows vouchers to be valid for a fixed period after they are published to a customer
For example, a voucher is valid for 24 hours after the code is assigned.
The timer starts when the code is published, not when the campaign starts.
This rule overrides campaign expiration dates.
If a voucher is published just before the campaign ends, it will still remain valid until its publication window expires.
# Validation rule reference
Source: https://docs.voucherify.io/optimize/validation-rules-reference
Learn about rules, limits, and budget constraints available in the Voucherify validation rule builder
This page describes rules that secure your campaigns from fraud and define specific buying conditions. These rules control how and when customers can redeem incentives (codes or promotion tiers) or earn loyalty points.
Read the [Create validation rules](/optimize/create-validation-rules) article to build and use your rules.
The rules are grouped into the following categories:
* Audience
* Products
* Prices and quantities
* Budget constraints
* Redemptions
* Metadata
Rules and limits depend on the selected context. Some rules are not available for specific campaign types or use cases.
## Glossary
Read this glossary to learn Voucherify terminology required to work with validation rules.
[Customer segments](/prepare/customer-segments) group customers based on standard attributes (such as email or postal code) and custom attributes added as metadata.
[Custom events](/prepare/custom-events) are external actions performed by customers that are tracked and sent to Voucherify using the API.
[An earning rule](/build/earning-rules) is a rule that defines how and when loyalty points are assigned to a customer's loyalty card.
A customer becomes the holder of a unique code (a coupon, gift card, referral code, or loyalty card) once it has been assigned to them. Assigned codes are visible in the customer profile under the Wallet tab.
Also known as custom attributes. [Metadata](/prepare/metadata) allows you to store custom key-value data on Voucherify objects such as customers, orders, redemptions, products, and events. Metadata is commonly used to build validation rules and for reporting.
A redeeming user refers to a team member or affiliate invoking a redemption. Validation rules using redeeming users can restrict which project members are allowed to perform successful redemptions.
[Redemption](/optimize/validations-and-redemptions) is a single use of a promo code or an in-cart discount. In loyalty programs, a redemption represents exchanging loyalty points for a reward.
The **Validation rule builder** is the interface used to create validation rules. The [Validation rule builder](/optimize/create-validation-rules) is available in the campaign manager and in the validation rules section of the Voucherify dashboard.
## Audience
Audience rules define conditions customers must meet to receive or redeem an incentive:
* **Customer segment**: Target or exclude specific customer segments.
* **Customer loyalty tier**: Target or exclude customers based on their loyalty tier.
* **Redemption only by code holder**: Restrict code usage to the customer to whom the code was published.
## Products
Product rules define validation based on the structure of the customer's order. You can further refine these rules using **subrules** related to order structure or order volume.
### Any order item
At least one item in the cart must match the defined criteria:
* **is**: Specified products or collections must be present in the cart.
* **from**: The matched products must also belong to a specified collection.
Example
Both conditions work like this: "is" a t-shirt collection, "from" a summer clothing collection.
You can add subrules such as:
* **Subtotal of matched items**: Define the total amount of all items that meet criteria set with product filters.
* **Quantity of matched items**: Define the total number of all items that meet criteria set with product filters across all order lines.
* **Unit price of the matching order line**: Define the price of at least one matching order line.
* **Item quantity in the matching order line**: Define the required quantity for at least one matching order line.
* **Matching item metadata**: Define limits using order items metadata that need to be met by at least one order line item.
### Every order item
Every item in the cart must match the defined criteria:
* **is**: Specified products or collections must be present
* **from**: Matched products must also belong to a specified collection
You can add subrules such as:
* **Subtotal of matched items**: Define the total amount of all items that meet criteria set with product filters.
* **Quantity of matched items**: Define the total number of all items that meet criteria set with product filters across all order lines.
* **Unit price of the matching order line**: Define the required price of every order line.
* **Item quantity in the matching order line**: Define the required quantity in every order line.
* **Matching item metadata**: Define limits using order items metadata that need to be met by every order line item.
### None of the order items
Excludes the cart from validation if specified products or collections are present:
* **is**: Specified products or collections must be present
* **from**: Matched products must also belong to a specified collection
### Most expensive of the order items
Defines rules for the most expensive item in the cart or the most expensive item within a specific collection:
* **is**: Products or collections that must be the most expensive
* **from**: Collection from which the most expensive item is selected
You can add subrules such as:
* **Subtotal of matched items**: Define the total amount of all the qualified most expensive items.
* **Quantity of matched items**: Define the total count of all the qualified most expensive items.
* **Unit price of the matching order line**: Define the required price of each qualified most expensive item.
* **Items quantity in the matching order line**: Define the required quantity of each qualified most expensive item.
* **Matching item metadata**: Define limits using order items metadata that need to be met by each qualified most expensive item.
### Cheapest of the order items
Defines rules for the cheapest item in the cart or the cheapest item within a specific collection:
* **is**: Products or collections that must be the cheapest
* **from**: Collection from which the cheapest item is selected
You can add subrules such as:
* **Subtotal of matched items**: Define the total amount of all qualified cheapest items.
* **Quantity of matched items**: Define the total count of all qualified cheapest items.
* **Unit price of any matching order line**: Define the required price of each qualified cheapest item.
* **Items quantity in any matching order line**: Define the required quantity of each qualified cheapest item.
* **Metadata of matched items**: Define limits using order items metadata that need to be met by each qualified cheapest item.
## Prices and quantities
These rules define validation based on order value and pricing and item quantities:
* **Total amount before discounts**: Requires the cart value (at validation time, before applying the current incentive) to meet a specified threshold. This value may change depending on previously applied incentives.
* **Total amount after discounts**: Requires the cart value after applying the current incentive to meet a specified threshold. If applying the discount reduces the order total below the configured threshold, validation fails and the discount is not applied.
* **Initial amount**: Requires the original cart value (before any discounts or stacking adjustments) to meet a specified threshold. This value remains **constant** throughout stacking.
* **Items quantity**: Requires a minimum or maximum number of products in the cart.
* **Price of each item**: Requires every product in the cart to meet a specified price condition.
* **Price of any item**: Requires at least one product in the cart to meet a specified price condition.
### Amount rules: quick comparison
In stacking scenarios, some rules are evaluated against the **original cart value**, while others use the **current cart value at the moment of validation**. This difference can affect whether a promotion is applicable depending on the order in which incentives are applied.
| Rule | What it checks | Changes during stacking | When to use |
| --------------------------------- | ---------------------------------- | ----------------------- | -------------------------------------------------------------------------- |
| **Initial amount** | Original cart value | ❌ No | Ignore stacking order |
| **Total amount before discounts** | Cart value at validation time | ✅ Yes | Depend on current cart value, after taking into account previous discounts |
| **Total amount after discounts** | Cart value after applying discount | ✅ Yes | Enforce minimum after discount |
**Total amount before discounts** depends on stacking order. If earlier incentives reduce the cart value, this rule may fail even if the original cart value meets the requirement.
Use **Initial amount** when validation should be independent of stacking order.
Use **Total amount before discounts** when validation should depend on the cart value at the moment the incentive is applied.
A cart has an initial value of **10.50**.
A coupon has the following rules:
* **Total amount before discounts > 10**
* **Initial amount \< 11**
A gift card reduces the cart value by **1.00**.
**Scenario 1: Coupon applied first**
* Cart at validation: **10.50**
* Both rules pass → coupon is applicable
**Scenario 2: Gift card applied first**
* Cart after gift card: **9.50**
* Coupon validation sees:
* Initial amount = **10.50** ✅
* Total amount before discounts = **9.50** ❌
* Coupon is **not applicable**
## Budget constraints
Budget constraints limit campaign usage and help prevent abuse. They can also affect the number of redemptions done by customers.
* **Total orders value**: Define the value of all orders made within the campaign. Once the limit is reached, customers cannot redeem incentives.
* **Total discounted amount**: Define the overall value of the discount that the customers can get by redeeming incentives from a particular campaign.
* **Total number of redemptions**: Define the total number of redemptions allowed per entire campaign (the sum of all redemptions made within the campaign).
* **Total number of redemptions per day**: Define the daily limit of redemptions allowed in the entire campaign for all customers. The day is a calendar day, for example 1 January 2025.
* **Total number of redemptions per week**: Define the weekly limit of redemptions allowed in the entire campaign for all customers. The first day of the week (Monday, Saturday, or Sunday) is defined in **Project settings** > Locale. For Monday, a week lasts between Monday 00:00 and the end of Sunday 23:59, for example between Monday 00:00 6 January 2026 and the end of Sunday 23:59 11 January 2026.
* **Total number of redemptions per month**: Define the monthly limit of redemptions allowed in the entire campaign for all customers. The month is a calendar month, for example January.
* **Redemptions per incentive per day**: Define the daily limit of redemptions for a given incentive (code or promotion tier). The day is a calendar day, for example 1 January 2025.
* **Redemptions per incentive per week**: Define the weekly limit of redemptions for a given incentive (code or promotion tier). The first day of the week (Monday, Saturday, or Sunday) is defined in **Project settings** > Locale. For Monday, a week lasts between Monday 00:00 and the end of Sunday 23:59, for example between Monday 00:00 5 January 2026 and the end of Sunday 23:59 11 January 2026.
* **Redemptions per incentive per month**: Define the monthly limit of redemptions for a given incentive (code or promotion tier). The month is a calendar month, for example January.
* **Redemptions per customer per incentive**: Define the total number of redemptions that a particular customer can make using a given incentive (code or promotion tier).
* **Redemptions per customer per incentive per day**: Define the daily limit of redemptions that a particular customer can make using a given incentive (code or promotion tier). The day is a calendar day, for example 1 January 2025.
* **Redemptions per customer per incentive per week**: Define the weekly limit of redemptions that a particular customer can make using a given incentive (code or promotion tier). The first day of the week (Monday, Saturday, or Sunday) is defined in **Project settings** > Locale. For Monday, a week lasts between Monday 00:00 and the end of Sunday 23:59, for example between Monday 00:00 5 January 2026 and the end of Sunday 23:59 11 January 2026.
* **Redemptions per customer per incentive per month**: Define the monthly (calendar month) limit of redemptions that a particular customer can make using a given incentive (code or promotion tier). The month is a calendar month, for example January.
* **Redemptions per customer in a campaign**: Define the total number of redemptions counted per customer per campaign.
* **Redemptions per customer in a campaign per day**: Define the daily limit of redemptions that a particular customer can make using incentives from a particular campaign. The day is a calendar day, for example 1 January 2025.
* **Redemptions per customer in a campaign per week**: Define the weekly limit of redemptions that a particular customer can make using incentives from a particular campaign. The first day of the week (Monday, Saturday, or Sunday) is defined in **Project settings** > Locale. For Monday, a week lasts between Monday 00:00 and the end of Sunday 23:59, for example between Monday 00:00 5 January 2026 and the end of Sunday 23:59 11 January 2026.
* **Redemptions per customer in a campaign per month**: Define the monthly (calendar month) limit of redemptions that a particular customer can make using incentives from a particular campaign. The month is a calendar month, for example January.
* **Total redeemed gift amount**: Define the total value of the redeemed balance in the whole campaign.
* **Maximum pay with points**: Define the number of loyalty points to be used to pay for an order.
Once a budget limit is reached, customers can no longer redeem incentives from that campaign.
## Redemptions
Redemption rules define technical constraints on how redemptions are handled:
* **Redeeming user**: Restrict which team members or affiliates can invoke redemptions.
* **Redeeming API key**: Restrict redemption requests to specific API keys.
* **Redemption only by code holder**: Restrict redemptions to the customer the code was published to.
## Metadata
Metadata rules define validation based on custom attributes:
* **Customer metadata**: Require specific metadata to be present in the customer.
* **Order metadata**: Require specific metadata to be present in the order.
* **Redemption metadata**: Require specific metadata to be present in the redemption request.
* **Custom event metadata**: Require specific metadata to be present in custom events.
## Related features
Validation rules work with other Voucherify features. Use the resources below to prepare data for your rules.
[Customer segments](/prepare/customer-segments) group customers based on shared attributes or behavior. Use segments in **Audience** rules to target specific customer groups.
Segments update dynamically, so a rule that targets a segment always checks the current membership.
[Product collections](/prepare/product-collections) group products based on attributes or filters. Use collections in **Products** rules to define required or excluded cart items.
Dynamic collections update automatically when products match the defined filters.
[Metadata](/prepare/metadata) lets you store custom attributes on customers, orders, products, and redemptions. Use metadata in validation rules to create conditions based on any custom data.
Define metadata schemas in **Project Settings** to ensure consistent data types across rules.
[Custom events](/prepare/custom-events) track customer actions sent via API. Use custom event metadata in validation rules for distributions or earning rules.
For example, trigger a distribution only when a custom event includes specific metadata.
Validation rules control eligibility for:
* [Discount coupons](/build/create-discount-coupons) and [promotions](/build/create-discount-promotions)
* [Loyalty earning rules](/build/earning-rules)
* [Referral campaigns](/build/create-referral-campaign)
Each campaign type supports different rule categories based on its context.
Developers can manage validation rules using the [Validation Rules API](/api-reference/validation-rules/validation-rule-object).
The API supports creating rules, assigning them to campaigns, and listing all assignments.
Because validation rules often include complicated logic and many rules, it's recommended to create validation rules through the dashboard to avoid any misconfiguration.
# Validations and redemptions
Source: https://docs.voucherify.io/optimize/validations-and-redemptions
Track code validation, validation sessions, and successful redemptions in Voucherify
The **Redemptions** section in **Campaign hub** is the key place for monitoring how customers interact with your incentives. It helps you track whether codes are being used successfully or why they are failing.
## Key concepts
To understand how Voucherify tracks activity, learn the differences between these three terms:
A **validation** is a check to see if an incentive is eligible for use before the actual redemption happens.
In the **Validations** tab:
* You can check the incentives that were applicable, inapplicable, or skipped during a check.
* Validation data is stored for 30 days.
* For deeper technical details, such as request and response data, you can review the **Audit logs**.
A validation **session** locks a discount for a customer while they are still in the checkout process. This prevents the same code from being reused while a customer finishes their purchase.
You can manage and unlock sessions in the **Sessions** tab.
Developer info
Validation sessions are created as part of a validation API call.
Read the developer guide about [Locking validation session](/guides/locking-validation-session).
A **redemption** occurs when an incentive (a code or promotion) is actually applied to an order.
During redemption:
* Voucherify records every attempt, including those that are successful, failed, or reverted (rolled back).
* You can view details such as the customer involved, used incentives, order summary, and the specific campaign.
* **Rollback**: Successful redemptions can be reverted within 3 months of the event if a customer returns an item or the order is canceled.
## Monitoring and data
Use the **Redemptions** sections to monitor and track your validations, redemptions, and sessions.
**Add filter** to narrow down your search.
You can also view **Redemptions** and **Validations** of an incentive by opening its detailed view.
### Failed attempts
If a redemption fails, Voucherify provides a failure reason. Common causes include:
* The voucher has expired or is not active.
* Usage or redemption limits have been reached.
* The order or customer does not meet validation rules.
### Detailed logs
To troubleshoot integrations and validation behavior, use detailed logs.
Each redemption has detailed event data, like `redemption.created` or `redemption.succeeded`. The event data link to a log that shows, among others:
* HTTP method
* Request and response data
* Related events
For validations, use **Audit logs** to view detailed data.
### Exporting data
In **Redemptions**, **Export** redemption data as a **CSV file** for further analysis and tracking. You can apply filters to narrow down results.
Choose which standard fields and custom attributes (metadata) to include in the exported CSV.
The date and times of the exported data are in the UTC time zone.
Once ready, **Export** your list. The file will be generated and delivered to your **Notifications Center**.
You can also find all your exported files in **Audit log** > **Exports**.
Larger exports may take longer to generate.
# Areas and stores
Source: https://docs.voucherify.io/orchestrate/areas-and-stores
Understand the basic principles, roles, and resource visibility in Areas and Stores
With the Areas and Stores feature, you can create campaigns that target specific markets or stores within one project. You can create areas that represent regions and stores that represent points of sale. This lets local managers run campaigns independently without affecting other regions.
Areas and Stores is an **Enterprise** feature.
## Basic principles
This section explains how these elements work together.
Areas, All Stores, and individual Stores are **three separate levels of assignment**. Each level controls access and campaign visibility in a different way.
### Area
An **area** helps you group and manage promotional activities. An area can include multiple stores.
* You can assign users and API keys to an area.
* Assigning a user to an area does **not** automatically assign them to that area’s stores.
* Campaigns can be assigned directly to an area.
Area-level campaigns are separate from store-level campaigns.
### All Stores
The **All Stores** option includes all current and future stores within a specific area.
* You can assign users and API keys to All Stores.
* Users assigned to All Stores can manage campaigns in individual stores.
* They cannot manage campaigns assigned only to the area itself.
* A campaign assigned to All Stores will also apply to stores created later in that area.
All Stores give access to all stores in an area, but it does not give access to area-level campaigns.
### Store
A **store** represents a single point of sale.
* You can assign users and API keys to a store.
* Users assigned only to one store cannot manage campaigns in other stores or in the area.
* Campaigns assigned to one store cannot be used by users assigned to another store.
This level gives you very precise control over who can manage campaigns.
In the UI, stores are labeled as **Area stores**.
### User
A **user** is a person who manages campaigns. There are three main roles:
* Admin
* User
* Restricted user
### API keys
API keys can be created with the **Restricted user** role.
* They can be assigned to areas, stores, or All Stores.
* They allow systems (for example, POS systems) to access and manage campaigns only within assigned areas or stores.
* They cannot access campaigns outside their assignments.
### Campaign
A **campaign** is a standard Voucherify campaign.
* It can be assigned to an area, a store, or All Stores.
* If a campaign is not assigned to any area or store, it will not be accessible to Restricted users.
### How it all works together
You can represent regions, e-commerce channels, and physical stores inside one Voucherify project.
This setup ensures that users can manage only the campaigns that belong to their region or store.
This allows:
* Area managers to supervise campaigns in a region,
* Store managers to manage campaigns only in their store.
You do not need to create multiple projects with the same configuration.
## Areas and stores: permissions
When creating custom roles, you can use these permissions:
* **Join areas and stores**: The role can be assigned to areas and stores.
* **Manage areas**: The role can create, edit, and delete areas and stores, and assign team members.
* **Read areas**: The role can assign campaigns to areas and stores.
## Role details
The following roles behave differently with areas and stores.
### Account Owner
The Account Owner is not a separate role. By default, they have the **Admin** role.
* Only the Account Owner can assign or remove the **Restricted user** role from a team member.
* Other permissions depend on the role they have in the project.
### Admin
The Admin role (or a custom role with the required permissions) can:
* Create, edit, and delete areas and stores,
* Add Restricted users to areas or stores,
* Create API keys with the Restricted user role and assign them,
* Create, edit, and delete campaigns,
* Optionally assign campaigns to areas or stores,
* View and manage all campaigns and resources.
Admins always have access to all areas and stores.
A custom role that can work like an admin for areas and stores requires the following permissions:
* Modify base Project Details,
* Manage areas,
* Read areas
* Campaign permissions
### User
The User role (or a custom role with the Read areas permission) can:
* Create, edit, and delete campaigns,
* Optionally assign campaigns to areas or stores,
* View all areas and stores,
* Manage all campaigns and resources.
Users cannot create, edit, or delete areas and stores.
### Restricted user
The Restricted user role (or a custom role with the Join areas and stores permission):
* Must be assigned to at least one area, store, or All Stores by an admin,
* Can see only campaigns within their assigned areas or stores,
* Must assign new campaigns to one of their assigned areas or stores,
* Can edit or delete a campaign **only if their assignments include all of the campaign’s assignments**,
* Can perform campaign-related actions only within their assigned areas or stores.
These rules also apply to API keys created with the Restricted user role.
If a campaign is not assigned to any area or store, it will not be accessible to Restricted users.
## Role comparison
The Admin, User, and Restricted user roles work as follows.
The default **Viewer** and **Merchant** roles can only view areas and stores. They cannot be assigned to them or manage them.
| Action | Admin | User | Restricted user |
| ----------------------------------------------------------------------------------------------------- | ----------------------- | ----------------------- | ---------------------------------------------------- |
| Create API keys with Restricted user role and assign them to an area or store | ✅ | ❌ | ❌ |
| Add Restricted users to an area or a store | ✅ | ❌ | ❌ |
| Create, edit, delete areas and stores | ✅ | ❌ | ❌ |
| View areas and stores and the assigned restricted users | ✅ | ✅ | ❌ |
| Create campaigns | ✅ (optional assignment) | ✅ (optional assignment) | ✅ (assignment required, limited to own areas/stores) |
| Edit campaigns | ✅ | ✅ | ✅ (only if full assignment overlap) |
| Delete campaigns | ✅ | ✅ | ✅ (only if full assignment overlap) |
| See all campaigns | ✅ | ✅ | ❌ (assigned only) |
| Perform qualification, validation, redemption, code publication, validation rule assignment, rollback | ✅ | ✅ | ✅ (assigned only) |
| Be assigned to an area or a store | ❌ | ❌ | ✅ |
## Restricted users: visibility and activities
Admins and Users can view and manage all resources in all areas and stores.
However, Restricted users and Restricted user API keys have access only within their assignments.
### Limited visibility resources
Restricted users can see these resources **only within assigned areas or stores**:
* Campaigns
* Vouchers
* Redemptions
* Validations
* Promotion tiers
* Combined promotions
They can perform campaign-related actions on visible campaigns, such as:
* Qualification
* Validation
* Redemption
* Code publication
* Validation rule assignment
* Rollback
### Global visibility resources
Restricted users can see and manage these resources regardless of assignment:
* Customers
* Customer segments
* Validation rules
* Orders
* Products
* Product collections
* Rewards
* Locations
* Categories
* Distributions
If a resource (for example, a Reward) is used in a campaign outside the Restricted user’s assignment, they may see the resource but will not see the related campaign details. Some views may be unavailable.
# Areas and stores access scenario
Source: https://docs.voucherify.io/orchestrate/areas-and-stores-scenario
See how area and store assignments affect campaign visibility and management for restricted users
Prerequisite: Read the **Areas and stores** guide
If you aren't familiar with the structure or assignment rules or areas and stores in general, read the [Areas and stores reference guide](/orchestrate/areas-and-stores) first.
Read this scenario to learn how areas and stores can be used in practice.
## Scenario setup
The project is set up as follows.
## Available areas and stores
In this project, there are three areas. Each area has three stores:
* **France area**: Lyon, Marseille, Paris
* **Germany area**: Berlin, Hamburg, Munich
* **Poland area**: Katowice, Kraków, Warsaw
### Restricted user assignments
The Restricted user has the following access:
* **France area only**; This does not include its individual stores.
* **All stores in Germany**; This includes Berlin, Hamburg, Munich, but *not* the Germany area entity itself.
* **Specific stores in Poland**; Katowice, Kraków, Warsaw, but *not* the Poland area and not the **All stores** option.
### Campaign assignments
There are five campaigns
* **Lyon-Coupons**: Lyon store
* **Hamburg-Munich-Coupons**: Hamburg and Munich stores
* **Germany-Area-Coupons**: Germany area only
* **France-Area-and-Lyon-Coupons**: France area and Lyon store
* **Poland-All-Stores-Coupons**: All stores in the Poland area
## What the Restricted user can do
In this scenario, **Use** means the ability to perform:
* Qualification
* Validation
* Redemption
The Restricted user can interact with campaigns as follows.
**Result: No access**
The user is assigned to the **France area**, but the campaign is assigned to the **Lyon store**.
Area access does not automatically include store access. There is no overlap between assignments.
The user cannot view, edit, or use this campaign.
**Result: Full access (View, Edit, Use)**
The user is assigned to **All Stores in Germany**, which includes Hamburg and Munich.
The user's assignments include all campaign assignments.
The user can:
* View the campaign
* Edit the campaign
* Use the campaign (qualification, validation, redemption)
**Result: No access**
The user has access to German stores, but the campaign is assigned to the **Germany area**.
Stores and area entities are separate assignment levels. There is no overlap.
The user cannot view, edit, or use this campaign.
**Result: Limited access (View and Use only)**
The campaign is assigned to:
* France area
* Lyon store
The user is assigned only to the **France area**. There is partial overlap.
The user can:
* View the campaign
* Use the campaign (qualification, validation, redemption)
However, the user cannot edit or delete it because they are not assigned to the Lyon store.
**Result: Limited access (View and Use only)**
The campaign is assigned to **All Stores in Poland**.
The user is assigned to specific stores:\
Katowice, Kraków, Warsaw.
Even if these stores match the current list, the campaign is assigned to a broader scope (All Stores).
Because the user does not have the full assignment scope, they:
* Can view the campaign
* Can use the campaign (qualification, validation, redemption)
* Cannot edit or delete the campaign
If a new store (for example, Gdynia) is added to the Poland area, the campaign will apply to it automatically. The user will still not have full overlap.
## Summary table
The scenario can be summed up as follows.
| Campaign | View | Edit | Use | Why |
| ---------------------------- | ---- | ---- | --- | ----------------------------------- |
| Lyon-Coupons | ❌ | ❌ | ❌ | No overlap (Area ≠ Store) |
| Hamburg-Munich-Coupons | ✅ | ✅ | ✅ | Full overlap |
| Germany-Area-Coupons | ❌ | ❌ | ❌ | Stores ≠ Area |
| France-Area-and-Lyon-Coupons | ✅ | ❌ | ✅ | Partial overlap |
| Poland-All-Stores-Coupons | ✅ | ❌ | ✅ | Broader campaign scope (All Stores) |
# Campaign maintenance
Source: https://docs.voucherify.io/orchestrate/campaign-maintenance
Manage, edit, and maintain campaigns after launch
Prerequisites
To maintain campaigns, you need:
* An active Voucherify project with at least one campaign
* Dashboard access with campaign management permissions
Use the campaign dashboard to manage your campaigns after launch. This guide applies to all campaign types: discount coupons, cart promotions, gift cards, loyalty programs, and referral programs.
## Access the campaign dashboard
Go to **Campaign hub** > **Campaigns** and select a campaign name to open its dashboard.
From the dashboard, you can:
* View real-time performance metrics
* Manage incentives (discount coupons, loyalty cards, referral codes, gift cards, promotion tiers)
* Edit campaign settings
* Set up distributions (for loyalty and referral campaigns)
* Export campaign codes
Managing individual codes refers to enabling, disabling, deleting, and exporting them. While loyalty cards are not always labeled as "codes" in the UI, they are managed in a similar way from the dashboard.
## Edit an active campaign
You can modify certain campaign settings after launch without affecting issued codes.
Go to **Campaign hub** > **Campaigns** and select the campaign. Click the edit button in the upper right corner to open the campaign builder.
### What you can change
You can change the following campaign settings. They may affect codes differently.
| Setting | Impact on existing codes |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Metadata | Applies to all codes if **Use the voucher's metadata schema** is selected in the campaign builder's **Metadata (optional)** step |
| Start and end dates, other time limits | Affects all codes that haven't been published or redeemed yet
Vouchers that are already published or redeemed keep their existing settings. To change their settings, update the voucher directly. |
| Validation rules | Affects all codes, even the published or redeemed ones
Changes to validation rules affect all future redemption attempts, including codes already issued to customers. |
| Category assignment | Affects all codes that haven't been published or redeemed yet |
### What you can't change
You can't change the following settings once the campaign has been created:
* Campaign name.
* Code generation settings; However, when you add vouchers to a campaign, you can define new code settings.
* Discount type in Discount campaigns.
* Conversion event, reward eligibility (referrer, referee), referee reward in Referral campaigns.
* Initial amount of gift cards in Gift card campaigns.
## Enable or disable a campaign
Depending on your needs, campaigns can be disabled, moved to bin, or removed permanently.
| I want to... | Action |
| ----------------------------------------------------------------------- | ---------------------- |
| Pause redemptions temporarily | **Disable** |
| Stop the campaign permanently and block reuse of its name and its codes | **Move to bin** |
| Remove the campaign and reuse the name/codes | **Delete permanently** |
### Disable a campaign
A disabled campaign prevents all redemptions and reward triggering. Vouchers, gift cards, referral rewards, and loyalty rewards from a disabled campaign cannot be redeemed. However, you still can assign (publish) codes from a disabled campaign to customers.
Disabling a campaign does not remove already issued vouchers, gift card balances, loyalty points, or referral relationships.
Go to **Campaign hub** > **Campaigns** and select the campaign name.
Select **Disable** to stop redemptions.
The campaign is now disabled.
### Re-enable a campaign
Enable your campaign again as follows.
Go to **Campaign hub** > **Campaigns** and select the disabled campaign.
Select **Enable** to allow redemptions again.
The campaign is now enabled again and restored to full functionality. All previously issued codes become redeemable again, subject to their individual validity settings.
### What happens when you disable a campaign
Disabled campaigns stop working. Voucherify does not return disabled campaigns, their codes, or promotion tiers during qualification (eligibility checks).
| Asset type | Effect |
| -------------- | --------------------------------------------- |
| Vouchers | Cannot be validated or redeemed |
| Promotion tier | Cannot be validated or redeemed |
| Gift cards | Cannot be validated or redeemed |
| Loyalty cards | Cannot earn or redeem points |
| Referral codes | Referrals are not tracked; rewards not issued |
## Copy or reuse a campaign
There are three ways to reuse an existing campaign configuration, depending on whether the target project is the same or a different one:
| Method | Scope | Interface | Best for |
| ----------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [Clone](#clone-a-campaign) | Same project | Dashboard | Duplicating a campaign in the current project |
| [Transfer](#transfer-campaign-between-projects) | Cross-project (same region) | Dashboard | Ad-hoc copy of a single campaign to another project |
| [Campaign templates](/build/campaign-templates) | Cross-project (same region) | Dashboard + [Management API](/api-reference/management/copy-campaign-template-to-a-project) | Reusable, versionable configurations; test-to-production migration; API-driven workflows |
Referral programs and loyalty programs cannot be cloned or saved as templates. Cross-project copy only works between projects in the same region.
## Clone a campaign
Clone an existing campaign to create a new one with similar settings in the same project. Cloning copies the whole configuration except for the campaign name. To copy a campaign to a different project, use [Transfer](#transfer-campaign-between-projects) or [campaign templates](/build/campaign-templates) instead.
Go to **Campaign hub** > **Campaigns** and select the campaign you want to clone.
Select **Clone** from the action menu.
Modify the cloned campaign settings as needed.
Once you've modified all settings, **Save** the campaign.
The cloned campaign is added to the campaign list.
Referral programs cannot be cloned.
## Transfer campaign between projects
Prerequisites: Required permissions
* Transfer permission in the source project
* Create Campaign permission in the destination project
You can transfer campaigns and tiers between projects within the same region to reuse existing configurations.
Transfer creates a copy of the selected campaign or tier configuration in the target project. During the process, you can reuse existing resources or map them to resources available in the destination project.
To transfer a campaign, open the campaign details view, click the three-dot menu, and click **Transfer**.
Resources such as validation rules and products are not copied at transfer time. They are created in the destination project during the transfer step, either by reusing existing resources or by mapping them to new ones.
For API-driven or repeatable cross-project copies (for example, promoting a configuration from a test project to production), use [campaign templates](/build/campaign-templates) together with the [Copy Campaign Template to a Project](/api-reference/management/copy-campaign-template-to-a-project) endpoint instead.
## Delete a campaign
Go to **Campaign hub** > **Campaigns** and select the campaign name.
Select the delete icon, or select the three-dot menu (⋮) > **Delete** from the campaign list.
Select a deletion method:
* **Move to bin**: Prevents reusing the same campaign name and codes in this project. You can permanently delete items from the bin later.
* **Delete permanently**: Allows you to reuse the campaign name and codes in future campaigns.
Permanent deletion cannot be undone. Select this option only if you want to reuse the same campaign name or codes.
For more information about managing deleted items, see [Bin](/prepare/bin).
## Export campaign data
Export campaign data as CSV for external analysis or reporting.
Exporting large amounts of data can take some time.
### Export vouchers or codes to CSV
Go to the campaign dashboard of a code campaign.
Click the three-dot menu (⋮) in the upper-right corner.
Select **Export** and select your export fields. You can also select metadata.
Confirm with **Export**.
Your export is scheduled. You'll receive a notification when it's finished.
### Export transactions
Go to the campaign dashboard of a gift card or loyalty program.
Open the **Transactions** tab.
Select **Export** and select your export fields.
Confirm with **Export**.
Your export is scheduled. You'll receive a notification when it's finished.
### Export points expiration
Go to the campaign dashboard of a loyalty program.
Open the **Points Expiration** tab.
Select **Export** and select your export fields.
Confirm with **Export**.
Your export is scheduled. You'll receive a notification when it's finished.
## Organize with categories
Use categories to group and filter vouchers quickly:
* Create categories when creating a campaign or in the voucher detail view.
* Manage all categories in **Campaigns** > **Stacking rules**.
* Categories have a hierarchy number. Lower numbers indicate higher importance.
* Use categories to manage how different incentives are stacked with [Stacking rules](/orchestrate/stacking-rules)
For more information, see [Manage categories](/orchestrate/manage-categories).
## Related features
Explore the following features for deeper understanding of campaign maintenance.
Track performance metrics and integrate with BI tools.
For more details, see [Performance analytics](/analyze/performance-analytics).
Set validation rules and budget caps to protect your margins.
Read [Create validation rules](/optimize/create-validation-rules) to learn how to set the rules.
Read [Validation rules](/optimize/validation-rules-reference) for a detailed description of all validation rules and other settings.
Review deleted campaigns to permanently delete them.
For more details, see [Bin management](/prepare/bin).
Save and reuse campaign configurations.
For more details, see [Campaign templates](/build/campaign-templates).
Use these endpoints to manage campaigns programmatically:
| Method | Endpoint | Description |
| -------- | ------------------------------------------------ | ---------------------------- |
| `GET` | `/v1/campaigns` | List all campaigns |
| `POST` | `/v1/campaigns` | Create a campaign |
| `GET` | `/v1/campaigns/{campaignId}` | Get campaign details |
| `PUT` | `/v1/campaigns/{campaignId}` | Update a campaign |
| `DELETE` | `/v1/campaigns/{campaignId}` | Delete a campaign |
| `POST` | `/v1/campaigns/{campaignId}/enable` | Enable a campaign |
| `POST` | `/v1/campaigns/{campaignId}/disable` | Disable a campaign |
| `GET` | `/v1/campaigns/{campaignId}/summary` | Get campaign summary |
| `POST` | `/v1/campaigns/{campaignId}/vouchers` | Add vouchers to campaign |
| `POST` | `/v1/campaigns/{campaignId}/import` | Import vouchers to campaign |
| `GET` | `/v1/campaigns/{campaignId}/transactions` | List campaign transactions |
| `POST` | `/v1/campaigns/{campaignId}/transactions/export` | Export campaign transactions |
For full API reference, see [Campaigns API](/api-reference/campaigns/campaign-object).
Set up webhooks to receive notifications when campaign events occur:
| Event | Description |
| ------------------- | ------------------------------ |
| `campaign.enabled` | Campaign was enabled |
| `campaign.disabled` | Campaign was disabled |
| `campaign.updated` | Campaign settings were changed |
| `campaign.deleted` | Campaign was deleted |
For webhook setup instructions and more campaign-related events, see [Project settings webhooks](/api-reference/project-settings-webhooks).
# Code publication
Source: https://docs.voucherify.io/orchestrate/code-publication
Learn how codes are assigned to customers in Voucherify and how publications improve control and tracking
Publication assigns a unique code (discount coupon, gift card, referral code, or loyalty card) to a specific customer. Once a code is published, it becomes linked to that customer’s profile in Voucherify.
Publication is the process that gives the right incentive to the right customer at the right time.
## Core functions of publication
Publications are required for some campaign types and optional for others. In all cases, they help you control who can use a code and how it is tracked.
### Required publications
Code publication is required for:
* **Referral programs**: A publication is required so the system can identify the code owner and correctly count referred customers.
* **Loyalty programs**: A loyalty card must be published to a customer before they can collect or spend points.
### Optional publications
Code publication is optional for **discount coupons** and **gift cards**, especially for generic codes. However, publication helps prevent misuse and it can be used to limit redemptions to intended users.
## Publication methods
You can use several ways to publish codes to customers. It doesn't matter which method you use, you can publish a unique code to only one customer.
* **Manual assignment**: You can publish a code from the detailed voucher view in the Dashboard by assigning it to a specific customer. A short publication builder will walk you through the process, where you can add publication source ID, select the customer, and add customer and publication metadata.
* **Automatic distributions**: Using the [Distribution manager](/integrations/distributions-overview), you can send and publish codes at the same time through channels like email, SMS, or integrations such as [Braze](/integrations/braze).
* **Web widgets**: Codes can be published automatically when a customer completes an action on a landing page or signup form.
Developer setup: Publication API
You can also use an API integration and the [POST Create publication](/api-reference/publications/create-publication) endpoint. This way, your system can publish codes programmatically.
## Publication source ID
The **source ID** is an optional identifier used to track a publication.
When you publish a code using the API or through the dashboard and provide a source ID, calling the same publication again with that source ID will always return the same code that was assigned the first time. This makes publication requests safe to retry and helps prevent assigning multiple codes to one customer by mistake.
## Related features
Code publication can be used together with the following features to further optimize and orchestrate your incentive activities.
While creating a campaign, you can check **Customers can join campaign only once**.
This will limit voucher use in the campaign so each customer can have only one code published (assigned) to them.
You can use the **Redemption only by code holder** rule to restrict voucher redemptions. Only the customer who received the published code can redeem it.
Add this rule while creating [validation rules](/optimize/create-validation-rules).
[Distributions](/integrations/distributions-overview) are a common way to publish codes automatically. You can distribute new vouchers in response to a trigger, like customer entered a VIP segment or earned a new loyalty tier.
This way you can orchestrate various incentive actions and additionally optimize how you reach your audience.
Auto-increase voucher count
While creating a campaign, select **Auto-increase voucher count** to publish more vouchers through distribution or the POST Create publication endpoint when the initial batch runs out. This way new customers who join the campaign will receive vouchers.
You can also use these methods to go beyond the limit of 100,000 codes per campaign.
While building a campaign with [time limits](/optimize/time-limits#valid-for-a-specific-amount-of-time-after-publishing), use **Keep valid for a specific amount of time after publishing** to define how long a code stays valid starting from the moment it is published.
Urgency
The **Keep valid for a specific amount of time after publishing** setting is useful to create a sense of urgency for customers.
For example, you can set the code to expire in 48 hours after it is published to a customer through distribution that notifies them about the voucher. As a result, the customer may feel the urgency to use it, not to lose it.
You can find all the assigned vouchers to a customer by going to **Engagement** > **Customers** and selecting the customer. All published vouchers are added to their **Wallet**.
# Geofencing
Source: https://docs.voucherify.io/orchestrate/geofencing
Create location-based campaigns by checking customer, product, or SKU coordinates against locations you define
Enterprise feature
Geofencing is available only for Enterprise clients. Contact your technical account manager or [Voucherify support](https://www.voucherify.io/contact-support) to enable it.
Use geofencing to create location-specific campaigns by controlling who can redeem and which products are eligible, based on customer, product, or SKU location.
You can:
* Limit redemptions to customers in specific locations
* Discount or exclude products based on their location
* Exclude particular areas from applying discounts
Geofencing works with all campaign types: discount coupons, cart promotions, loyalty programs, gift cards, and referral programs.
## What geofencing does and doesn't do
Geofencing doesn't track location automatically.
Voucherify checks locations only when coordinates are sent in the API request (for example, during voucher redemption).
You have to:
* Create location boundaries in the dashboard
* Store coordinates in metadata (customer, product, or SKU)
* Send the current coordinates in the request
If no location is sent, geofencing rules are skipped.
## How geofencing works
Geofencing works by comparing coordinates you send with locations you define.
It uses three elements:
* Location objects: areas you draw on a map (circles or polygons)
* Geopoint metadata: latitude and longitude saved on customers, products, or SKUs
* Segments or collections: groups created by checking whether coordinates fall inside a location
When a customer redeems a voucher, Voucherify checks whether the coordinates sent in metadata are inside the allowed location boundaries used in validation rules.
## Choose what you want to control
You can use geofencing in two independent ways:
* Customer location: controls who can redeem.
* Product or SKU location: controls which items are discounted, required, or excluded.
You can use one or both in the same campaign.
## Manage locations
Go to **Campaign hub** > **Locations** in the dashboard to create and manage location objects.
### Create a location
Create a new location as follows.
Select **Create location** in the top-right corner.
Use the map or search bar to navigate to the area where you want to create a location.
Draw the location boundaries using one of two options:
* **Circle**: Set a center point and radius.
* **Polygon**: Draw a custom shape by placing points on the map.
Use the map editor controls to manage your boundaries:
| Control | Description |
| ----------------- | ------------------------------------------------------------ |
| Re-center | Brings the selected location back into focus on the map |
| Draw polygon | Draws a custom polygon boundary by placing points on the map |
| Draw circle | Draws a circular boundary using a center point and radius |
| Edit boundaries | Enables edit mode to adjust existing boundaries |
| Delete boundaries | Removes selected boundaries from the location |
| Zoom in / out | Zooms the map in or out |
Enter a **Location name** and save.
A new location is added to the location list.
### Location manager options
When managing an already created location, you can use the tricolon ⁝ to display the following options:
| Option | Description |
| ---------- | ------------------------------------------------------------------------------- |
| Show usage | Shows which resources use the location (product collections, customer segments) |
| Edit | Modify the location name or boundaries |
| Duplicate | Create a copy of the location |
| Delete | Remove the location |
## Geofencing with customer location
Customer geofencing limits who is allowed to redeem a campaign.
Create a location that defines where customers are allowed to redeem.
Go to **Project settings** > **Metadata schema** > **Customer** and create a new metadata definition:
* **Type**: Geopoint
* **Name**: for example `customer_location`
This metadata stores coordinates in `geo:latitude,longitude` format.
Create a segment as follows:
1. Go to **Customers** > **Find and apply filters**.
2. Select **Custom attributes (metadata)**.
3. Choose the geopoint metadata property.
4. Select a **Location object** as the filter value.
5. Confirm and select **Apply**.
The segment updates automatically when customer locations change.
Add a validation rule as follows:
1. Create or edit a campaign.
2. In the validation rule builder, add a condition based on **Customer segment**.
3. Select the location-based segment.
4. Save the rule.
Only customers from that segment, which means those inside the defined location, can redeem the campaign.
When redeeming a voucher, send the customer's current location:
```json highlight={5} theme={null}
{
"customer": {
"source_id": "customer_123",
"metadata": {
"customer_location": "geo:40.7128,-74.0060"
}
}
}
```
## Geofencing with product or SKU location
Product and SKU geofencing controls which items are eligible for discounts or required in the cart.
Product and SKU geofencing works the same way:
* Use **Product metadata** if the location applies to the whole product.
* Use **SKU metadata** if different SKUs have different locations.
Create a location that defines allowed product or SKU locations.
Create metadata schema as follows:
1. Go to **Project settings** > **Metadata schema**.
2. Select **Product** or **SKU**.
3. Create a metadata definition:
* **Type**: Geopoint
* **Name**: for example `product_location`
Create a new collection as follows
1. Go to **Products** > **Find and apply filters**.
2. Select **Custom attributes (metadata)**.
3. Choose the geopoint metadata property.
4. Select a **Location** object.
5. Confirm and select **Apply**.
6. Select **Create dynamic collection** and save it.
You can use location-based collections to:
* Discount or exclude products from specific locations.
* Require products from a specific location to be in the cart.
In the validation rule builder, expand **Products structure validation rules** and choose how order items should match the collection:
* **Any**: at least one item must be from this location *(most common)*
* **Every**: all items must be from this location
* **None**: no items can be in this location
If you choose **Any** or **Every**, you can also define:
* Minimum quantity of matching items
* Minimum subtotal of matching items
Send product or SKU coordinates in the order items:
```json lines highlight={8} theme={null}
{
"order": {
"items": [
{
"product_id": "prod_123",
"quantity": 1,
"metadata": {
"product_location": "geo:37.786971,-122.399677"
}
}
]
}
}
```
If the `product_location` metadata is missing or empty, the product or SKU will not match any location-based collection.
Voucherify validates whether item coordinates match the collection filters.
## Troubleshooting
If geofencing doesn't work, check the following:
* A geopoint metadata field exists (customer, product, or SKU)
* Coordinates are sent in the request using geo:latitude,longitude
* The coordinates are inside the location boundaries
* The correct segment or collection is used in validation rules
* Validation rules are enabled in the campaign
## Related features
Geofencing connects customer data, product data, and campaign rules. Use the resources below to set up the required elements and integrate geofencing into your workflows.
Apart from using customer segments to group customers by location, you can create even more complex scenarios. Create a segment based on geopoint metadata and a location object and other customer attributes, then use them together in validation rules to control who can redeem.
Read the [Customer segments](/prepare/customer-segments) guide to learn more.
Apart from using product collections to group products or SKUs by location, you can create even more complex scenarios. Create a dynamic collection based on geopoint metadata and a location object and other product or SKU attributes, then use them together in validation rules to control which items are eligible.
Read the [Product collections](/prepare/product-collections) guide to learn more.
Apart from using validation rules to apply location-based segments and collections to your campaigns, you can create even more complex scenarios. You can require customers from a specific segment, check whether order items belong to a location-based collection, and limit to a specific cart structure and safeguard your campaign budget with other conditions.
Read the [Create validation rules](/optimize/create-validation-rules) guide to learn more.
Geofencing uses geopoint metadata to store and send coordinates. You need to define geopoint metadata fields on customers, products, or SKUs before using geofencing.
Read the [Metadata](/prepare/metadata) guide to learn more.
Developers need to send location coordinates in API requests for geofencing to work. The key integration points are:
* **Validations**: Check eligibility before redemption using the [Validate Stacked Discounts](/api-reference/validations/validate-stackable-discounts) endpoint with location metadata included.
* **Redemptions**: Send customer or product geopoint metadata in the [Redeem Stacked Discounts](/api-reference/redemptions/redeem-stackable-discounts) request body to trigger location-based validation.
* **Customers**: Manage customer profiles and metadata using the [Customers API](/api-reference/customers/customer-object).
* **Metadata schemas**: List metadata schemas for geopoint metadata fields using the [Metadata Schemas API](/api-reference/metadata-schemas/metadata-schema-object).
* **Locations**: View location objects using the [Location Object](/api-reference/locations/location-object) reference.
* **Segments**: Manage location-based segments using the [Segments API](/api-reference/segments/segment-object).
* **Product collections**: Manage location-based collections using the [Product Collections API](/api-reference/product-collections/product-collection-object).
# Manage areas and stores
Source: https://docs.voucherify.io/orchestrate/manage-areas-and-stores
Configure areas, stores, restricted users, and API keys to manage your regional promotional structure
Before you begin, read the [Areas and stores reference guide](/orchestrate/areas-and-stores), which explains the structure, roles, and visibility rules.
This guide focuses only on configuration.
Managing areas and stores covers:
* Creating and managing areas and stores.
* Assigning Restricted users and API keys to specific areas, stores, and all stores.
* Assigning campaigns to specific areas, stores, and all stores.
## Create and manage areas and stores
Only an **Admin** can create, edit, or delete areas and stores.
You can create up to **100 areas per project** and **100 stores per area**.
### Create an area
Go to **Home** > **Project Settings** > **Areas & Stores**.
Click **Add area**.
Enter the area name.
Click **Save**.
The area is added to the list of areas.
### Create a store
Open the **Areas and stores** tab and select an existing area.
Click **Add area store**.
Enter the store name.
Click **Create**.
The store is added to the list of stores in the area.
In the area details view, you can:
* Edit the area name
* Add or edit stores
* Delete stores (if they have no campaigns assigned)
* Delete the area (only if it has no stores)
## Assign restricted users
Access configuration happens in two stages:
1. Assign the **User restricted** role.
2. Define the user's area or store scope.
### Assign the Restricted user role
Only the **Account owner** can assign or remove this role.
Go to **Team settings** > **Team**.
Choose the team member.
Assign the **User restricted** role for the project.
The member has the **Restricted user** role in a given project.
### Define area or store access
Only an **Admin** can define assignments.
A Restricted user can have up to **100 assignments**.
Go to **Project settings** > **General** > **Project members**.
Click **Edit assignments** next to the member with the `USER_RESTRICTED` role.
Click **Edit access list**.
Select specific areas, stores, or all stores.
Click **Save**.
The member is assigned to a given area, store, or all stores.
Assigning a member to an area does not assign them to that area's stores.
Use **All stores** if they need access to every store within that area.
## Create restricted API keys
Only Admins can create API keys with the **User Restricted** role.
These keys follow the same visibility rules as a Restricted user.
A Restricted user API key can also have up to **100 assignments**.
Go to **Project settings** > **General** > **Application keys**.
Click the **+** button.
Enter a name and select the **User restricted** role.
Click **Edit access list** and select areas, stores, or all stores.
The **Secret key** is hidden immediately after it's generated or regenerated.
Store it securely.
## Assign campaigns to areas or stores
Campaign assignment controls where a campaign is visible and usable.
Admins and Users can assign campaigns. Restricted users must assign new campaigns to their own areas or stores.
A campaign can have up to **100 assignments**.
Open a campaign creation builder and create a new campaign or edit an existing one. Go to the **Access settings** step.
Click **Edit access list**.
Select the areas or stores where the campaign should be available.
Save the campaign.
Global campaigns
To make a campaign available everywhere:
* Select all areas.
* Within each area, select **All stores**.
If a campaign has no assignment, Restricted users cannot access it.
If assigned to **All stores**, it automatically applies to stores created later in that area.
## Manage resources as a Restricted user
Access depends on the role:
* **Admins** and **Users** can manage all resources in all areas and stores.
* **Restricted users** can manage resources only within their assigned areas or stores.
### Resources managed within assigned areas or stores
Restricted users can manage, like edit or delete, the following resources or perform actions within the area or store to which they are assigned:
* Campaigns
* Vouchers
* Redemptions
* Validations
* Publications
* Qualifications
* Promotion tiers
* Combined promotions
### Resources managed regardless of assignment
Restricted users can perform activities, like creating, editing, or deleting, on the following resources regardless of the area or store to which they are assigned:
* Customers
* Validation Rules
* Orders
* Products
* Product collections
* Rewards
* Locations
* Categories
* Distributions
A Restricted user can edit or delete a campaign only if their assignments include **all** of the campaign’s assignments.
You can further limit Restricted user permissions by creating a custom role with the **Join areas and stores** permission.
## Related features
Areas and stores connect to other parts of Voucherify. The features below show how they work together.
The documentation of these endpoints is still in progress.
You can manage areas and stores programmatically using the Management API (Enterprise feature). This includes creating, updating, and deleting areas and stores, as well as listing all areas and stores in a project.
**Area endpoints:**
* `GET /management/v1/projects/{projectId}/areas`: List all areas
* `GET /management/v1/projects/{projectId}/areas/{id}`: Get area details
* `POST /management/v1/projects/{projectId}/areas`: Create an area
* `PUT /management/v1/projects/{projectId}/areas/{id}`: Update an area
* `DELETE /management/v1/projects/{projectId}/areas/{id}`: Delete an area
**Store endpoints:**
* `GET /management/v1/projects/{projectId}/areas/{areaId}/stores`: List all stores in an area
* `GET /management/v1/projects/{projectId}/areas/{areaId}/stores/{storeId}`: Get store details
* `POST /management/v1/projects/{projectId}/areas/{areaId}/stores`: Create a store
* `PUT /management/v1/projects/{projectId}/areas/{areaId}/stores/{storeId}`: Update a store
* `DELETE /management/v1/projects/{projectId}/areas/{areaId}/stores/{storeId}`: Delete a store
# Manage categories
Source: https://docs.voucherify.io/orchestrate/manage-categories
Learn how to create and manage categories
Required permissions
Users with the **User** role can view **Stacking rules** and **Categories**, edit category name and hierarchy, as well as assign campaigns to categories.
However, only Admins and custom roles with **Access Project settings** and **Modify base Project Details** can modify stacking settings in **Categories** and **Stacking settings**.
Categories help you organize campaigns in the **Stacking rules** view. This way, you can mix and match your incentives, like discount coupons, cart promotions, and others, and set up rules to limit conflicting behavior.
You can create categories, assign campaigns to them, and configure how campaigns behave when incentive stacking applies in validation and redemption.
Stacking rules and categories
Some of the settings in categories are affected by stacking settings.
Read [Stacking rules](/orchestrate/stacking-rules) to learn more about particular settings.
## Create a category
You can create a category from the **Stacking rules** view by clicking **Create category**.
In **Name category**, enter a name for the category.
In **Hierarchy**, enter a number.
The hierarchy number helps define category priority when campaigns are applied together. A lower number means higher priority. For example, a category with hierarchy **1** is treated as more important than a category with hierarchy **2**.
The hierarchy number is displayed next to the category name in the **Stacking rules** view.
Categories are applied according to hierarchy only if **Hierarchy priority** is selected in **Incentive application order** in **Stacking settings**.
**Stacking eligibility** defines how campaigns assigned to this category behave when they are validated together in the same redemption.
This setting controls how campaigns from this category interact with campaigns from other categories.
Choose one option:
* **Common**: Incentives from these campaigns follow the application order. They:
* Stack with other **Common** campaigns.
* Stack with **Always stackable** campaigns.
* Do not stack with **Never stackable** campaigns.
It's best to use **Common** in your usual use cases. If you want your incentives to combine with other incentives without any additional exceptions, use this option.
* **Never stackable**: Incentives from campaigns in this category block **Common** campaigns in the same redemption stack. They:
* Do not stack with **Common** campaigns.
* Stack with **Always stackable** campaigns.
* Stack with other **Never stackable** campaigns.
**Never stackable** campaigns can be applied together only if the global limits in stacking settings allow it.
This option is typically used for exclusive campaigns that you don't want to combine with other incentives. For example, you want to apply a big discount on a product as a special offer, but you don't want to combine it with other discounts to protect your budget.
* **Always stackable**: Campaigns in this category always join the redemption stack if they are valid. They:
* Stack with **Common** campaigns.
* Stack with **Never stackable** campaigns.
* Stack with other **Always stackable** campaigns.
It's best to use **Always stackable** in specific cases, like the incentive should be applied regardless of other applied incentive types. **Always stackable** is useful for incentives that should not be blocked by exclusivity, like small giveaways or other low-value promotions.
In **No effect**, choose how the system handles a campaign that has no calculated effect:
* **Default**: Uses the global **No effect** setting.
* **Prevent redemption**: The campaign is redeemed only if an effect was calculated.
* **Force redemption**: The campaign is redeemed even if it has no effect.
In **Discount calculations**, choose how discounts are calculated:
* **Default**: Uses the global discount calculation setting.
* **Initial**: Calculates the discount from the original order value.
* **Discounted**: Calculates the discount from the current order value after previous discounts are applied.
In **Stacking limit**, enter the maximum number of campaigns from this category that can be applied in one redemption.
The maximum value is controlled by the global setting **Maximum number of valid incentives to apply in a request** defined in **Stacking settings**.
The stacking limit can be set to the same number as the global setting or to any lower number. It cannot exceed the global setting.
The global maximum value is 30.
Check if the data is correct and **Save** to add the new category.
The new category is added to the **Stacking rules** view.
When creating a campaign, you can also create a category in the first step of campaign configuration. This is helpful when you need to quickly add a new category for a specific campaign.
However, you can provide there only its name and hierarchy.
## Assign campaigns to a category
Campaigns are shown in columns, including **No category** and category columns.
To find specific campaigns or categories faster, use the search bar above the category list.
To assign a campaign:
1. Locate the campaign in the list.
2. Drag it into another category column.
3. Drop it to confirm the assignment.
The campaign is now assigned to the selected category.
## Edit or delete a category
Each category has a three-dot menu next to its name.
Use this menu to manage the category:
* **Edit**: Update the category settings.
* **Delete**: Remove the category.
## Compatibility guide
Open **Compatibility guide** in the **Stacking rules** view to check how categories interact.
The guide lists category pairs and shows if and how they stack together.
Use this view when you want to confirm how categories combine before assigning campaigns.
# Orchestrate overview
Source: https://docs.voucherify.io/orchestrate/orchestrate-overview
Manage campaigns after launch with code publication, stacking rules, areas and stores, and geofencing
After you build and optimize campaigns, use the Orchestrate section to manage how they run in practice. Publish codes to customers, maintain active campaigns, control how incentives stack, and target specific regions or stores.
## What you can orchestrate
Assign unique codes to customers. Control who receives discount coupons, gift cards, referral codes, and loyalty cards.
Edit, disable, clone, and delete campaigns after launch. Export campaign data for reporting.
Define how multiple incentives behave in a single redemption. Set application order, limits, and compatibility between campaigns.
Create region- and store-level campaign access. Let local managers run campaigns independently within one project.
Limit redemptions and product eligibility based on customer or product location. Draw boundaries on a map and validate coordinates at redemption time.
## Why orchestration matters
Building and optimizing campaigns is only part of the process. Orchestration covers the operational side: getting incentives to the right customers, maintaining campaigns as they run, and controlling how multiple promotions interact.
Effective orchestration enables:
* **Controlled distribution**: Publish codes to specific customers so the right person gets the right incentive at the right time.
* **Ongoing management**: Edit active campaigns, pause them when needed, and export data for analysis.
* **Stacking control**: Prevent conflicting discounts and define exactly how incentives combine in a single transaction.
* **Regional targeting**: Run location-specific campaigns without creating separate projects for each market.
## How orchestration connects to other sections
Orchestration works with the data and campaigns you set up in earlier sections:
* **Prepare** provides the customers, products, and metadata that orchestration features rely on. For example, geofencing uses geopoint metadata and customer segments.
* **Build** creates the campaigns that you then publish, maintain, and stack using orchestration tools.
* **Optimize** defines the validation rules and time limits that work alongside stacking rules and code publication to control redemption behavior.
Start with [code publication](/orchestrate/code-publication) to learn how codes reach customers, then explore [campaign maintenance](/orchestrate/campaign-maintenance) to manage your active campaigns.
## What's next?
Start with [code publication](/orchestrate/code-publication) if you need to assign codes to customers. Use [campaign maintenance](/orchestrate/campaign-maintenance) to manage live campaigns. Explore [stacking rules](/orchestrate/stacking-rules) and [categories](/orchestrate/manage-categories) to control how incentives interact, or set up [areas and stores](/orchestrate/areas-and-stores) for regional campaign management.
# Promotion tier maintenance
Source: https://docs.voucherify.io/orchestrate/promotion-tier-maintenance
Manage, reuse, activate, and transfer promotion tiers
Prerequisites
To maintain promotion tiers, you need:
* An active promotion campaign with at least one promotion tier
* Dashboard access with campaign management permissions
Use this guide to manage promotion tiers after creation. You can review tier configuration, update settings, temporarily disable tiers, and reuse tier setups in other campaigns or projects.
## Access promotion tiers
You can access promotion tiers in two ways:
* From the global **Promotion tiers** tab in **Campaign hub** > **Campaigns**
* From the **Tiers** tab inside a promotion campaign
Use these views to:
* Review tier configuration
* Edit promotion tiers
* Enable or disable tiers
* Transfer tiers to another project
* Create templates from tiers
* Delete promotion tiers
## Edit promotion tier
You can update selected promotion tier settings after creation.
Depending on the tier configuration, you can update:
* Metadata
* Banner messages
* Validation rules
* Time limits
* Discount configuration
Changes affect future qualification, validation, and redemption attempts.
## Enable or disable a promotion tier
Enable or disable promotion tiers to control when customers can qualify for them.
Open the promotion tier details view, then:
* Select **Disable** to stop validations and redemptions for the tier.
* Select **Enable** to make the tier available again.
Disabled promotion tiers are not returned during qualification checks and cannot be redeemed.
## Reuse promotion tier configuration
Voucherify provides two ways to reuse promotion tier settings in other campaigns and projects.
### Create template from tier
To create a template from a tier, open the promotion tier details view and click **Create template**.
Templates work best for reusable promotion setups that you plan to use across multiple campaigns or projects.
You can use templates to:
* Create new promotion tiers with the same configuration
* Create new discount campaigns faster
* Copy templates between projects
* Standardize promotion setup across teams
### Transfer promotion tier
Use **Transfer** when you want to copy a tier without creating a template first. You can also transfer tiers between projects within the same region.
Transfer lets you:
* Create a new promotion campaign with a new tier based on the selected configuration
* Create a new tier in an existing promotion campaign
To transfer a tier, open the three-dot menu (⋮) next to the tier and select **Transfer**.
Templates and Transfer work only within the same region. To use the configuration in another region, first copy the template to a project in the target region.
## Delete promotion tier
Delete promotion tiers that are no longer needed.
Go to the **Promotion tiers** tab and open the three-dot menu (⋮) next to the tier. Click **Delete** to remove the tier from the campaign.
Deleted tiers are removed permanently from Voucherify and they are no longer returned during qualification checks and cannot be redeemed.
## Related features
Explore the following features for deeper understanding of promotion tier maintenance.
Save and reuse promotion tier configurations.
For more details, see [Campaign templates](/build/campaign-templates).
Use categories and stacking rules to control how promotion tiers are combined during validation and redemption.
For more details, see [Stacking rules](/orchestrate/stacking-rules).
Learn how to create and configure promotion campaigns with promotion tiers.
For more details, see [Create cart promotions](/build/create-discount-promotions).
# Stacking rules
Source: https://docs.voucherify.io/orchestrate/stacking-rules
Control how multiple incentives behave in a single request
Required permissions
Users with the **User** role can view **Stacking rules** and **Categories**, edit category name and hierarchy, as well as assign campaigns to categories.
However, only Admins and custom roles with **Access Project settings** and **Modify base Project Details** can modify stacking settings in **Categories** and **Stacking settings**.
Stacking rules define how multiple incentives are processed together in one validation or redemption request.
They help you control:
* What happens when one incentive is invalid
* The order in which incentives are applied
* How percentage discounts are calculated
* How incentives interact on the same product
* What happens during rollback
* What happens when an incentive has no effect
* How many incentives can be applied at once
To set stacking rules, go to **Campaign hub** > **Stacking rules** and select **Stacking settings**.
Stacking rules and categories
Some stacking settings depend on the configuration of **Categories** and campaign assignment to them.
Read [Manage categories](/orchestrate/manage-categories) to learn more about configuring categories.
## Application and sorting
These settings define how incentives are ordered, validated, and redeemed.
### Redemption stack validation policy
This setting defines what happens if one incentive in a request fails validation:
* **All**: If one incentive is invalid, the whole request fails. No incentives are applied.
* **Partial**: Invalid incentives are skipped. Valid incentives are applied.
### Incentive application order
This setting defines the order in which incentives are applied:
* **Requested order**: Incentives are applied in the same order as they appear in the API request.
* **Hierarchy priority**: Incentives are applied based on category hierarchy. A lower hierarchy number means higher priority. If two incentives have the same hierarchy, the request order is used. The default hierarchy number is 1, while the lowest hierarchy number is 0.
### Always stackable and Never stackable category application order
This setting defines how incentives from Always stackable and Never stackable categories are ordered:
* **Apply Always stackable categories last**: Never stackable incentives are applied first. Always stackable incentives are applied afterward. In effect, this setting ignores the hierarchies of the Always stackable and Never stackable categories when incentives from these categories are used together.
* **Apply sorting rule to combined Always stackable and Never stackable categories**: All incentives are grouped together. The selected **Incentive application order** defines their application order.
### Discount calculation mode
This setting defines how percentage discounts are calculated when multiple incentives are applied:
* **Based on discounted amount**: Each discount is calculated after previous discounts are applied.
* **Based on initial amount**: Each discount is calculated from the original price.
## Discount behavior
These settings define how incentives behave on products and during rollback.
### Product stack policy
This setting defines if multiple incentives can affect the same product:
* **Multiple application**: More than one incentive can affect the same product.
* **Single application**: Only one incentive can affect the same product. The incentive is applied according to the **Incentive application order**.
### Redemption rollback policy
This setting defines what happens when a redemption is rolled back:
* **Revert**: Applied discounts are removed. The order status changes to **Canceled**.
* **Keep**: Applied discounts remain, preserving the order history. The order status does not change.
**Keep** is a good setting for handling refunds, as you have detailed data regarding applied discounts and other incentive use.
### No effect
This setting defines what happens when an incentive produces no effect:
* **Force redemption**: The incentive is marked as redeemed even if it produces no effect.
* **Prevent redemption**: The incentive is redeemed only when it produces an effect.
No effect usually occurs if a discount coupon is used together with a cart promotion and one of them results in applying a 0 discount.
No effect may also happen when a loyalty card is used to pay with points, but in combination with other discounts it doesn't take effect and no points are used.
## Global limits
These settings define how many incentives can be processed in one request.
### Maximum number of incentives in a request
Defines how many incentives can be sent in one API request. Maximum value: 30.
### Maximum number of valid incentives to apply in a request
Defines how many valid incentives can be applied. Maximum value: 30.
### Maximum number of valid incentives per category to apply in a request
This setting is optional and defines how many incentives from the same category can be applied. Maximum value: 30.
### Maximum number of valid Never stackable incentives to apply in a request
Defines how many Never stackable incentives can be applied at the same time. Maximum value: 5.
### Maximum number of valid Never stackable incentives per category to apply in a request
This setting is optional and defines how many Never stackable incentives from the same category can be applied. Maximum value: 5.
# Stacking rules and categories overview
Source: https://docs.voucherify.io/orchestrate/stacking-rules-overview
Control how multiple incentives interact in a single redemption with stacking rules and categories
When customers use more than one incentive in a single order, stacking rules and categories control how they interact. They define application order, compatibility between campaigns, discount calculation, and limits on how many incentives can apply.
## What you can configure
Use stacking rules and categories to define how campaigns behave when combined.
Create categories, set hierarchy, and define how campaigns behave when combined. Assign campaigns to categories to control stacking.
Configure global settings such as application order, validation policy, discount calculation, and limits.
See practical scenarios that show how stacking rules and categories work together.
## Key concepts
These concepts help you understand how stacking rules and categories work together.
* **Categories**: group campaigns and define how they interact when used together.
* **Stacking rules**: define default behavior for validation and redemption requests.
* **Hierarchy**: defines priority between categories when **Hierarchy priority** is used. A lower number means higher priority.
## Category stacking eligibility
Each category has a stacking eligibility that defines how it interacts with other categories.
* **Common**: follows standard rules. Stacks with **Common** and **Always stackable**, but not with **Never stackable**.
* **Never stackable**: blocks **Common** categories in the same redemption. Still stacks with **Always stackable** and other **Never stackable** categories.
* **Always stackable**: always joins the redemption stack if valid. Stacks with all categories, including **Never stackable**.
## How categories interact
The table below shows how different category types behave when combined.
| Category A | Category B | Result |
| ---------------- | ---------------- | -------------- |
| Common | Common | Stack together |
| Common | Never stackable | Do not stack |
| Common | Always stackable | Stack together |
| Never stackable | Never stackable | Stack together |
| Never stackable | Always stackable | Stack together |
| Always stackable | Always stackable | Stack together |
Use the **Compatibility guide** in the **Stacking rules** view to preview how categories interact before assigning campaigns.
## Why stacking rules matter
Stacking rules help you control how incentives combine and prevent unexpected results.
You can use stacking rules to:
* **Prevent over-discounting**: limit how many incentives apply in one request.
* **Protect exclusive offers**: use **Never stackable** categories to block **Common** campaigns.
* **Ensure required incentives apply**: use **Always stackable** for campaigns that should always be included.
* **Control discount order**: choose between request order and hierarchy priority.
* **Handle edge cases**: define behavior for failed validation, rollback, or no-effect incentives.
## What's next?
To start using stacking rules, first create categories and then configure global settings.
Start with [Manage categories](/orchestrate/manage-categories) to create your category structure. Then configure [Stacking rules](/orchestrate/stacking-rules) to define global behavior. See [Using stacking rules and categories](/orchestrate/using-stacking-rules-and-categories) for real-world examples.
# Using stacking rules and categories
Source: https://docs.voucherify.io/orchestrate/using-stacking-rules-and-categories
Business scenarios that show what you can configure with stacking rules and categories
Prerequisite: Stacking rules and Categories
Read [Stacking rules](/orchestrate/stacking-rules) and [Manage categories](/orchestrate/manage-categories) before reading this page.
Stacking rules and categories help you control how incentives behave when more than one campaign is applied in the same order.
Read the following scenarios to learn what you can achieve with these settings.
## Change incentive eligibility with incentive application order
The **Stacking settings** are set as follows:
* **Incentive application order** is set to **Requested order**, which means incentives are applied in the same sequence as they are sent in the API request.
* **Discount calculation mode** is set to **Based on discounted amount**, so each discount is calculated from the previous discount, not the original order value.
A store runs two campaigns:
* Campaign 1: 10% off everything
* Campaign 2: 20% off orders with total amount above \$100
A customer adds products worth \$105 to the cart.
In Scenario A, the 10% discount is sent first. In Scenario B, the 20% discount is sent first.
### Scenario A: 10% applies first
The incentives are applied as follows:
1. 10% discount is applied.\
\$105 → \$94.50
2. The order total is now below \$100.
3. The 20% campaign no longer meets its validation condition to exceed \$100 order value.
As a result, only the 10% discount applies.
### Scenario B: 20% applies first
The incentives are applied as follows:
1. 20% discount is applied.\
\$105 → \$84
2. The 10% discount is then calculated.
\$84 → \$75.6
In this scenario, the customer receives a larger total discount.
Request order and hierarchy
Category hierarchy affects the order of discounts only when **Incentive application order** is set to use **Hierarchy priority** in **Stacking settings**.
In this use case, you can achieve similar results with **Hierarchy priority** if the two campaigns have different hierarchies:
* In Scenario A, Campaign 1 has lower hierarchy (higher priority) than Campaign 2
* In Scenario B, Campaign 2 has lower hierarchy (higher priority) than Campaign 1
## Partial and all-or-nothing behavior
This scenario shows differences between **All** and **Partial** settings in **Redemption stack validation policy**.
A customer tries to apply incentives from two campaigns:
* Incentive A: Valid welcome campaign incentive
* Incentive B: Expired incentive from a seasonal campaign
### Scenario A: All
The process goes as follows:
1. Voucherify validates both incentives.
2. Incentive A is validated successfully, while Incentive B is inapplicable.
3. The entire validation fails.
The customer receives no discount.
In this mode, even valid incentives are not applied if any other incentive in the stack fails validation.
### Scenario B: Partial
The process goes as follows:
1. Voucherify validates both incentives.
2. Incentive A is validated successfully, while Incentive B is inapplicable.
3. The validation is successful, Incentive A applies.
The customer receives the available discount.
This setup prevents a single invalid incentive from blocking checkout.
## Exclusive incentive with Never stackable category
**Never stackable** categories prevent other **Common** categories from being applied in one stack.
A store runs two campaigns:
* 50% VIP campaign with a category set to **Stacking eligibility: Never stackable**
* 10% newsletter campaign with a category set to **Stacking eligibility: Common**
The **Never stackable** campaign blocks **Common** campaigns from application in the same stack:
1. Both campaigns are valid.
2. The VIP campaign applies.
3. The newsletter campaign does not apply.
This is useful for high-value or limited offers that you don't want to combine with other incentives.
In this case, hierarchy and application order do not matter. If the 50% VIP incentive has lower hierarchy (for **Hierarchy priority**) or it's sent second (for **Requested order**) in the API request and hierarchy/order would affect discount calculation, the **Never stackable** category ignores settings set for the **Common** category.
However, if you combine several incentives belonging to different categories with **Never stackable**, **Incentive application order** applies.
## Combining Never stackable and Always stackable
**Always stackable** categories are always applied in a stack, even those with **Never stackable** categories.
A store runs two campaigns:
* An exclusive incentive that's set to a **Never stackable** category.
* A campaign that should always apply if valid, so it's set to **Stacking eligibility: Always stackable**.
The incentives from the campaigns are applied as follows:
1. The exclusive incentive is validated successfully.
2. The incentive from the **Always stackable** campaign is also validated successfully.
3. Both incentives apply together.
Incentives with an **Always stackable** category apply in the redemption stack even when a **Never stackable** incentive is also used.
**Always stackable** is useful for incentives that should not be blocked by exclusivity, like small giveaways or other low-value promotions.
In the **Stacking rules** view, use **Compatibility guide** to see which category combinations apply together.
## Category stacking limit
The category stacking limit adds an additional limit on how many incentives from a given category can be stacked.
A store runs three flash sale campaigns in one category, which has the category stacking limit set to 2.
A customer wants to use incentives from each of those campaigns and they're all valid.
Voucherify checks the incentives:
1. All three incentives are checked.
2. However, only two incentives are applicable.
3. The third incentive is skipped because the category limit is reached.
In this case, the incentives are applied based on the application order as they share the same category and, as a result, hierarchy.
The final number of applied campaigns also depends on the global stacking limit.
This scenario helps prevent too many similar discounts from stacking.
## No-effect incentive: force and prevent redemption
**No effect** determines how Voucherify handles incentives that produce no effect.
In this example, a single-use incentive is valid, but it produces no effect like the discount value is 0.
### Scenario A: Prevent redemption
Voucherify works as follows:
1. The incentive is checked.
2. No discount value is calculated.
3. The incentive is not redeemed.
The incentive remains available for later use.
### Scenario B: Force redemption
Voucherify works as follows:
1. The incentive is checked.
2. No discount value is calculated.
3. The incentive is redeemed nonetheless.
The incentive counts as used even though it didn't apply any discounts. Because it was a single-use incentive, it can't be used again.
## Discount calculation mode: initial and discounted
**Discount calculation mode** determines if a discount is calculated based on the initial amount, before any other discounts have been applied, or on the already discounted amount.
In this example, two incentives are applied in the following sequence:
* 10% off the whole cart
* 20% off the whole cart
The cart value is \$100.
### Scenario A: Initial calculation
The discounts are calculated as follows:
1. 10% of \$100 = \$10
2. 20% of \$100 = \$20
Total discount = \$30
### Scenario B: Discounted calculation
The discounts are calculated as follows:
1. 10% of \$100 = \$10; this brings the amount to \$90
2. 20% of \$90 = \$18
Total discount = \$28
This scenario shows how calculation mode changes the final result.
This behavior depends on the discount calculation mode set in stacking settings or category configuration.
# Voucher maintenance
Source: https://docs.voucherify.io/orchestrate/voucher-maintenance
Find, update, disable, and delete vouchers in Voucherify
Apart from managing campaigns, you can manage individual vouchers in Voucherify. For example, you can manually edit a customer's gift card credit balance or disable a discount coupon when you suspect a customer of discount abuse.
## Activate or deactivate a voucher
Activate or deactivate vouchers directly from the campaign view.
1. Open the campaign details.
2. Go to the **Vouchers**, **Referral code**, or **Loyalty card** tab, depending on the campaign type.
3. Click the three-dot menu **⋮** next to the voucher.
4. **Activate** or **Deactivate** to enable or disable the voucher.
A disabled voucher isn't returned when [checking eligibility](/guides/checking-eligibility) and it can't be [validated or redeemed](/optimize/validations-and-redemptions).
## Update voucher
You can update a single voucher manually by editing it.
Go to a given voucher and click the pencil icon in the top right corner to edit it.
Depending on the voucher type, you can modify different details. The details edited in the voucher override the settings set up for its campaign. For example, you can change the time frame of a discount coupon, so that it's active at different times than the campaign.
Additionally, for gift and loyalty cards, you can add or subtract their credits or loyalty points by clicking the **Adjust credits** or **Adjust points** button in the top right corner of a card view.
Some functionalities, like validation rules, can't be edited for an individual voucher and they always use the campaign setting.
To update many vouchers, use code import:
* [Discount code import](/build/discount-code-import)
* [Gift card import](/build/gift-card-import)
* [Loyalty card import](/build/loyalty-card-import)
* [Referral code import](/build/referral-code-import)
## Export vouchers
Export vouchers to print or use them in external systems.
To export all or filtered vouchers:
1. Go to **Vouchers**.
2. Apply filters (optional).
3. Click **Manage filtered vouchers**.
4. Click **Export filtered vouchers**.
You can also export vouchers by going to a campaign and clicking the three-dot **⋮** menu > **Export to CSV**. This exports all campaign vouchers, even if filters are applied.
## Delete voucher
Delete vouchers when they are no longer needed.
1. Click the three-dot menu **⋮** next to the voucher.
2. Click **Delete**.
3. Choose one of the following options:
* **Move to bin**: Soft delete; you can't reuse the code. Moreover, you can't restore the voucher from the bin.
* **Delete permanently**: Permanent delete. You can reuse the code later.
## Related features
Read more about the features related to voucher maintenance.
Manage vouchers programmatically with the Voucherify API. Each voucher is identified by a unique `code` or Voucherify-assigned `id`, and belongs to a campaign (or is a generic/standalone voucher). Use these endpoints to find, update, enable or disable, and delete vouchers, as well as to adjust gift card balances or loyalty card points.
Find vouchers:
* [List vouchers](/api-reference/vouchers/list-vouchers): Search and filter vouchers across all campaigns.
* [Get voucher](/api-reference/vouchers/get-voucher): Retrieve a single voucher by code or ID.
* [Examine voucher qualification](/api-reference/vouchers/examine-voucher-qualification): Check which incentives a customer qualifies for.
Update vouchers:
* [Update voucher](/api-reference/vouchers/update-voucher): Change the configuration of a single voucher.
* [Update vouchers in bulk](/api-reference/vouchers/update-vouchers-in-bulk): Update multiple vouchers in a single request.
* [Update vouchers' metadata in bulk](/api-reference/vouchers/update-vouchers-metadata-in-bulk): Bulk update voucher metadata only.
* [Adjust voucher balance](/api-reference/vouchers/adjust-voucher-balance): Add or subtract gift card credits or loyalty points.
Enable, disable, and delete:
* [Enable voucher](/api-reference/vouchers/enable-voucher) / [Disable voucher](/api-reference/vouchers/disable-voucher): Activate or deactivate a voucher.
* [Delete voucher](/api-reference/vouchers/delete-voucher): Permanently delete or move to bin (use the `force` parameter to delete permanently).
Import vouchers:
* [Import vouchers](/api-reference/vouchers/import-vouchers): Import voucher data via JSON.
* [Import vouchers using CSV](/api-reference/vouchers/import-vouchers-using-csv): Bulk import codes from a CSV file.
# Bin
Source: https://docs.voucherify.io/prepare/bin
Manage resources moved to the bin and permanently delete them to free up unique identifiers
In Voucherify, there are two ways to remove resources: move them to the bin or delete them permanently. When a resource, such as a campaign, product, SKU, or voucher, is moved to the bin, you can't create a new one with the same unique identifiers, like the same source ID or voucher code name.
Items moved to the bin cannot be restored.
## Delete a resource
User permissions
A user must have the following permissions to permanently delete a resource:
* delete vouchers
* delete campaigns
* create and modify products and product collections
Click the bin icon to permanently delete an item.
A popup window confirms that this action is irreversible.
You can now create new objects with the same source ID, name, or code.
Campaign deletion can take a significant time depending on the number of vouchers in that campaign.
# Custom events
Source: https://docs.voucherify.io/prepare/custom-events
Configure, track, and use custom events for segmentation, validation rules, distributions, and loyalty automation
Custom events are actions taken by your customers, such as abandoning a cart, submitting a review, or completing a tutorial. By tracking these behaviors, you can create **dynamic, behavior-driven campaigns** that react to real-time activity instead of relying on static customer attributes.
With custom events, you can:
* Personalize incentives based on customer behavior.
* Run automated distributions.
* Limit redemptions using event-based rules.
* Award loyalty points when specific actions occur.
Developer setup
Custom events require developer work. Events must be sent to Voucherify explicitly using the [Track custom event](/api-reference/events/track-custom-event) API endpoint.
## Custom event workflow overview
The Custom event workflow consists of the following main steps:
Configure your application to call the Voucherify API whenever a customer performs a specific action. Coordinate with your development team to identify the exact triggers for these API calls.
Tracking ensures that customer behavior is captured in real-time to trigger rewards or messages.
Go to **Project settings** > **Event schema** and add the custom event. You can also include optional metadata fields to provide additional context for the custom event.
Defining a schema is needed for Voucherify to validate and process incoming event data accurately.
Send the specific event data from your system to Voucherify using the [Track custom event](/api-reference/events/track-custom-event) API endpoint. Ensure the data payload matches the schema defined in the previous step.
Use the logged events to power various automation features:
* **Segmentation**: Group customers based on event frequency.
* **Validation rules**: Restrict promotions based on event metadata.
* **Distributions**: Trigger emails, SMS or other notifications when an event occurs.
* **Loyalty**: Set earning rules based on custom customer actions.
Verify that Voucherify is receiving the data by checking the **Activity log** in the dashboard.
## Define new custom event
Custom event definition permissions
Only users with the **Admin** role and the **Add and modify Custom event schema** and **Delete Custom event schema** permissions can add, edit, and manage custom event schemas.
In **Home**, go to **Project settings** > **Event schema** and **Create new event definition**.
Enter the event name and add optional or mandatory metadata together with its type.
[Metadata](/prepare/metadata) properties are key-value pairs that extend the event structure.
Once the event is defined, you can use the [Track custom event API](/api-reference/events/track-custom-event) endpoint to log customer actions. Each logged event is automatically linked to a specific customer profile.
The custom event is now ready to be used with other Voucherify features.
## Related features
You can use custom events with the following features for better incentive optimization.
You can create [dynamic customer segments](/prepare/customer-segments) which group customers according to the occurrence of a chosen custom event.
You can set criteria for when the event occurred or how many times.
Then, you can use the customer segment with other features.
You can use event-based segments and event metadata to limit incentive validation and redemption.
For example, you can restrict redemptions based on customer behavior by:
1. Creating a dynamic segment based on a custom event, like customers who submitted at least two reviews.
2. Adding a validation rule to a campaign that allows redemption only for that segment.
As a result, you can run incentives that can be redeemed only when customers' behavior meets defined conditions.
You can also build validation rules directly using **custom event metadata**, for example:
* Allow redemption only if `review_type = "video"`
* Block rewards if `device_type = "test"`
Validation rules using custom event metadata are available in:
* Distributions
* Loyalty earning rules
Read the [Validation rules](/optimize/validation-rules-reference) article to learn more.
With [distributions](/integrations/distributions-overview), you can set up automatic messages in response to event-related actions.
Your message distribution can combine custom events with the following triggers:
* **Custom event**: Sends a message immediately when a specific event is logged.
* **Segment entered**: Sends a message when a customer enters an event-based segment.
* **Segment left**: Sends a message when a customer no longer meets the segment criteria.
You can refine distributions further by adding validation rules based on customer metadata or custom event metadata.
Custom events can be used to add loyalty points to customers' loyalty cards.
This is useful to award points for customer behavior, like leaving a product review.
Read the [Earning rules](/build/earning-rules) article to learn how to configure an earning rule.
Custom events can be used as a conversion event in a referral campaign. A new customer is successfully referred when they perform a defined action, meaning the custom event occurs.
Read the [Create referral campaign](/build/create-referral-campaign) article to learn how to create referrals with custom events.
In addition to custom events, Voucherify tracks over 50 internal customer events out of the box, such as successful redemptions or loyalty point assignments. These events can be used for segmentation, validation rules, and automation without additional development.
To check internal events for a given customer, go to the detailed view of a given customer > **Activity** tab.
# Customer overview
Source: https://docs.voucherify.io/prepare/customer-overview
Understand how customers and segments help you run targeted incentives in Voucherify
Voucherify uses customer data to help you run targeted promotions, loyalty programs, and validation rules.
The **Customers** section lets you manage individual profiles and organize your audience into segments.
## Core building blocks
Customer logic in Voucherify is based on two main elements:
* **Customer profiles**: Individual records with contact details, activity data, and incentives.
* **Customer segments**: Groups of customers based on shared attributes or behavior. Segments can be static (fixed lists) or dynamic (updated automatically based on filters).
## Why this matters
Not every incentive should be available to every customer.
With customer profiles and segments, you can:
* Reward selected groups of customers
* Limit promotions to specific audiences
* Personalize offers based on profile data
* Control who is eligible for a campaign
This helps you create more relevant experiences and improve campaign performance.
## What you can do
The **Customers** section provides the building blocks for audience-based incentives.
You can:
* Create and manage customer profiles
* Store standard data and custom metadata
* Group customers into segments
* Reuse segments across campaigns and rules
## How customers connect to campaigns
Customers work together with other Voucherify features, such as:
* Validation rules
* Discount promotions
* Loyalty programs
* Distributions and referral programs
This flexible structure lets you reuse the same audience logic across many campaigns and workflows.
Start simple. Create one segment and use it in a validation rule to control who can use a promotion.
## Where to go next
To learn more, explore the detailed guides:
* [Manage customers](/prepare/customers)
* [Customer segments](/prepare/customer-segments)
* [Validation rules](/optimize/validation-rules-reference)
* [Customer API](/api-reference/customers/customer-object)
# Customer segments
Source: https://docs.voucherify.io/prepare/customer-segments
Learn how to organize customers into static, passive, or active segments
Customer segments group your audience based on shared attributes, behavior, or custom metadata, like country, number of finalized orders, or custom attribute `"VIP": true`. These groups are used to build validation rules, loyalty earning rules, and trigger incentive distribution.
To manage segments, go to **Engagement** > **Segments** in your dashboard.
## Segment types
Voucherify uses three distinct segment types.
### Static segment
A **Static segment** is a fixed list of up to 20,000 customers that does not update automatically.
Static segments are useful for one-time campaigns or lists you manage manually. After you create them, the list of customers is fixed.
Static segments cannot be edited after creation, meaning you can't edit the list of customers who are in this segment.
### Dynamic segment – passive
A **Dynamic segment** – **passive** is a filter-based group that updates in real time.
Passive segments update automatically when customers meet or stop meeting the defined filters. Passive segments do not generate events when a customer enters or leaves the segment.
**Passive segments** can be edited after creation.
By default, a newly created filter-based segment is **passive**.
### Dynamic segment – active
Voucherify automatically converts a **passive segment** into an **active segment** if it is used in:
* **Loyalty earning rules**
* **Distributions**
* **Referral tiers**
Once activated:
* The segment begins triggering segment entered and segment left events.
* The segment can no longer be edited.
Like passive segments, active segments update automatically when customers meet or stop meeting the rules. When this happens, the system sends events for entering and leaving the segment. This makes active segments useful for automated distributions, loyalty earning rules, and referral tiers, as well as for tracking customer behavior where actions should happen as soon as a customer’s status changes.
## Create segments
Go to **Engagement** > **Segments** to **Create segment**.
### Create static segment
Use this segment type to manually group specific customers.
Select the customer's checkboxes. You can search for specific customers or use filters to narrow down the results.
You can check up to 20,000 customers.
Once ready, **Save as segment** > **Static segment**.
A static customer segment with a unique ID is added to **Segments** list.
### Create dynamic segment – passive
Add one or more filters using profile attributes, events, or metadata.
You can build segments using multiple attributes:
* **Profile** attributes: Standard fields such as **email**, **city**, or **source**.
* **Activity** and **Events**: Behavioral data like total order number, last purchase date, or custom API events.
* Customer **Metadata**: Custom attributes defined in your customer metadata schema.
**Bulk input**: When using the **"in"** condition, click **Bulk input** to paste up to 200 values at once, separated by commas, semicolons, or new lines.
Once ready, **Save as segment** > **Dynamic segment**.
A passive customer segment with a unique ID is added to **Segments** list.
## Export segment member data
You can export segment members as a CSV file. This is useful when you need to share a customer list with external teams, upload it to another system, or review the data outside Voucherify for analysis or reporting.
Go to **Engagement** > **Segments** and click on a segment to open the detailed view. **Export segment** to prepare the CSV file.
Choose which standard fields and custom attributes (metadata) to include in the exported CSV.
The date and times of the exported data are in the UTC time zone.
Once ready, **Export** your list. The file will be generated and delivered to your **Notifications Center**.
You can also find all your exported files in **Audit log** > **Exports**.
Larger exports may take longer to generate.
## Related features
Segments connect customer data with campaigns, automation, and developer workflows. You can use them to control eligibility, trigger actions, and work with customer lists outside Voucherify.
To create customer segments, prepare your customer base and have their data up-to-date.
Read the [Manage customer profiles](/prepare/customers) how-to guide to learn more about adding and updating customers.
You can use segments in [validation rules](/optimize/validation-rules-reference) to decide who can use a campaign. Voucherify checks if a customer belongs to a segment at the moment of validation. This is useful when eligibility depends on customer data, such as account status or past activity.
Active segments can trigger automated [distributions](/integrations/distributions-overview). When a customer enters or leaves an active segment, Voucherify can send incentives or messages automatically. This is useful for onboarding flows, promotions, and time-based campaigns.
You can use segments in [loyalty campaign earning rules](/build/earning-rules)
For example, you can assign points when a customer enters an active segment. This allows you to reward customers for reaching a specific status or meeting defined conditions.
You can manage and use segments programmatically with the [Segments API](/api-reference/segments/segment-object). This includes creating segments, updating filters, checking segment membership, and using segments in automated workflows. The API is useful when segment logic or usage is managed outside the Dashboard or needs to stay in sync with external systems.
# Manage customers
Source: https://docs.voucherify.io/prepare/customers
A comprehensive guide on creating, importing, and maintaining individual customer records in the Voucherify Dashboard
Voucherify uses customer data to help you run targeted promotions, apply validation rules, and track engagement. You can manage your audience by creating individual profiles, synchronizing data from external systems, or performing bulk imports.
To manage customers, go to **Engagement** > **Customers** in your dashboard.
## Customer data
Each customer profile in Voucherify consists of:
* **Standard attributes**, such as name, email, phone number, and address.
* **System-generated data**, which contain details about orders, redemptions, loyalty points, and referrals.
* **Wallet**, which lists the incentives the customer has currently, like discount coupons, gift cards, referral codes, and loyalty cards.
* **Metadata**, which shows custom attributes used for segmentation, validation rules, personalization, and geofencing.
Understanding this structure is key to modeling customer data correctly and avoiding unintended overwrites.
### Customer identification
Every customer is identified by two unique identifiers:
* **Customer ID**: A unique internal identifier assigned automatically by Voucherify.
* **Source ID**: A custom identifier from your own system, such as a CRM ID, email address, or phone number.
Use the **Source ID** to keep your external database in sync with Voucherify. When a customer is created or imported with an existing source ID, Voucherify updates the existing profile with new data.
The **Source ID** is set when a customer profile is created and cannot be changed afterwards – neither from the Dashboard nor through the [Update Customer](/api-reference/customers/update-customer) API. If you need a different source ID, delete the existing profile and create a new one with the desired source ID. Note that deleting a customer also removes their related data (events, orders, segment memberships).
## Create a customer profile
Customer profiles are created automatically when data is synchronized through API or integrations. You can also add customers manually in the Dashboard with a customer profile builder.
If you want to **Edit** the customer profile, go to the customer detailed view and go to the menu in the top-right corner of the screen.
### Add customer manually
To add a customer manually in the Dashboard go to **Engagement** > **Customers**.
Use the three-dot menu in the upper-right corner to add a customer.
Provide the following information:
* **General**: Name, Source ID, description, birthdate.
* **Contact**: Email address and phone number.
* **Address**: Physical location details.
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
Check if the data is correct and **Save** to add the customer profile.
A customer profile is added with a unique Voucherify ID.
## Data import and synchronization
Voucherify offers multiple ways to keep customer data up to date across systems.
### CSV import
CSV imports allow you to create new customer profiles or update existing ones in bulk. The CSV import file must include the **Customer ID** or **Source ID** and the fields to update.
**Import guidelines**:
* **Maximum file size**: 10 MB.
* **Date format**: ISO 8601 (for example, `2022-03-11` or `2022-03-11T09:00:00.000Z`).
* **Headers**: Metadata headers must not contain spaces.
* **Boolean metadata**: Use `true`, `false`, or `null`.
When importing customers using **Source ID**, existing profiles with the same Source ID are fully overwritten. This includes standard attributes and metadata.
Download the [CSV Import Template](https://cdn.jsdelivr.net/gh/voucherifyio/voucherify-openapi@master/documentation/examples/import-customers-template.csv) and populate it with customer data using supported field names.
In the **Customers** view, click **Import** and upload your CSV file.
Map CSV columns to Voucherify fields. Columns not mapped to standard fields can be imported as metadata.
Confirm the mapping and click **Import**. You will receive a notification once processing is complete.
### Metadata in imports
Customer metadata are handled as follows during the CSV import:
* Metadata defined in the **Metadata Schema** preserves its data type (number, date, boolean, array).
* Metadata imported without a schema definition is stored as **unknown metadata** and treated as a string.
* Unknown metadata cannot be used for numeric or date-based filtering until it is added to the schema.
* Nested metadata objects are not supported.
## Delete customers
You can delete customers using the three-dot menu (⋮) at the end of each customer record or through a dedicated API endpoint.
Deleting a customer permanently removes their profile and may impact reporting, redemptions, and loyalty history.
## Export customer data
Export customer data to analyze it in external analytics, BI, or CRM tools.
Go to **Engagement** > **Customers** to **Export** a customer list. You can use filters to narrow down the results.
Choose which standard fields and custom attributes (metadata) to include in the exported CSV.
The date and times of the exported data are in the UTC time zone.
Once ready, **Export** your list. The file will be generated and delivered to your **Notifications Center**.
You can also find all your exported files in **Audit log** > **Exports**.
Larger exports may take longer to generate.
## Related features
Customers are a core building block in Voucherify. Once customers are created, you can reuse them across segmentation, validation rules, integrations, and API-driven workflows.
Use customer attributes to build [segments](/prepare/customer-segments) that dynamically group customers based on their profile, behavior, or metadata. Segments can then be reused across campaigns, distributions, and analytics to target specific audiences without manual updates.
Customer data can be referenced in **validation rules** to control eligibility for campaigns and redemptions. For example, you can restrict promotions to new customers, exclude specific customer IDs, or apply rules based on customer metadata.
You can limit promotions and redemptions based on a customer’s location using **geofencing**. This helps control where offers are available and prevents misuse across regions.
Customers in Voucherify can be used with Customer Engagement Platforms (CEPs) for increased customer engagement and other marketing tools to keep profiles consistent across systems.
Go to [CEP overview](/integrations/customer-engagement-platforms) to explore platforms that can be connected with Voucherify and other integrations.
You can manage customers programmatically using the **Customer API**, including:
* Creating and updating customer profiles
* Attaching metadata and custom attributes
* Importing customers in bulk using the API or CSV import
* Linking customers to vouchers, referral codes, loyalty cards, and gift cards
To keep customer data synchronized automatically, use the **[Create Customer API](/api-reference/customers/create-customer)** whenever a new user is added to your system.
This setup is commonly used when Voucherify is integrated directly with your backend or when customer data is managed outside the Dashboard.
# Metadata
Source: https://docs.voucherify.io/prepare/metadata
Learn how to add custom attributes to your objects using metadata schema and how to manage them
Metadata (custom attributes) extends the customization capabilities of Voucherify. In addition to standard Voucherify configuration fields, metadata allow you to create custom key–value data. This way, you can add more attributes to objects (customers, orders, products, campaigns, and more) to optimize, personalize, and track incentives.
See what kind of metadata you can combine with Voucherify resources:
* Customer: `loyalty_tier: gold`, `lifetime_value: 1200`
* Order: `cart_value: 85`, `contains_subscription: true`
* Product: `category: skincare`, `margin_band: high`
* Campaign: `customer_group: A`, `objective: repurchase`
Metadata can be viewed in the details of a given resource.
Technical details
In the Voucherify API, metadata are handled as JSON key-value pairs.
## How metadata works
You can attach metadata to the following Voucherify resources.
Voucherify resources with metadata:
* Voucher
* Campaign
* Customer
* Product
* Redemption
* Publication
* Order
* Order line item
* Loyalty tier
* Promotion tier
* Earning rule
* Reward
Before using metadata attributes, it's recommended to add them to the **Metadata schema** in **Project settings**. When added, you can easily reuse your custom attributes and ensure they are consistently applied.
Each resource can contain **up to 100 definitions**.
You can also create metadata objects as **nested metadata**. Nested metadata can group other metadata with different types to be used as one custom attribute in a Voucherify resource. Nested metadata counts as one definition in a given resource (for example, in **Customer**). However, a nested metadata schema is also limited up to 100 definitions.
You can create a metadata property called `Payment` and add nested properties such as:
* `payment_method` with a string type,
* `payment_channel` with a string type,
* `payment_tax` with a number type,
* `payment_deferred` with a flag type.
The `Payment` nested metadata can be then added, for example, to the **Product** resource as an **Object** type metadata definition.
## Metadata types
You can define metadata using the following data types:
* **String**: Supports properties – **min.**/**max.**/**exact length**, **is equal to any of**.
* **Number**: Supports properties – **less**/**greater than** (or **equal**), **is equal to any of**, **is not equal to**.
* **Flag**: Boolean values (**true** or **false**). In the API, this type is called `boolean` (see [Metadata Schema Object](/api-reference/metadata-schemas/metadata-schema-object)).
* **Date** and **Date time**: Complies with **ISO 8601** (for example, `2020-03-11T09:00:00.000Z`).
* **Image URL**: Represents an image URL.
* **Object**: Uses nested metadata, which groups several custom attributes under one object.
* **Geopoint** (enterprise feature, on demand): Represents location. Stores coordinates as **latitude**, **longitude**, for example "37.786971, -122.399677". Only available for customers and products.
## Define new metadata schema
Metadata definition permissions
Only users with the **Admin** role and the **Add and modify Metadata schema** permission can add, edit, and manage metadata schemas.
To maintain data consistency, always add metadata to the schema before using it in your resources.
A metadata schema definition determines the metadata key, its type, whether it is optional or required, and other properties.
Go to **Project settings** > **Metadata schema** to define a new schema for a selected resource.
In a given resource, **Create** the schema to define new metadata.
In **Property name (key)**, type the name of your metadata field.
Use the drop-down next to **is a(n)** to mark the metadata as:
* **optional**
* **required**
Required metadata: Definitions and requests
If a metadata field is **required**, you must provide it when creating a new resource of this object type.
If you do not include **required** metadata when sending a request, Voucherify rejects it with a validation error.
Use the drop-down next to **property containing** to choose:
* **single** (one value)
* **multiple** (an array of values)
If you choose **multiple**, the stored value becomes a list of values for the same key.
Use the **Type** drop-down to select the value type:
* **String**
* **Number**
* **Date**
* **Datetime**
* **Flag**
* **Image URL**
* **Object** (nested metadata)
* **Geopoint** (enterprise feature)
The selected type controls which validation rules you can define. Some metadata types can't be used in validation rules, for example **geopoint**.
You can add properties, like **is equal to any of**, for the metadata value. You can set properties for strings, numbers, and objects.
The metadata value then must meet the defined properties.
Once ready, **Save** to add the metadata definition to the schema.
The metadata definition is added to the **Definitions** list and can be used in a given resource.
## Define nested metadata schema
Nested metadata are used as **Object** type attribute and they are used to group other metadata fields under one key.
Go to **Project settings** > **Metadata schema** to **Create nested schema**.
In the pop-up screen, name your nested metadata schema and **Save** it to open its detailed view.
When saved, your nested metadata schema object is added to the **Nested** metadata list.
In the nested metadata schema details, **Create** new metadata schema. Create your new metadata like in [Define new metadata schema](#define-new-metadata-schema).
Add as many metadata schemas as needed.
Once you've added all metadata schemas to the nested metadata, close the detailed view.
Nested metadata are listed in **Metadata schema** > **Nested** tab.
## Unknown metadata
You can find the **Unknown metadata** tab in the detailed view of every resource. Unknown metadata is custom data sent to Voucherify without a definition in the **Metadata schema**.
Unknown metadata:
* Are always treated as a string.
* Have limited filtering and validation compared to defined metadata. You have to type their key and value in the **Unknown** metadata filter.
* Are usually created through API requests, CDP imports, or manual entry of undefined properties.
You can use unknown metadata to attach temporary or one-time custom attributes to resources without the need to define a schema first. Unknown metadata is helpful for cases such as marking a specific group for a campaign or adding unique attributes to a single product or voucher.
Use unknown metadata to create new definition
To use unknown metadata and create new metadata definition, **Edit** the unknown metadata to open the metadata definition pop-up screen.
There, you can edit property name, define if it's **optional** or **required** and if it contains a **single** value or **multiple** values of a given **Type**.
## Maintenance
Once you've added metadata definitions to schemas, you can manage them in the detailed view of a given resource.
Go to **Project settings** > **Metadata schema** and select a given resource to open its detailed view.
### Metadata validation modes
Metadata can be validated by Voucherify as follows:
* **Allow any metadata** (default): Accepts undefined fields, but Voucherify still validates defined fields against the schema. For example, Voucherify rejects metadata that has a different type, disallowed values, or properties that don't meet the defined schema.
* **Allow only defined metadata**: Rejects requests if they contain undefined metadata fields or metadata doesn't meet its definition.
### Manage metadata schemas
In the metadata schema, you can:
* **Edit**: Change metadata definition. However, you can't change its **Type**.
* **Remove**: Move the definition to the **Removed definitions** tab.
**Removed definitions** still count toward the 100-definition limit. **Purge** a definition to free up space.
* **Restore**: Return a removed definition to the active schema under **Definitions** tab.
* **Purge**: Permanently remove the definition from the **Removed definitions** list and from all existing resources (for example removes the "VIP" flag from all customers). This is an asynchronous process that may take time to complete.
Metadata purge is **not** available for:
* Earning rule
* Publication
* Redemption
* Reward
* **Clear schema**: Completely delete the schema and its **Definitions**, **Unknown definitions**, and **Removed definitions**. However, this action does not **Purge** the metadata from relevant resources. If you want to also remove metadata from associated resources, first **Purge** then **Clear schema**.
Irreversible actions
Both **Purge** and **Clear schema** can't be reversed. Make sure you really want to perform these actions!
### Copy schema from another project
You can copy metadata schema definitions from another project into your current project.
Go to **Project settings** > **Metadata schema**.
Select the **Source project** from which you want to copy schema.
Select the **Schema** to copy. You can select **Standard** or **Nested** schema definitions.
Confirm with **Copy**.
All defined metadata schema are added to the definition in the current project.
## Use metadata in Voucherify
When you add metadata to your resources, like campaign or customer, you can either:
* **Use an existing metadata schema**. This is a schema that's defined in **Project settings**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema. It will be listed as an **Unknown definition** with a string type.
* **Add to schema**: Define new metadata schema. Once saved, the metadata is added to the **Definitions** of a given resource.
When adding a metadata value to a resource, you can use the following **Value types**:
* **Undefined**: The metadata is not added to the resource.
* **Null**: The metadata is added to the resource, but its value is empty (set to `null`).
* **Value**: Add value that meets the schema definition – its type and other properties.
## Related features
Experiment with other features to improve your incentive optimization.
You can use metadata with many different resources. Check some basic use scenarios below to get inspired.
Metadata added to the **Customer** schema extends basic attributes assigned to each [customer](/prepare/customers) in Voucherify. In this way, Voucherify can reflect your CRM data structure. Each metadata attribute can later serve as a redemption limit or filter in [segmenting](/prepare/customer-segments) your audience.
By using metadata, you can create product-specific promotion rules without uploading your product catalog to Voucherify. Metadata added to cart items is validated while redeeming the code to check if a customer qualifies for a promotion. You can also add your [products](/prepare/products) to Voucherify and use metadata to extend product characteristics. Likewise, each product metadata can model redemption limits and promotion rules.
You can use metadata schemas to build fine-grained [validation rules](/optimize/validation-rules-reference) that determine your desired redemption circumstances. The validation rule builder can create limits on customer, product, order, and redemption metadata.
Some metadata types, like **geopoint**, can't be used to create a validation rule.
# Orders
Source: https://docs.voucherify.io/prepare/orders
Create and track customer purchase history
Orders represent customer purchases. If you connect your system to the [**Orders API**](/api-reference/orders/order-calculated-object), you will see new entries every time your customers create a new order. The **Orders** tab helps you track your customers' orders and all transactional activities.
You can manage orders by using the Dashboard or the Orders API.
## Orders view
The **Orders** section displays a list of all transactional records. Use this view to monitor sales activity and manage existing data.
Each line in the order list contains:
* **Status**: The current state of the order:
* **Order created**: The order has been logged.
* **Order paid**: The order was finalized.
* **Order canceled**: The order was canceled. Using **redemption rollback** automatically switches a status from *paid* to *canceled*.
* **Order fulfilled**: A flexible status indicating the order was created but not yet paid.
* **ID**: A unique identifier (click this to open the **Order detailed view**).
* **Customer**: The customer who placed the order.
* **Items**: The number of items in the cart.
* **Amount**: Total value before discounts.
* **Discounted amount**: Total value after discounts.
* **Created**: The timestamp when the order was logged.
Click an order ID to open its details and see its **Dashboard** with transaction data and cart structure, **Metadata**, and **Activity**. You can change its status or edit the order.
## Add an order
You can add order records manually for individual entries or automatically for high-volume transactional data.
### Add manually in Dashboard
Use the Dashboard to manually add an order record for testing or offline sales.
Go to **Campaign hub** > **Orders** to **Create order**.
Add the following:
* **Source ID**: Your internal reference identifier for the order (optional).
* **Status**: Select the current state – **Created**, **Paid**, **Canceled**, or **Fulfilled** (optional).
**Add item** to specify products or SKUs that should be in the order.
For each item, you can set the **Quantity** and **Price**.
Click **Calculate** to update the **Total order amount**.
Optionally, add **Total order amount** only, without specific cart items.
**Choose customer** or create a new one to link the order to that customer.
This order will then appear in the customer's profile.
**Choose customer** or create a new one to assign them as a referrer if the order was driven by a [referral campaign](/build/referral-campaign-overview).
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
Review all entered details. **Save** to add the order to the order list.
## Order data export
You can download a CSV file with the order data for external reporting.
Go to **Campaign hub** > **Orders** to **Export** orders.
Choose which standard fields and custom attributes (metadata) to include in the exported CSV.
The date and times of the exported data are in the UTC time zone.
Once ready, **Export** your list. The file will be generated and delivered to your **Notifications Center**.
You can also find all your exported files in **Audit log** > **Exports**.
Larger exports may take longer to generate.
## Related features
Experiment with other features to improve your incentive results.
For production environments, use the [POST Create Order API endpoint](/api-reference/orders/create-order) to sync your storefront with Voucherify in real-time.
You can also automate the import of historical data with the [POST Import orders](/api-reference/orders/import-orders)
Syncing orders with the API ensures that **Validation rules** based on cart content are triggered instantly during the checkout process.
You can create **validation rules** that define the required cart structure:
* **Cart volume**: Limit redemptions to specific order amounts (for example, "Spend at least \$50").
* **Cart content**: Restrict discounts to specific products or quantities.
Read the [Validation rules article](/optimize/validation-rules-reference) to learn more about them.
Use **Metadata** to store custom attributes (like `shipping_method`) to build specific [validation rules](/optimize/validation-rules-reference).
Read the [Metadata article](/prepare/metadata) to learn more.
Divide customers into segments based on their purchase history:
* **High-spenders**: Customers with a total amount spent over a specific threshold.
* **Loyal buyers**: Customers who have reached a specific number of orders.
You can use those segments then for [distributions](/integrations/distributions-overview) or [validation rules](/optimize/validation-rules-reference).
Read more in the [Customer segments](/prepare/customer-segments) article.
# Prepare overview
Source: https://docs.voucherify.io/prepare/prepare-overview
Set up the foundational data that powers your incentive campaigns
Before you launch campaigns, you need the right data in place. The Prepare section covers the building blocks that make your incentives work: customers, products, orders, metadata, and custom events.
Use this section to set up and manage the data that drives validation rules, segments, and campaign targeting. Clean, structured data means faster experimentation and better results.
## What you can prepare
Import and manage customer profiles. Use attributes and metadata for segmentation and targeting.
Group customers by behavior, attributes, or metadata. Use segments in validation rules and distributions.
Add products and SKUs. Define attributes and metadata for product-specific promotions.
Organize products into static or dynamic collections for use in validation rules.
Track purchase history. Use order data for validation rules and customer segmentation.
Define custom attributes for customers, products, orders, and campaigns. Power advanced targeting and personalization.
Track customer actions like cart abandonment or review submissions. Trigger automated distributions, loyalty rewards, and behavior-based validation rules.
## Why preparation matters
Voucherify validates every redemption against your data. The more complete your customer profiles, product catalog, and order history, the more precise your targeting becomes. Metadata and custom events extend this further, letting you build rules around any attribute or behavior your business needs.
Well-prepared data enables:
* **Faster campaign launches**: Reuse segments and collections across campaigns.
* **Precise targeting**: Apply discounts to specific products, customer tiers, or order conditions.
* **Scalable experimentation**: Test different audiences and offers without rebuilding data structures.
* **Behavior-driven automation**: React to real-time customer actions with custom events.
## What's next?
Start with [customers](/prepare/customers) if you're setting up audience targeting, or [products](/prepare/products) if you're building product-specific promotions. Use [metadata](/prepare/metadata) to extend any resource with custom attributes, and [custom events](/prepare/custom-events) to trigger incentives based on customer behavior.
# Product collections
Source: https://docs.voucherify.io/prepare/product-collections
Learn how to group products into static or dynamic collections
Product collections group products based on shared attributes or specific criteria. These collections are key for modeling product-specific validation rules, such as limiting a promotion to a specific category or defining loyalty earning rules for certain items.
## Collection types
Voucherify offers two types of collections to manage your inventory effectively:
* **Static collection**: A fixed group of up to 20 products that remains unchanged after saving.
* **Dynamic collection**: A flexible group that automatically updates in real-time based on filter criteria.
Use cases
Use **static collections** for fixed sets of items, such as holiday bundles.
Use **dynamic collections** when products should be added or removed automatically based on rules.
You can create up to 100 product collections in each project.
## Create a static collection
Static collections are ideal for fixed sets of items, such as a "Holiday bundle."
Adding a product to a static collection automatically includes all its associated SKUs.
To create a **Static collection**, go to **Campaign hub** > **Product collections**. **Create collection** in the top-right corner.
Name your collection.
Mark the checkboxes next to the products you want to include in the collection.
**Save as collection** and select **Static collection**.
Once saved, a static collection cannot be edited or updated with new products.
A new product collection is added with a unique ID.
## Create a dynamic collection
To create a **Dynamic collection**, go to **Campaign hub** > **Product collections**. **Create collection** in the top-right corner.
Name your collection.
Apply filters (such as price, category, or metadata) to define your collection criteria.
**Save as collection** and choose **Dynamic collection**.
A new product collection is added with a unique ID.
Experiment
If you need to quickly update which products belong to a **Dynamic collection** that's used in a **validation rule**, for example, edit the collection and change filters.
### SKUs and dynamic collections
In dynamic collections, validation is performed separately for products and SKUs.
An SKU doesn't automatically enter a dynamic collection just because its parent product matches the filters. Each SKU must individually meet the filter criteria to be included.
## Predefined collections
Every Voucherify project includes a predefined collection called All Products. This collection automatically includes all items added to your account and items sent in API requests. You can use it when you need validation rules to apply to every item in a customer’s order.
## Related features
Product collections can be reused across campaigns, rules, and developer workflows. The features below show how collections connect to other parts of Voucherify.
You can use product collections in [validation rules](/optimize/validation-rules-reference) to control when a promotion applies. For example, you can check if an order contains any item from a collection or make sure all items in the cart belong to the same collection.
You can manage product collections using the [Product Collections API](/api-reference/product-collections/product-collection-object). This includes creating collections, updating their rules, and keeping collections in sync with external systems.
# Product overview
Source: https://docs.voucherify.io/prepare/product-overview
Understand how products and collections help you build product-based incentives in Voucherify
Voucherify is an incentive optimization engine that helps you run discounts and loyalty rules on the right items.
The **Products** section lets you organize your catalog and use product data in campaigns, promotions, and validation rules.
## Core building blocks
Products in Voucherify are based on two key elements:
* **Products** – base items in your catalog
* **SKUs** – variants of a product (for example size or color)
To work with groups of items, you can use:
* **Product collections**: sets of products defined manually or by filters.
## Why this matters
Many incentives should not apply to every item in the cart.
With products and collections, you can:
* Reward only selected products
* Limit discounts to specific categories
* Build loyalty rules for chosen items
* Control where incentives apply
This helps you stay precise and protect your margins.
## What you can do with products
The **Products** section gives you building blocks for product-based incentives.
You can:
* Add products and SKUs to your catalog
* Enrich items with custom attributes (metadata)
* Group items into collections
* Use collections in validation rules and campaigns
## How products connect to campaigns
Products do not work alone.
They connect with other Voucherify features, such as:
* Validation rules
* Discount promotions
* Loyalty earning rules
* Product-based bundles (like BOGO)
This makes it easier to reuse the same product logic across many campaigns.
Start simple: create one collection and use it in a validation rule to limit where a promotion applies.
## Where to go next
To learn more, explore the detailed guides:
* [Manage products](/prepare/products)
* [Product collections](/prepare/product-collections)
* [Validation rules](/optimize/validation-rules-reference)
* [Products API](/api-reference/products/product-object)
# Manage products
Source: https://docs.voucherify.io/prepare/products
A guide on how to create, import, and organize products and SKUs
In the **Products** section, you can build and manage your product inventory. By defining standard and custom product attributes, you can create specific rules for promotions and loyalty programs.
## Key terms
Before you begin, familiarize yourself with these core concepts:
A unique internal identifier assigned automatically by Voucherify, for example `prod_09268673c85013482b`.
An optional external ID that matches the product identifier used in your own system.
A product variant. SKUs inherit metadata from the product but can also have their own attributes.
## Add products
You can create products in the dashboard or import them in bulk. Adding products is optional, but it helps organize campaigns and define product-based rules more clearly.
### Create a product in the Dashboard
When you create a new product, you can add its details, variants, and metadata.
Go to **Products** and **Create product** to add a new item.
* **Name (Required)**: Enter the product name.
* **Source ID**: Provide your unique external identifier (optional).
* **Price**: Set the price of the product (optional). The currency is defined in **Project settings**.
* **Attribute**: This corresponds to variants (optional).
* **Choose image**: Upload an image of your product (optional).
Use **Create SKU** to add variants. Each SKU can have its own name, source ID, price, image, attributes, and metadata.
Add custom attributes for tracking, optimizing, or experimenting.
You can either:
* **Use an existing metadata schema**.
* **Add unknown property**: Metadata that isn't defined and won't be added to the schema.
* **Add to schema**: Define new metadata schema. Once saved, reload the schema to use the new metadata.
Read [Metadata](/prepare/metadata) to learn more about custom attributes.
Check the information in the **Summary** and **Save** to add the product to your catalog.
### Bulk import with CSV
You can use CSV files to import new products and SKUs or update existing product names.
**File Requirements:**
* Maximum file size: 10 MB.
* Dates must follow **ISO 8601** (e.g., `2024-03-11`).
* Metadata headers must not contain spaces.
#### Import products and SKUs
Download the [CSV Import Template](https://cdn.jsdelivr.net/gh/voucherifyio/voucherify-openapi@master/documentation/examples/import-products-template.csv) and fill it with your product data.
Download the [CSV Import Template](https://cdn.jsdelivr.net/gh/voucherifyio/voucherify-openapi@master/documentation/examples/import-skus-template.csv) and fill it with your SKU data.
To import SKUs, include the `Product ID` of the parent product to link them correctly.
Go to **Products** and click the **Import CSV** tool in the top right. Select **Import products** and upload your file.
Map your CSV columns to Voucherify fields.
Click **Import**. Voucherify processes the file and notifies you in the **Notification Center** when finished.
## Export product data
You can export all products, all SKUs, or a filtered list of products and SKUs.
Go to **Campaign hub** > **Products** to **Export** products.
Choose which standard fields and custom attributes (metadata) to include in the exported CSV.
The date and times of the exported data are in the UTC time zone.
Once ready, **Export** your list. The file will be generated and delivered to your **Notifications Center**.
You can also find all your exported files in **Audit log** > **Exports**.
Larger exports may take longer to generate.
## Related features
Products can be reused across campaigns, rules, and developer workflows. The features below show how product data connects to other parts of Voucherify.
You can group products into [collections](/prepare/product-collections) based on attributes, SKUs, or metadata. Collections help you manage large catalogs and reuse the same product selection across multiple campaigns.
Products can be used in [product discounts](/build/discount-promotion-overview) and [BOGO campaigns](/build/product-bundles). You can apply discounts to specific products or collections, or define which items are required and rewarded in a BOGO offer.
Product data can be used in [validation rules](/optimize/validation-rules-reference) to control when a promotion applies. For example, you can limit a campaign to selected products or require specific items in the cart.
You can manage products and SKUs using the [Products API](/api-reference/products/product-object). This includes creating products, importing them in bulk, updating SKUs, and keeping product data in sync with external systems.