A campaign object represents an incentive offered to customers. Ansa supports five types of incentive campaigns:
Drops
A drop directly funds user wallets at a scheduled time. Use the settings.startAt timestamp to control when the drop occurs. The configuration accepts a single integer, representing the amount to 'drop' into each customer’s wallet.
{
"type": "drop",
"drop": 200
}Promo codes
Promo codes allow users to redeem a code for a fixed amount of credit. The configuration object must include a code, the string users will enter to redeem the promotion, and amount, the reward amount.
{
"type": "promoCode",
"promoCode": {
"code": "CHRISTMAS20",
"amount": 123
}
}
Reload bonus
A reload bonus rewards users when they add funds to their account. You can define multiple reward tiers and choose one of two bonus modes:
oncePerCampaign: a user can receive the bonus only onceunlimited: a user can receive the bonus as many times as they meet the criteria
⚠️ If multiple reload bonus campaigns are active, Ansa will apply the campaign that gives the highest reward.
{
"type": "reloadBonus",
"reloadBonus": {
"type": "oncePerCampaign",
"rewardTiers": [
{
"minAmount": 100,
"promoAmount": 100
}
]
}
}
{
"type": "reloadBonus",
"reloadBonus": {
"type": "unlimited",
"rewardTiers": [
{
"minAmount": 100,
"promoAmount": 100
},
{
"minAmount": 200,
"promoAmount": 500
}
]
}
}
Cash back
Cash back campaigns give users a percentage of their spending back as a reward. Specify the percentage using the cashback.percentCashback field.
⚠️ If multiple cash back campaigns are active, Ansa will apply the one with the highest reward.
{
"type": "cashback",
"cashback": {
"percentCashback": 12
}
}User creation bonus
User creation bonus campaigns give users a fixed reward upon creating a wallet. Specify the amount to grant users using the userCreationBonus.amount field.
⚠️ If there are multiple user creation bonus campaigns active, Ansa will apply the one with the highest reward.
ℹ️ As the User creation bonus campaign is only for newly created customers, User segments do not apply to this type of campaign. At this time, the fixed reward is given to all new users while the campaign is active.
{
"type": "userCreationBonus",
"userCreationBonus": {
"amount": 500
}
}Campaign attributes
| Field | Type | Example value |
|---|---|---|
name | The display name of the campaign. | "1% Cashback" |
settings | Campaign settings. | |
{type} | A polymorphic object that is one of drops, promo codes , cash back , or reload bonus. | |
type | Type of the incentive campaign. | drop, promoCode, cashback or reloadBonus |
The type field in your request determines the required {type} key and the corresponding configuration object. Each incentive type has its own format and rules, detailed above.
Campaign settings attributes
| Field | Type | Example Value |
|---|---|---|
startAt | ISO 8601 timestamp representing the start of the campaign. | 2022-09-20T20:34:07Z |
endAt | ISO 8601 timestamp representing the end of the campaign. | 2022-09-20T20:34:07Z |
disabledAt | SO 8601 timestamp representing when the campaign was disabled | 2022-09-20T20:34:07Z |
targetSegments | List of uuids for the target segments this campaign applies to. | [3fa85f64-5717-4562-b3fc-2c963f66afa6] |
expirationMetadata | Configuration object defining fund expiration settings. |
Expiration metadata attributes
| Field | Type | Example Value |
|---|---|---|
type | Fund expiration type. | xDaysAfterRedeeming |
xDaysAfterRedeeming | Configuration object defining number of days until funds expire. | {"numberOfDays": 10} |