LoyaltyService class

URL: https://developer.squareup.com/reference/square/loyalty-api Create and manage loyalty accounts for buyers.

The Loyalty API lets you create and manage loyalty accounts in a Square loyalty program and allow buyers to earn points and redeem points for discounts.

Constructors

LoyaltyService({required String baseUrl, required AuthenticationService authenticationService})

Properties

authenticationService AuthenticationService
final
baseUrl String
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

accumulateLoyaltyPoints({required String accountId, required AccumulateLoyaltyPointRequest request, String? authToken}) Future<LoyaltyEvent>
Adds points to a loyalty account.
adjustLoyaltyPoints({required String accountId, required AdjustLoyaltyPointRequest request, String? authToken}) Future<LoyaltyEvent>
Adds points to or subtracts points from a buyer's account.
calculateLoyaltyPoints({required String programId, required CalculateLoyaltyPointsRequest request, String? authToken}) Future<int>
Calculates the points a purchase earns.
calculateLoyaltyReward({required UpsertLoyaltyRewardRequest request, String? authToken}) Future<LoyaltyReward>
Creates a loyalty reward.
createLoyalty({required LoyaltyUpsertRequest request, String? authToken}) Future<LoyaltyAccount>
Creates a loyalty account.
deleteLoyaltyReward({required String rewardId, String? authToken}) Future<bool>
Deletes a loyalty reward
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readLoyalty({required String accountId, String? authToken}) Future<LoyaltyAccount>
Retrieves a loyalty account.
readLoyaltyProgram({required String programId, String? authToken}) Future<LoyaltyProgram>
Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword main.
readLoyaltyReward({required String rewardId, String? authToken}) Future<LoyaltyReward>
Retrieves a loyalty reward.
redeemLoyaltyReward({required String rewardId, required RedeemLoyaltyRequest request, String? authToken}) Future<LoyaltyEvent>
Redeems a loyalty reward.
searchLoyalty({required SearchLoyaltyRequest request, String? authToken}) Future<LoyaltyResponse>
Searches for loyalty accounts in a loyalty program.
searchLoyaltyEvents({required SearchLoyaltyEventsRequest request, String? authToken}) Future<LoyaltyEventResponse>
Searches for loyalty events.
searchLoyaltyReward({required SearchLoyaltyRewardRequest request, String? authToken}) Future<LoyaltyRewardResponse>
Searches for loyalty rewards in a loyalty account.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited