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 to communicate with Voucherify. This function will use one of the Voucherify methods to get a unique code.
- Call Voucherify Create Publication API to retrieve a unique code.

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 clusters and associated endpoints.| Shared Cluster | 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 |
Step 2: Add Voucherify Campaign
Replace thecampaign_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.

