Loyalty API
TypeChange2
Represents a change in the loyalty data.
| Kind | Type |
|---|---|
| Used in | CustomerHistory2 |
Properties
-
Unique ID of the change in the Bubblehouse system.
-
An enum defining the shape of the change object (ie which other fields are relevant)
You MUST ignore the changes with area values that you do not know how to handle. New areas can be introduced without notice, and undocumented areas may be returned.
-
Determines the exact change that has occurred
You MUST handle types that you do not know how to handle. Either ignore them, or fallback to the generic properties defined by the area.
-
descstring requiredA user-visible description of the change, suitable for a history page
-
A Bubblehouse ID of the customer this change is for.
-
customer_shopidstring required but can be emptyAn online shop ID of the customer this change is for, an empty string if unknown.
Note that in some edge cases involving imports and integrations, the customer in Bubblehouse database might not have an associated account in the online shop, so this field might be empty. You can fall back to a Bubblehouse ID when identifying these customers, or simply ignore the corresponding changes.
-
customer_emailstring required but can be emptyThe email address of the customer this change is for, an empty string if unknown.
-
order_shopidstring optionalShop ID of the order that has caused this change.
-
order_shortstring optionalShort name of the order (typically assigned by the online shop) that has caused this change.
-
hiddenboolean optionalWhether this change should be hidden from the user-visible change history.
-
pts_deltainteger required when area = points, ignore otherwiseThe change in loyalty points (positive values correspond to earned points, negative values correspond to spent or lost points).
Note that some changes (like redemptions) will always have negative values here.
-
The monetary amount corresponding to the loyalty points. A non-negative number.
This field is only filled in for some redemption changes.
-
discount_codestring optional when area = points, ignore otherwiseAn online shop discount code that corresponds to this change.
-
Whether the discount code (or another benefit requiring multiple steps to redeem) has been successfully redeemed.
-
old_tierstring required when area = tier, ignore otherwiseThe name of the customer's old tier, may be an empty string.
-
new_tierstring required when area = tier, ignore otherwiseThe name of the customer's new tier, may be an empty string.
-
old_cycle_countinteger required when area = milestone, ignore otherwiseThe previous number of active subscription cycles the customer has been considered to have. 0 means not subscribed.
-
new_cycle_countinteger required when area = milestone, ignore otherwiseThe new number of active subscription cycles the customer is considered to have. 0 means not subscribed.