LoyaltyAPIManager for Android

Manage requests related to loyalty program and interactions between the application and the APIs. The LoyaltyAPIManager class manages requests related to loyalty programs using the Force API and manages authentication by using the instance of ForceAuthenticator that was injected at the time of initialization. Use this class to manage asynchronous requests by using Retrofit and Kotlin coroutines.

LoyaltyAPIManager

MethodDescription
enrollInPromotionsEnroll a loyalty member to a promotion, while asynchronously sending data to the Enroll for Promotions API.
getEligiblePromotionsGet promotions that a member is eligible to enroll for.
getMemberBenefitsRetrieve the benefits associated with a loyalty program member for the specified API version, while asynchronously requesting data from the Member Benefits API.
getMemberProfileGet the profile details of a loyalty program member by using this code.
getTransactionsGet transaction journals of a loyalty member. Obtain either accrual or redemption transaction journal records.
getVouchersRetrieve the vouchers issued to a loyalty member by using this code.
postEnrollmentEnroll a member to a loyalty program, while asynchronously sending data to the Individual Member Enrollments API.
unEnrollPromotionOpt out a loyalty member from a promotion.

Enroll a loyalty member to a promotion, while asynchronously sending data to the Enroll for Promotions API. Use this code to enroll a member.

ParameterTypeDescriptionRequired or Optional
memberShipNumberStringThe membership number of the loyalty program member.Required
promotionNameStringThe promotion name the member is being enrolled toRequired

Get promotions that a member is eligible to enroll for. Use this code to get eligible promotions.

ParameterTypeDescriptionRequired or Optional
memberIdBooleanThe identifier of the member whose eligible promotions are being retrieved.Optional
memberShipNumberStringThe membership number of the loyalty program member.Required

Retrieve the benefits associated with a loyalty program member for the specified API version, while asynchronously requesting data from the Member Benefits API. Use this code to get member benefits.

ParameterTypeDescriptionRequired or Optional
memberIdBooleanIdentifier of the member whose benefits are being retrieved.Optional
memberShipNumberStringThe membership number of the loyalty program member.Required

Get the profile details of a loyalty program member by using this code.

ParameterTypeDescriptionRequired or Optional
memberIdBooleanIdentifier of the member whose profile is being retrieved.Optional
memberShipNumberStringThe membership number of the loyalty program member.Required
programCurrencyNameStringThe name of the loyalty program currency associated with the member.Optional

Get transaction journals of a loyalty member. Obtain either accrual or redemption transaction journal records. Use this code to get transactions.

final Result<MemberBenefitsResponse> getMemberBenefits(String memberId, String membershipNumber)

ParameterTypeDescriptionRequired or Optional
journalSubTypeNameStringThe subtype of the transaction journal record.Optional
journalTypeNameStringThe type of the transaction journal record. Possible values are Accrual or Redemption.Optional
pageNumberIntegerThe page number to be returned. If you don’t specify a value, the first page is returned. Each page contains 200 transactions, sorted by their date of creation.Optional
memberShipNumberStringThe membership number of the loyalty program member.Required
periodStartDateStringRetrieve transaction journals starting on this date.Optional
periodEndDateStringRetrieve transaction journals until this date.Optional

Retrieve the vouchers issued to a loyalty member by using this code.

This table shows the parameters in the getVouchers method.

ParameterDescription
membershipNumberMembership number of the member whose vouchers are being retrieved.
voucherStatusThe status of a voucher.
pageNumberNumber of the page you want returned. If you don’t specify a value, the first page is returned. By default, each page contains 200 vouchers, which are sorted based on the voucher creation date.
productIdThe ID of the product related to the vouchers that you want to retrieve. You can specify the ID of up to 20 products.
productCategoryIdThe ID of the product categories related to the vouchers that you want to retrieve. You can specify the ID of up to 20 product categories.
productNameThe product name related to the voucher.
productCategoryNameThe name of the product categories related to the vouchers that you want to retrieve. You can specify the ID of up to 20 product category names.

Enroll a member to a loyalty program, while asynchronously sending data to the Individual Member Enrollments API. Use this code to enroll a member.

This table shows the parameters in the postEnrollment method.

ParameterDescription
additionalContactAttributesThe person account record details of the individual type member.
canReceivePartnerPromotionsIndicates whether the member can receive partner promotions for the program (true) or not (false).
canReceivePromotionsIndicates whether the loyalty program member can receive promotions.
createTransactionJournalsIndicates whether to create the transaction journal records true) or not (false).
emailThe email address of the member being enrolled.
emailNotificationIndicates whether the member wants to receive email notifications.
enrollmentChannelThe channel used to by loyalty program members to enroll in to the loyalty program.
firstNameThe first name of the member being enrolled.
lastNameThe last name of the member being enrolled.
memberStatusThe status of the loyalty program member. Possible values are Active, Inactive, or Custom.
transactionalJournalStatementFrequencyThe frequency at which transaction journal statements must be delivered to the member. Possible values are Monthly or Quarterly.
transactionalJournalStatementMethodThe method used to deliver transaction journal statements to the member. Possible values are Mail or Email.

Possible values are:

  • Pos
  • Web
  • Email
  • CallCenter
  • Social
  • Mobile
  • Store
  • Franchise
  • Partner
  • Print

Opt out a loyalty member from a promotion. Use this code to opt out of a promotion.

ParameterTypeDescriptionRequired or Optional
memberShipNumberStringUnique identifier of the member who wants to opt out of a promotionRequired
promotionNameStringName of the promotion that the member wants to opt out of.Required