Přejít k obsahu  Přejít k hlavnímu menu

Blog / Knowledge base

Updated: 2. October 2020

Discount codes obtained from the API in real time

In addition to code stacks, Mailocator allows you to read discount codes in real time from an external API, display them in a thank you page and pass them to an email tool.

Conditions for connecting to an external API

API must be accessible without authentication (username and password authentication methods are not supported).
After the call, data is expected in JSON format, which contains the code and optionally additional text - for example, the amount of the discount.


Open Features and Settings.
Select Promocodes and Gift Coupons.
Continue with the Create Code Stack button.








Select API Codes.
Name the code group (API connector in this case).
Enter the address of the interface from which the codes will be read.
Enter the name of the property returned by the JSON structure that contains the promo code.
If you also want to pass text information, enter the name of this property in the returned JSON.




From now on, the discount codes will be automatically added to the pop-up and passed to the e-mail tool as soon as the user confirms the newsletter subscription.






In Scenarios, select the campaign and click the gift icon.
The codes can be attached to all campaigns that support email marketing.



Assign the required stack – API connector to the campaign.





Information on the correct loading and passing of the code can be found in the Monitoring of your project.
If an error has occurred (red line), click on this line for detailed information on processing the request to help you resolve the error.




RELATED

Scenario in Mailocator

The Mailocator scenario is a key tool for setting up your campaigns to work properly. See everything and how easy it is to set up.

Discount codes

Mailocator allows you to pass discount and promotional codes to email campaigns

Discount codes obtained from the API in real time

In addition to code stacks, Mailocator allows you to read discount codes in real time from an external API, display them in a thank you page and pass them to an email tool.

Transfer of data from Mailocator to ESP

Sometimes it is useful to provide additional information from Mailocator, usually state, gender, favorite categories, discount code or name and surname. How to do it?

Preparation of the winning calendar (Advent calendar)

Mailocator contains pre-prepared templates for action calendars, which reveal to users the winnings for a specific day in exchange for an email address. You can easily prepare an Advent calendar with a discount or an event for each day.

Scratch card

A scratch card is a campaign in which the marketing content (discount, notification, coupon...) is covered by an image that can be wiped with the mouse cursor or a finger on the screen of the smart device. After deleting and revealing the content, you can automatically trigger an action, such as getting an email address.