LoyaltyCardController

LoyaltyCardController

Controller for loyalty cards.

Constructor

new LoyaltyCardController()

Source:

Methods

awardPointsToLoyaltyCard(id, amount) → {Promise.<any>}

Award usable points to a loyalty card

Source:
Parameters:
Name Type Description
id String

ID of the loyalty card to which points are awarded

amount Object

Number of points to award to loyalty card

Returns:
Type:
Promise.<any>
  • The id of the LoyaltyTransaction

awardShareablePointsToLoyaltyCard(id, amount) → {Promise.<any>}

Award shareable points to a loyalty card

Source:
Parameters:
Name Type Description
id String

ID of the loyalty card to which shareable points are awarded

amount Object

Number of shareable points to award to loyalty card

Returns:
Type:
Promise.<any>
  • The id of the LoyaltyTransaction

createLoyaltyCardAndEnroll(loyalty_card) → {Promise.<any>}

Create a new Loyalty Card, automatically enrolling user in the loyalty program

Source:
Parameters:
Name Type Description
loyalty_card Object

The LoyaltyCard object input

Returns:
Type:
Promise.<any>
  • The id of the LoyaltyCard object

redeemLoyaltyPointsForCoupon(loyalty_card_id, menu_item_id) → {Promise.<any>}

Redeem a coupon in exchange of loyalty points for a particular item redeemable in a vendor's loyalty program

Source:
Parameters:
Name Type Description
loyalty_card_id string

The id of the Loyalty Card

menu_item_id string

The id of the Menu ID which must be a redeemable in the vendor's loyalty plan

Returns:
Type:
Promise.<any>
  • ID of the Coupon generated

shareLoyaltyPoints(sender_customer_id, receiver_phone_number, loyalty_program_id, no_of_points_to_share) → {Promise.<any>}

Enable sharing of loyalty points from one loyalty card to another

Source:
Parameters:
Name Type Description
sender_customer_id String

ID of the customer transferring loyalty points

receiver_phone_number String

Phone number of the receiver receiving the points

loyalty_program_id String

ID of the loyalty program in context of which points are shared

no_of_points_to_share Object

Number of points to share

Returns:
Type:
Promise.<any>
  • The id of the LoyaltyTransaction