Skip to main content
Rewarding your customers always pays off. For this, Customer Engagement has a Promotions module. There are several kinds of promotions available in Customer Engagement but the kind you can interact with via the Customer Engagement API are multichannel promotions so these are the main focus here.

Multichannel promotions

A multichannel promotion is one that can be set up to be used in-store or online or both ways. These promotions can be assigned to a contact based on their previous purchases or on any other type of contact data or interaction. You can assign multichannel promotions to segments as well as to single contacts in Customer Engagement. For this reason they’re also known as personal offers. Multichannel promotions can be used:
  • In-store - The customer is identified at the POS and their active multichannel promotions are fetched from Customer Engagement, ready to use in the checkout
  • Online - The customer will need to identify themselves either by logging in, or when they fill in their details at the checkout. Then all available multichannel promotions can be fetched from Customer Engagement and shown. How exactly this is done depends on how the e-com has been set up

Working with multichannel promotions

There are several ways to create and assign multichannel promotions when working with Customer Engagement. In this article the focus will be mostly on the Customer Engagement API but there are also these methods:

Setting up a multichannel promotion in Customer Engagement

Setting up a multichannel promotion in Customer Engagement
Select the type of the promotion from the dropdown. You can use different values for “Can be used in store” and “Can be used online” in the same promotion. The options are:
  • Monetary discount
  • Discount in percent
  • Manual instruction (only for in-store POS)
  • External promotion code
In the value type “External promotion code” the actual price rule is not stored in the promotion itself but in the retailer’s system (ERP or e-com platform). When this kind of promotion is displayed, the POS looks up the relevant price rule using the external promotion code and then displays those details. Staff or customers will not notice this happening.
Whenever a new promotion is created via the Customer Engagement UI, it is a draft state amd must be manually activated before it can be assigned to contacts.

Learn about setting up multichannel promotions

Assigning promotions by XML file import are covered in this article:

Assigning promotions by XML file

The rest of this article will focus on working with promotions using the Customer Engagement API.

Get promotions for contact

The API endpoint used to fetch all available promotions assigned to a contact is:
These query string parameters are used:
  • contactId - The contact’s unique ID. If you have some other contact identifier, use this endpoint to get the contactId you will need for this request.
  • redemptionChannelType - “ECOM”, “POS” or “OTHER”. If left out, all promotions are returned.
string
This identifies a specific “instance” of the promotion that was created from the “template” that was identified by promotionId. The id value is unique to that contact and is the one used when redeeming this promotion.
string
This is the ID of the main promotion (the “template” this particular promotion was created from). Many customers can have the same value for this, since it just refers to the main promotion. This CAN’T be used to redeem a promotion.
string
This value exists when the promotion has been created over the API. If the promotion was created manually in the Customer Engagement UI, this is null. It is not important when redeeming the promotion.
The value returned as id is what you must use to redeem the promotion.
A request to this endpoint will only return those promotions where the assigned promotion AND the main promotion are active, and with a start date that is not in the future. This query will include already redeemed promotions as long as they otherwise fulfill the criteria for being active.

Redemption channels

When getting a contact’s promotion data, you’ll get back something like this:
The redemptionChannels object in the response specifies if a promotion is a percentage, a monetary amount to be withdrawn from the total amount of the transaction, or an external discount code that refers to a price rule in your platform.
These are the fields in the redemptionChannels object:
  • type - Which channel the promotion applies to.
  • valueType - Which type of discount we want to assign (percentage, monetary or external code).
  • value - The percentage, monetary amount or external code referring to the external price rule. With a monetary discount we also expose the group currency set in Customer Engagement for that client.
  • instruction - An instruction that can be used, for example, to give some information to store staff regarding the promotion.
These can be displayed in all currencies declared in your Customer Engagement environment.
Some redemptionChannels examples:

Create a promotion

Create a promotion using the following endpoint:
When creating a promotion you can give it either:
  • A start date and a validity time
  • A start date and an end date
