LoyaltyAPIManager

Manage requests related to loyalty program and interactions between the application and the APIs.

LoyaltyAPIManager

Create an instance of ForceAuthenticator for authentication by using this resource and signature.

auth

Create a loyalty program name variable by using this resource and signature.

loyaltyProgramName

Provide the base URL of the loyalty program API by using this resource and signature. Base URL is the root address of your Salesforce instance. For example, if the URL in your browser’s address bar is https://na35.salesforce.com/home/home.jsp, your base URL is https://na35.salesforce.com.

instanceURL

Initialize a LoyaltyAPIManager that contains the necessary parameters such as auth, loyalty program name, instance URL, and forceclient by using this resource and signature.

init(auth:loyaltyProgramName:instanceURL:forceClient:)

Sort the requests by a specific field by using this resource and signature.

SortBy

Use the parameters in this table to create a sort request.

ParameterDefinitionDescription
expirationDatecase expirationDateSorts the requests by the expiration date of the authentication token.
effectiveDatecase effectiveDateSorts the requests by the effective date of the authentication token.
createdDatecase createdDateSorts the requests by the created date of the authentication token.

Specify if you want to view the sort results in ascending or descending order by using this resource and signature.

Use the parameters in this table to create a sort order request.

ParameterDefinitionDescription
ascendingcase ascendingSorts the results in ascending order.
descendingcase descendingSorts the results in descending order.

Define the possible statuses of a voucher by using this resource and signature.

VoucherStatus

Use the parameters in this table to define the voucher statuses.

ParameterDefinitionDescription
issuedcase issuedRepresents the vouchers that are issued.
cancelledcase cancelledRepresents the vouchers that are cancelled.
expiredcase expiredRepresents the vouchers that have expired.

Identify the type of resource to request by using this resource and signature. Use these resources to create secure and scalable mobile applications.

Resource

Use the methods in this table to get resources for a loyalty program.

MethodDefinitionDescription
individualEnrollment(programName:version:)case individualEnrollment(programName: String, version: String)Creates an individual enrollment for the loyalty program. The individualEnrollment method takes two parameters: programName, which represents the name of the loyalty program for which the individual enrollment is being created, and version, which represents the API version.
getMemberBenefits(memberId:version:)case getMemberBenefits(memberId: String, version: String)Retrieves benefits related to the member ID. The getMemberBenefits method takes two parameters: memberId, which represents the unique identifier of the member whose benefits are being retrieved, and version, which represents the API version.
getMemberProfile(programName:version:)case getMemberProfile(programName: String, version: String)Retrieves program name related to the member ID. ThegetMemberProfilemethod takes two parameters:programName, which represents the program membership name, andversion, which represents the API version.
getTransactionHistory(programName:memberId:version:)case getTransactionHistory(programName: String, memberId: String, version: String)Retrieves the transaction history associated with the member ID. The getTransactionHistory method takes three parameters: programName, which represents the loyalty program name, memberId, which represents the unique identifier of the member whose transaction history is being retrieved, and version, which represents the API version.
getPromotions(programName:version:)case getPromotions(programName: String, version: String)Retrieves a member’s existing promotions. The getPromotions method takes two parameters: programName, which represents the name of the loyalty program, and version, which represents the API version.
enrollInPromotion(programName:version:)case enrollInPromotion(programName: String, version: String)Enrolls the member in a promotion. The enrollInPromotion method takes two parameters: programName, which represents the name of the loyalty program, and version, which represents the API version.
unenrollPromotion(programName:version:)case unenrollPromotion(programName: String, version: String)Opts out a member from an available promotion. The unenrollInPromotion method takes two parameters: programName, which represents the name of the loyalty program, and version, which represents the API version.
getVouchers(programName:membershipNumber:version:)case getVouchers(programName: String, membershipNumber: String, version: String)Retrieves vouchers available to the member ID. The getVouchers method takes three parameters: programName, which represents the name of the loyalty program, membershipNumber, which represents the unique identifier of the member whose vouchers are being retrieved, and version, which represents the API version.

Get the path for the API resource by using this resource and signature. The function uses a resource parameter as input and returns the URL path of the resource as a string.

