Campaign

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:

  1. oncePerCampaign: a user can receive the bonus only once
  2. unlimited: 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

FieldTypeExample value
nameThe display name of the campaign."1% Cashback"
settingsCampaign settings.
{type}A polymorphic object that is one of drops, promo codes , cash back , or reload bonus.
typeType 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

FieldTypeExample Value
startAtISO 8601 timestamp representing the start of the campaign.2022-09-20T20:34:07Z
endAtISO 8601 timestamp representing the end of the campaign.2022-09-20T20:34:07Z
disabledAtSO 8601 timestamp representing when the campaign was disabled2022-09-20T20:34:07Z
targetSegmentsList of uuids for the target segments this campaign applies to.[3fa85f64-5717-4562-b3fc-2c963f66afa6]
expirationMetadataConfiguration object defining fund expiration settings.

Expiration metadata attributes

FieldTypeExample Value
typeFund expiration type.xDaysAfterRedeeming
xDaysAfterRedeemingConfiguration object defining number of days until funds expire.{"numberOfDays": 10}