When sending in the startDate or endDate send only the year, month and day as in the examples shown below. Specific times in a day cannot be used.
Here is a successful response, containing the promotion’s ID:
The value id here is the ID for the promotion definition. This is used to assign this promotion to individual contacts. Each assignment gets its own ID, connecting this promotion and contact.
Here is what such a request looks like:
Here is a successful response, containing the promotion’s ID:
The maximum value for end date is “9999-12-30”.
If your creation request has been successful, you’ll get a HTTP 200 OK response. Otherwise you’ll get one of these:
  • 400: BadRequest
  • 500: Error
As can be seen in the responses above, a promotion is created with status “Draft”. Assigning the promotion via the API will automatically activate it. The creation response also contains the promotion id value which is needed when assigning the promotion to a contact (along with the contact ID).

Update a promotion

You can update (alter) a multichannel promotions over the Customer Engagement API.
Only draft promotions can be updated, not active promotions.
You can update the entire promotion or only its validity. Each method uses a different API endpoint:
To update the entire multichannel promotion, used this endpoint:
Send a payload in the same format as when you created the promotion, including your updates:
To update just the duration of an existing multichannel promotion, send a PUT to this endpoint:
With a payload formatted like this:

Assign a promotion

A promotion is of no use unless it is assigned to contacts. Multichannel promotions are assigned to contacts via the API like this:
With this request you send the following kind of payload:
The promotionId value used here to assign the promotion is the id value returned when the promotion was created.
If your request has been successful, you’ll get a HTTP 200 OK response. Otherwise you’ll get one of these:
  • 400: InvalidContactId, InvalidPromotionId
  • 404: ContactNotFound, PromotionNotFound

Redeem a promotion

As soon as a promotion is used in a purchase, it must be redeemed in Customer Engagement so it can’t be used again. To do this you’ll need to know:
  • the promotion’s unique assignment ID
  • the redemption channel, either “POS” or “ECOM”
Since the assignment ID is already connected to a unique contact, the contact’s details are not needed when redeeming a promotion.
There are two steps in redeeming:
1

Call the /redeem endpoint

Redeem the promotion with a call to this endpoint, adding the assignment ID in the path:
In the request body, add the redemption channel:
2

Add promotion ID to /receipts call

As with every purchase, you will also call this endpoint with the full receipt information:
Here you will add the assignment ID of the promotion used to the usedPromotions block in the body of the query:
If you only call the /receipts endpoint but not /redeem, the promotion will still be redeemed, but often after a delay, bringing the risk that it could be used again. If you call /redeem but miss to add the promotion assignment ID to the /receipts call, the system will not know which transaction to connect the redeemed promotion to. It will try to work it out based on the timestamp, checking for transactions within ±5 minutes of the redemption. So you should always do both of these things whenever a promotion is used in a purchase.
After 4.5 seconds the /redeem endpoint will time out, provided it has not already saved the promotion as redeemed. If the promotion has been redeemed (this is known as the “point of no return”) when the 4.5 seconds limit is passed, the request will be processed until completion. It is therefore recommended to not have a timeout shorter than 60 seconds, in order to avoid situations where a promotion is redeemed in Customer Engagement but the calling system does not know it due to aborting the request.

Redemption response codes

If the request has been successful, you’ll get a HTTP 200 OK response. Otherwise you’ll get one of these:
  • 400: NotAValidRedemptionChannel, InvalidPromotionIdNoData
  • 404: PromotionNotFound, PromotionNotAssociatedWithContact
  • 409: PromotionNotValidForRedemptionChannel, PromotionAlreadyRedeemed, PromotionAlreadyRedeemed
  • 504: GatewayTimeout

Delete a promotion

You can delete a promotion using its Customer Engagement ID or its external ID (assuming an external ID was used when creating the promotion).
Only unassigned promotions can be deleted.
To delete a multichannel promotion using the ID, use this endpoint:
The id value here is the Customer Engagement ID (“31bc4f89-6e71-4086-8627-af8f01073331” or similar).
To delete a multichannel promotion using the external ID, use this endpoint with externalId as the query parameter:

Export promotions by XML

Exporting promotions by XML files are covered in this article:

Exporting promotions by XML file