getPath(for:)

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 resource and signature to get member benefits.

getMemberBenefits(for:version:devMode:)

The getMemberBenefits method takes three parameters: memberId, which represents the unique identifier of the member whose benefits are being retrieved, version, which represents the API version, and the devMode parameter, which determines if the request is run in developer mode.

Get the profile details of a loyalty program member, while asynchronously requesting data from the Member Profile API. Use this resource and signature to get member profile details.

getMemberProfile(for:version:devMode:)

The getMemberProfile method takes three parameters:memberId , which represents the unique identifier of the member whose profile is being retrieved, version, which represents the API version, and the devMode parameter, which determines if the request is run in developer mode.

Retrieve the Experience Cloud user profile associated with a loyalty program member for the specified API version, while asynchronously requesting data from Salesforce. Use this resource and signature to get the Experience Cloud user profile details.

getCommunityMemberProfile(version:devMode:)

The getCommunityMemberProfile method takes two parameters: version, which represents the default version of the mobile SDK, and the devMode parameter, which determines if the request is run in developer mode.

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

postEnrollment(membershipNumber:firstName:lastName:email:phone:emailNotification:version:)

This table shows the parameters in the method.

ParameterDescription
membershipNumberMembership number of the member being enrolled.
firstNameFirst name of the member being enrolled.
lastNameLast name of the member being enrolled.
emailEmail address of the member being enrolled.
phonePhone number of the member being enrolled.
emailNotificationIndicates whether the member wants to receive email notifications.
versionThe default API version.

After the enrollment, the request returns the membership number and program member ID.

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

enrollIn(promotion:for:version:)

The enrollIn method takes three parameters:promotionName , which represents the promotion name the member is being enrolled to, membershipNumber, which represents the membership number of the member being enrolled, and version, which represents the API version

Opt out a loyalty member from a promotion by using the promotion ID. Use this resource and signature to opt out of a promotion.

unenroll(promotionId:for:version:devMode:)

The unenroll method takes two parameters: promotionID, which represents the promotion ID from which the member is being unenrolled, membershipNumber, which represents the membership number of the member being unenrolled, and version, which represents the API version.

Opt out a loyalty member from a promotion by using the promotion name. Use this resource and signature to opt out of a promotion.

unenroll(promotionName:for:version:devMode:)

This table shows the parameters in the unenroll method.

ParameterDescription
promotionNameName of the promotion from which the member is being unenrolled.
membershipNumberMembership number of the member being unenrolled.
versionVersion of the mobile SDK.
devModeDetermines if the request is run in developer mode.

Get the promotions that the member is enrolled to, by using the loyalty program member ID while asynchronously requesting data from the Enroll for Promotions API. Use this resource and signature to get the enrolled promotions.

getPromotions(memberId:version:devMode:)

The getPromotions method takes three parameters: memberID, which represents the unique identifier of the member whose promotions are being retrieved, version, which represents the default API version, and devMode, which determines if the request is run in developer mode.

Get the promotions that the member is enrolled to, by using the loyalty program membership number while asynchronously requesting data from the Enroll for Promotions API. Use this resource and signature to get the enrolled promotions.

getPromotions(membershipNumber:version:devMode:)

The getPromotions method takes three parameters: membershipNumber, which represents the membership number of the member whose promotions are being retrieved, version, which represents the default API version, and devMode, which determines if the request is run in developer mode.

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

getTransactions(for:pageNumber:journalTypeName:journalSubTypeName:periodStartDate:periodEndDate:version:devMode:)

The getTransactions method takes the pageNumber parameter that represents the number of the page you want returned. If you don’t specify a value, the first page is returned. Each page contains 200 transaction journals and the transaction journals are sorted based on the activity date.

Retrieve the vouchers issued to a loyalty member by using this resource and signature.

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.
sortBySpecifies the field used to sort the vouchers you want to retrieve. The default value is ExpirationDate.
sortOrderSpecifies the sort order of the vouchers you want to retrieve. The default value is Ascending.
versionVersion of the API.
devModeDetermines if the request is run in developer mode.