Skip to content

Latest commit

 

History

History
66 lines (57 loc) · 4.64 KB

loyalty-event.md

File metadata and controls

66 lines (57 loc) · 4.64 KB

Loyalty Event

Provides information about a loyalty event. For more information, see Search for Balance-Changing Loyalty Events.

Structure

LoyaltyEvent

Fields

Name Type Tags Description Getter Setter
id string Required The Square-assigned ID of the loyalty event.
Constraints: Minimum Length: 1
getId(): string setId(string id): void
type string(LoyaltyEventType) Required The type of the loyalty event. getType(): string setType(string type): void
createdAt string Required The timestamp when the event was created, in RFC 3339 format.
Constraints: Minimum Length: 1
getCreatedAt(): string setCreatedAt(string createdAt): void
accumulatePoints ?LoyaltyEventAccumulatePoints Optional Provides metadata when the event type is ACCUMULATE_POINTS. getAccumulatePoints(): ?LoyaltyEventAccumulatePoints setAccumulatePoints(?LoyaltyEventAccumulatePoints accumulatePoints): void
createReward ?LoyaltyEventCreateReward Optional Provides metadata when the event type is CREATE_REWARD. getCreateReward(): ?LoyaltyEventCreateReward setCreateReward(?LoyaltyEventCreateReward createReward): void
redeemReward ?LoyaltyEventRedeemReward Optional Provides metadata when the event type is REDEEM_REWARD. getRedeemReward(): ?LoyaltyEventRedeemReward setRedeemReward(?LoyaltyEventRedeemReward redeemReward): void
deleteReward ?LoyaltyEventDeleteReward Optional Provides metadata when the event type is DELETE_REWARD. getDeleteReward(): ?LoyaltyEventDeleteReward setDeleteReward(?LoyaltyEventDeleteReward deleteReward): void
adjustPoints ?LoyaltyEventAdjustPoints Optional Provides metadata when the event type is ADJUST_POINTS. getAdjustPoints(): ?LoyaltyEventAdjustPoints setAdjustPoints(?LoyaltyEventAdjustPoints adjustPoints): void
loyaltyAccountId string Required The ID of the loyalty account associated with the event.
Constraints: Minimum Length: 1, Maximum Length: 36
getLoyaltyAccountId(): string setLoyaltyAccountId(string loyaltyAccountId): void
locationId ?string Optional The ID of the location where the event occurred. getLocationId(): ?string setLocationId(?string locationId): void
source string(LoyaltyEventSource) Required Defines whether the event was generated by the Square Point of Sale. getSource(): string setSource(string source): void
expirePoints ?LoyaltyEventExpirePoints Optional Provides metadata when the event type is EXPIRE_POINTS. getExpirePoints(): ?LoyaltyEventExpirePoints setExpirePoints(?LoyaltyEventExpirePoints expirePoints): void
otherEvent ?LoyaltyEventOther Optional Provides metadata when the event type is OTHER. getOtherEvent(): ?LoyaltyEventOther setOtherEvent(?LoyaltyEventOther otherEvent): void
accumulatePromotionPoints ?LoyaltyEventAccumulatePromotionPoints Optional Provides metadata when the event type is ACCUMULATE_PROMOTION_POINTS. getAccumulatePromotionPoints(): ?LoyaltyEventAccumulatePromotionPoints setAccumulatePromotionPoints(?LoyaltyEventAccumulatePromotionPoints accumulatePromotionPoints): void

Example (as JSON)

{
  "id": "id0",
  "type": "ACCUMULATE_POINTS",
  "created_at": "created_at2",
  "accumulate_points": {
    "loyalty_program_id": "loyalty_program_id8",
    "points": 118,
    "order_id": "order_id8"
  },
  "create_reward": {
    "loyalty_program_id": "loyalty_program_id2",
    "reward_id": "reward_id6",
    "points": 90
  },
  "redeem_reward": {
    "loyalty_program_id": "loyalty_program_id8",
    "reward_id": "reward_id2",
    "order_id": "order_id8"
  },
  "delete_reward": {
    "loyalty_program_id": "loyalty_program_id4",
    "reward_id": "reward_id8",
    "points": 104
  },
  "adjust_points": {
    "loyalty_program_id": "loyalty_program_id2",
    "points": 96,
    "reason": "reason2"
  },
  "loyalty_account_id": "loyalty_account_id0",
  "source": "SQUARE"
}