Loyalty API
Change2
Represents a change in the loyalty data.
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.
desc
stringrequiredA user-visible description of the change, suitable for a history page
A Bubblehouse ID of the customer this change is for.
customer_shopid
stringrequired 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_email
stringrequired but can be emptyThe email address of the customer this change is for, an empty string if unknown.
order_shopid
stringoptionalShop ID of the order that has caused this change.
order_short
stringoptionalShort name of the order (typically assigned by the online shop) that has caused this change.
hidden
booleanoptionalWhether this change should be hidden from the user-visible change history.
pts_delta
integerrequired 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_code
stringoptional when area = points, ignore otherwiseAn online shop discount code that corresponds to this change.
redemption_status
RedemptionStatus1optional when area = points, ignore otherwiseWhether the discount code (or another benefit requiring multiple steps to redeem) has been successfully redeemed.
old_tier
stringrequired when area = tier, ignore otherwiseThe name of the customer's old tier, may be an empty string.
new_tier
stringrequired when area = tier, ignore otherwiseThe name of the customer's new tier, may be an empty string.
old_cycle_count
integerrequired when area = milestone, ignore otherwiseThe previous number of active subscription cycles the customer has been considered to have. 0 means not subscribed.
new_cycle_count
integerrequired when area = milestone, ignore otherwiseThe new number of active subscription cycles the customer is considered to have. 0 means not subscribed.