Loyalty API
TypeAsset2
Describes an asset in the loyalty program that customers can unlock.
| Kind | Type |
|---|---|
| Used in | CustomerBalance3, EstimateAccrual1, LoggedOutBalance1, QueryOrderDetails1 |
Assets represent rewards or achievements that customers can obtain by meeting certain conditions. Once unlocked, an asset may provide rewards such as points or coupons. Each asset can be obtained multiple times if configured as recurring, and each instance of ownership can have its own expiration and usage limits.
Properties
-
Internal Bubblehouse ID of the asset.
-
apinamestring optionalAPI name for programmatic identification of the asset.
-
slugsarray of string requiredStable, URL-friendly identifier(s)
You can identify Bubblehouse objects by Bubblehouse ID (20b31881b3010001) or by slug (best-savings). BH ID is stable, but cryptic, and also varies across dev/production environments. Slugs are human-readable and derived from customer-visible titles, but are stable (do not get invalidated as the title changes) and use a restricted URL-friendly character set.
Bubblehouse generates a slug based on an object's name/title, e.g. an object named "Oh My, Great Milestone!" gets a slug of oh-my-great-milestone. Slugs only contain lowercase latin letters, numbers and dashes. You can see an object's slug in the admin panel.
Slugs are always unique for a given type of object across their entire history. A numeric suffix like -2 is appended when necessary to make it unique (e.g. great-milestone-2). Bubblehouse keeps a history of slugs that have ever been associated with a given object, and allows using any of them to identify it. So when you rename "Great Milestone" to "Best Savings Month", it gets multiple slugs:
["best-savings-month", "great-milestone"]. The current slug always comes first, followed by older slugs.This means that you can manually get a slug from the admin console, put it into your system's configuration, and have your system pass it into Bubblehouse and/or match it against the list of slugs returned by Bubblehouse. This will continue to operate correctly going forward, regardless of any future renames, and across multiple environments.
Example:
["best-savings-month","great-milestone"] -
sectionstring optionalSection name for grouping assets in the UI.
-
titlestring optionalDisplay title of the asset.
-
benefits_descstring optionalDescription of the benefits provided when this asset is unlocked.
-
conditions_descstring optionalDescription of the conditions required to unlock this asset.
-
cta_titlestring optionalCall-to-action button title.
-
Image associated with the asset.
-
activeinteger optionalNumber of currently active ownerships the customer has for this asset.
-
can_obtainboolean optionalWhether the customer can currently obtain this asset.
-
List of the customer's ownerships of this asset.
-
available_usesinteger optionalTotal number of uses available across all active ownerships.
-
is_availableboolean requiredWhether the asset is available to the customer based on visibility and availability rules.
-
can_completeboolean requiredWhether the customer can currently complete (unlock) this asset.
-
is_completedboolean requiredWhether the customer has completed (unlocked) this asset.
-
is_rewardedboolean requiredWhether the customer has been rewarded for this asset.
-
ptsinteger optionalPoints awarded when unlocking this asset.
-
use_limitinteger optionalMaximum number of times each ownership can be used.
-
validityduration optionalHow long each ownership remains valid after being obtained.
-
max_active_quantityinteger optionalMaximum number of active ownerships allowed at once.