# Voucherify (Actions) Destination

## Destination Info

* Accepts [Page](/docs/segment/connections/spec/page), [Alias](/docs/segment/connections/spec/alias), [Group](/docs/segment/connections/spec/group), [Identify](/docs/segment/connections/spec/identify), [Track](/docs/segment/connections/spec/track) calls.
* Refer to it as **Voucherify (Actions)** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)
* This integration is **partner owned.** Please reach out to the partner's support for any issues.

[Voucherify](https://voucherify.io/?utm_source=segmentio\&utm_medium=docs\&utm_campaign=partners) is an API-first Promotion Engine for growth teams. With Voucherify, marketers can run dynamic and personalized promotions and loyalty programs without the involvement of the development team. Run CDP-powered coupons, discounts, referrals, loyalty programs, gift cards, cashback, bundles, and more. The Destination integration provides a continuous flow of customer data from Segment to Voucherify to create custom events, create or update customers, and build audiences.

Voucherify maintains this destination. For any issues with the destination, [contact the Voucherify Support team](mailto:support@voucherify.io).

## Benefits of Voucherify (Actions) vs Voucherify (Classic)

The Voucherify (Actions) destination is bidirectional, which means you can configure Voucherify as both the destination and source of your customer data. The Destination Actions framework improves on classic destinations by enabling you to see and control how Segment sends the event data it receives from your sources to actions-based destinations. Each Action in a destination lists the event data it requires and the event data that is optional. You can also choose which event types, event names, or event property values trigger an Action. These Triggers and mappings make it possible to send different versions of the Action, depending on the context from which it is triggered.

## Getting started

1. From the Segment web app, click **Catalog**, then click **Destinations**.
2. Find the Destinations Actions item in the left navigation, and click it.
3. Select Voucherify (Actions) and then **Configure Voucherify (Actions)**.
4. Select an existing Source to connect to Voucherify (Actions).
5. Enter the **API Key** and **API Token** into your Segment Settings UI, which you can find from your [Voucherify dashboard](https://voucherify.io/dashboard).
6. Enter **Custom URL**. Check your API region in Voucherify dashboard -> Project settings -> API endpoint. Then use one of [API Endpoints](https://docs.voucherify.io/docs/api-endpoints) and replace the **API** word with `segmentio` For example, if your default URL is: [https://us1.api.voucherify.io](https://us1.api.voucherify.io), then use: [https://us1.segmentio.voucherify.io](https://us1.segmentio.voucherify.io). It also works for dedicated URLs.
7. Select **Quick Setup** to start with pre-populated subscriptions, or **Customized Setup** to configure each action from scratch.
8. Click **Configure Actions**.

### Find your API Key and API Token

On the Voucherify Dashboard page:

1. Open the **Project settings** from the user context menu on the top right.
2. Find the **Application Keys** section on the project page.
3. Use **Application ID** and **Secret Key** respectively as the **API Key** and **API Token**.

## Destination Settings

| Field                 | Description                                                                                                                                                                                                                                                                                                          | Required | Type     |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| Application ID        | Application ID can be found in \[Voucherify dashboard]\(https://docs.voucherify.io/docs/authentication).                                                                                                                                                                                                             | Yes      | password |
| Custom Voucherify URL | Check your API region in \[Voucherify dashboard]\(https://app.voucherify.io/#/login) -> Project settings -> API endpoint. For example, if you are using a project with a URL: \`https://us1.api.voucherify.io\`, your Custom URL will be: \`https://us1.segmentio.voucherify.io\`. It also works for dedicated URLs. | Yes      | string   |
| Secret Key            | Secret Key can be found in \[Voucherify dashboard]\(https://docs.voucherify.io/docs/authentication).                                                                                                                                                                                                                 | Yes      | password |

## Available Presets

Voucherify (Actions) has the following presets

| Preset Name                     | Trigger                 | Default Action           |
| ------------------------------- | ----------------------- | ------------------------ |
| Create Or Update Customer       | Event type = "identify" |  Upsert Customer         |
| Add Custom Event (Track Event)  | Event type = "track"    | Add custom event         |
| Add Custom Event (Page Event)   | Event type = "page"     | Add custom event         |
| Add Custom Event (Screen Event) | Event type = "screen"   | Add custom event         |
| Assign Customer To Group        | Event type = "group"    | Assign customer to group |

## Available Actions

Build your own Mappings. Combine supported [triggers](/docs/segment/connections/destinations/actions/#components-of-a-destination-action) with the following Voucherify-supported actions:

> \[!NOTE]
>
> Individual destination instances have support a maximum of 50 mappings.

* [Add custom event](#add-custom-event)
* [Assign customer to group](#assign-customer-to-group)
* [ Upsert Customer](#-upsert-customer)

### Add custom event

Send the Track, Page or Screen event that will be saved as a [custom event](https://docs.voucherify.io/reference/the-custom-event-object) in Voucherify.

Add custom event is a **Cloud** action. The default Trigger is `type = "track" or type = "page" or type = "screen"`

| Field                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                           | Required | Type   |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Customer Object      | This is an object containing information about the \[customer]\(https://docs.voucherify.io/reference/the-customer-object).                                                                                                                                                                                                                                                                                                                            | Yes      | OBJECT |
| Referral Object      | If a conversion event for a referral program is set to a \[custom event]\(https://docs.voucherify.io/reference/custom-event-object), then you need to send the referral code in the payload to make a record of the conversion event.                                                                                                                                                                                                                 | No       | OBJECT |
| Loyalty Object       | If an earning rule in a loyalty program is based on a \[custom event]\(https://docs.voucherify.io/reference/custom-event-object). This objects allows you specify the loyalty card to which the custom event should be attributed to.                                                                                                                                                                                                                 | No       | OBJECT |
| Track Event Metadata | The metadata object stores all custom attributes assigned to the \[custom event]\(https://docs.voucherify.io/reference/custom-event-object). 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. | No       | OBJECT |
| Event Name           | The name of the event that will be saved as a \[custom event]\(https://docs.voucherify.io/reference/the-custom-event-object) in Voucherify.                                                                                                                                                                                                                                                                                                           | No       | STRING |
| Event Type           | Type of the \[event]\(/docs/segment/connections/spec/). For example: identify, track, page, screen or group                                                                                                                                                                                                                                                                                                                                           | Yes      | STRING |

### Assign customer to group

Assign a specific group and its traits to the customer.

Assign customer to group is a **Cloud** action. The default Trigger is `type = "group"`

| Field           | Description                                                                                                                       | Required | Type   |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Customer Object | Object containing information about the \[customer]\(https://docs.voucherify.io/reference/the-customer-object).                   | Yes      | OBJECT |
| Group ID        | The ID used to uniquely identify a group to which \[customer]\(https://docs.voucherify.io/reference/the-customer-object) belongs. | Yes      | STRING |
| Group Traits    | Traits of the group that will be created in customer \[metadata]\(https://www.voucherify.io/glossary/metadata-custom-attributes). | No       | OBJECT |
| Event Type      | Type of the \[event]\(/docs/segment/connections/spec/). For example: identify, track, page, screen or group.                      | Yes      | STRING |

### &#x20;Upsert Customer

Send the [identify event](/docs/segment/connections/spec/identify/) to create or update the [customer](https://docs.voucherify.io/reference/the-customer-object)

Upsert Customer is a **Cloud** action. The default Trigger is `type = "identify"`

| Field         | Description                                                                                                                                                                                                                                  | Required | Type   |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Source ID     | The \`source\_id\` which identifies the \[customer]\(https://docs.voucherify.io/reference/the-customer-object) in Voucherify.                                                                                                                | Yes      | STRING |
| Name          | First name and last name of the \[customer]\(https://docs.voucherify.io/reference/customer-object).                                                                                                                                          | No       | STRING |
| First Name    | First name of the \[customer]\(https://docs.voucherify.io/reference/customer-object). It will be merged with \`last\_name\` to create the \`name\` field.                                                                                    | No       | STRING |
| Last Name     | Last name of the \[customer]\(https://docs.voucherify.io/reference/customer-object). It will be merged with \`first\_name\` to create the \`name\` field.                                                                                    | No       | STRING |
| Description   | An arbitrary string that you can attach to a \[customer]\(https://docs.voucherify.io/reference/customer-object) object.                                                                                                                      | No       | STRING |
| Email Address | The email that identifies the \[customer]\(https://docs.voucherify.io/reference/the-customer-object) in Voucherify.                                                                                                                          | No       | STRING |
| Phone         | Phone number of the \[customer]\(https://docs.voucherify.io/reference/the-customer-object).                                                                                                                                                  | No       | STRING |
| Birthdate     | Birthdate of the \[customer]\(https://docs.voucherify.io/reference/the-customer-object). You can pass data here in \`date\` or \`datetime\` format (ISO 8601).                                                                               | No       | STRING |
| Address       | Address of the \[customer]\(https://docs.voucherify.io/reference/the-customer-object).                                                                                                                                                       | No       | OBJECT |
| Metadata      | A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. | No       | OBJECT |
| Event Type    | Type of the \[event]\(/docs/segment/connections/spec/). For example: identify, track, page, screen or group                                                                                                                                  | Yes      | STRING |

## Engage

You can send computed traits and audiences generated using [Engage](/docs/segment/engage) to this destination as a **user property**. To learn more about Engage, schedule a [demo](https://segment.com/contact/demo).

For user-property destinations, an [identify](/docs/segment/connections/spec/identify/) call is sent to the destination for each user being added and removed. The property name is the snake\_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property `order_completed_last_30days: true`. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to `false`.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

> \[!NOTE]
>
> Real-time audience syncs to Voucherify (Actions)  may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

## Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

| Field                 | Description                                                                                                                                                                                                                                                                                                          | Required | Type     |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| Application ID        | Application ID can be found in \[Voucherify dashboard]\(https://docs.voucherify.io/docs/authentication).                                                                                                                                                                                                             | Yes      | password |
| Custom Voucherify URL | Check your API region in \[Voucherify dashboard]\(https://app.voucherify.io/#/login) -> Project settings -> API endpoint. For example, if you are using a project with a URL: \`https://us1.api.voucherify.io\`, your Custom URL will be: \`https://us1.segmentio.voucherify.io\`. It also works for dedicated URLs. | Yes      | string   |
| Secret Key            | Secret Key can be found in \[Voucherify dashboard]\(https://docs.voucherify.io/docs/authentication).                                                                                                                                                                                                                 | Yes      | password |
