iOS SDK - Loyalty Management Module
Last updated: Sept 19th, 9:33pm
Use the endpoints of this module to integrate merchant-sponsored reward programs into the wallet.
Initialize Loyalty Management Facade
Prior to invoking any loyalty management module endpoints:
- Create a new request object for the relevant coordinator.
- Implement the delegate for the coordinator to handle responses.
1PDLoyaltyProgramCoordinator *loyaltyCoordinator = [[PDLoyaltyProgamCoordinator alloc] init];2 self.loyaltyCoordinator = loyaltyCoordinator;3 [loyaltyCoordinator release];
isRegisteredForLoyalty
Checks whether the wallet owner is registered in WLW's global loyalty platform.
Element | Value |
---|---|
Method Signature | -(void)isRegisteredForLoyalty; |
Success | void (^IsRegisteredForLoyaltyCompletionBlock(BOOL isCustomerRegistered); isCustomerRegistered - Indicates whether a loyalty profile is linked to the wallet profile. Valid values are:TRUE - Wallet is associated with a loyalty profile.FALSE - Wallet is not associated with a loyalty profile. |
Failure | void (^IsRegisteredForLoyaltyFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key kUserErrorIsRegisteredForLoyaltyDomain
.
Error | Description |
---|---|
500 |
An unknown error occurred internally in the server. |
retrieveGlobalProfileMetadata
Get the set of properties that make up the loyalty profile in order to collect values from the user for registration.
Element | Value |
---|---|
Method Signature | -(void)retrieveGlobalProfileMetadata; |
Success | void (^FetchGlobalProfileMetadataCompletionBlock( PDRetrieveGlobalProfileMetadataResponse *response); response - Contains the set of PDGlobalProfileAdditionalData instances representing the properties that define the loyalty profile and status information related to the outcome of the call. |
Failure | void (^FetchGlobalProfileMetadataFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key: kUserErrorRetrieveGlobalProfileMetadataDomain
.
Error | Description |
---|---|
500 |
An unknown error occurred internally in the server. |
registerCustomerForLoyalty
Enrolls the wallet owner in WLW's loyalty platform, enabling the user to subscribe to individual loyalty programs supported in the wallet.
Element | Value |
---|---|
Method | -(void) registerCustomerForLoyalty:( PDRegisterCustomerForLoyaltyRequest *)registerForLoyaltyRequest; registerForLoyaltyRequest - Passes the set of user-completed PDGlobalProfileAdditionalData instances that make up the loyalty profile. |
Success | void (^RegisterCustomerForLoyaltyCompletionBlock(); |
Failure | void (^RegisterCustomerForLoyaltyFailureBlock( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key kUserErrorRegisterCustomerForLoyaltyDomain
.
Error | Description |
---|---|
403 |
The user must be logged in to make this call. |
417 |
Required profile data is missing. |
421 |
This user is already registered for loyalty. |
500 |
An unknown error occurred internally in the server. |
retrieveAvailableLoyaltyPrograms
Gets the set of all loyalty programs supported for the wallet.
Element | Value |
---|---|
Method Signature | -(void)retrieveAvailableLoyaltyPrograms; |
Success | void (^FetchAvailableLoyaltyProgamsCompletionBlock(NSArray *loyaltyPrograms, PDRetrieveAvailableLoyaltyProgramsResponse *response); loyaltyProgams - The set of PDLoyaltyProgram instances for all loyalty programs supported by the wallet.response - Contains the set of loyalty programs and status information related to the outcome of the call. |
Failure | void (^FetchAvailableLoyaltyProgramsFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key kUserErrorRetrieveAvailableLoyaltyProgramsDomain
.
Error | Description |
---|---|
500 |
An unknown error occurred internally in the server. |
retrieveMyLoyaltyPrograms
Get the set of loyalty programs for which the wallet owner has subscribed.
Element | Value |
---|---|
Method Signature | -(void)retrieveMyLoyaltyPrograms; |
Success | void (^FetchMyLoyaltyProgamsCompletionBlock(NSArray *loyaltyPrograms, PDRetrieveMyLoyaltyProgramsResponse *response); loyaltyProgams - The set of PDLoyaltyProgram instances for the wallet owner's subscribed loyalty programs.response - Contains the set of loyalty programs and status information related to the outcome of the call. |
Failure | void (^FetchMyLoyaltyProgramsFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key: kUserErrorRetrieveMyLoyaltyProgramsDomain
.
Error | Description |
---|---|
403 |
The user must be logged in to make this call. |
500 |
An unknown error occurred internally in the server. |
retrieveLoyaltyProgram
Get the details related to a specific loyalty program.
Element | Value |
---|---|
Method Signature | -(void)retrieveLoyaltyProgram:( PDRetrieveLoyaltyProgramRequest *)request; request - Identifies the requested loyalty program by its URI. |
Success | void (^FetchLoyaltyProgamCompletionBlock( PDLoyaltyProgram *loyaltyProgram, PDRetrieveLoyaltyProgramResponse *response); loyaltyProgam - Contains the details of the requested loyalty program.response - Contains the loyalty program and status information related to the outcome of the call. |
Failure | void (^FetchLoyaltyProgramFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key: kUserErrorRetrieveLoyaltyProgramDomain
.
Error | Description |
---|---|
403 |
The user must be logged in to make this call. |
404 |
The loyalty program specified could not be found. |
500 |
An unknown error occurred internally in the server. |
retrieveTransactionLoyaltyPoints
Gets the points earned for a specific transaction.
Note: Implement a programmatic delay or polling call before invoking this call immediately following completion of the respective transaction to ensure that the server has time to apply the accrual. Otherwise, an inaccurate "no accrual activities detected" response may be returned.
Element | Value |
---|---|
Method Signature | -(void)retrieveTransactionLoyaltyPoints:(NSString *)paydiantReferenceId; paydiantReferenceId - Identifies the transaction for which relevant points are requested. |
Success | void (^FetchTransactionLoyaltyPointsCompletionBlock(NSArray *accrualActivities, PDTransactionLoyaltyPointsResponse *response); accrualActivities - The set of PDAccrualActivity instances representing each qualifying action in the transaction that earned loyalty points.response - Contains the set of accrual activity and status information related to the outcome of the call. |
Failure | void (^FetchTransactionLoyaltyPointsFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key: kUserErrorRetrieveTransactionLoyaltyPointsDomain
.
Error | Description |
---|---|
403 |
The user must be logged in to make this call. |
404 |
The transaction specified could not be found. |
500 |
An unknown error occurred internally in the server. |
recordExternalActivity
Remits an action performed outside the mobile wallet, such as sharing a link, posting on social media, or providing an email, that is eligible for loyalty points awards.
Element | Value |
---|---|
Method Signature | - (void) [recordExternalActivity](/limited-release/wlw/ios-sdk/objects-loyalty/#recordexternalactivity):( PDRecordExternalActivityRequest *) request; request - Defines the external activity that was completed. |
Success | void(^FetchRecordExternalActivityCompletionBlock)(NSArray *accrualActivities, PDRecordExternalActivityResponse *response); accrualActivities - The set of PDAccrualActivity instances representing each qualifying action that was submitted to earn loyalty points. response - Contains the set of recorded activity and status information related to the outcome of the call. |
Failure | void (^FetchRecordExternalActivityFailureBlock)( PDPaydiantError *loyaltyProgramError); |
Configure user error messages for this call with the key kUserErrorRecordExternalActivityDomain
.
Error | Description |
---|---|
403 |
The user must be logged in to make this call. |
404 |
The activity specified could not be found. |
500 |
An unknown error occurred internally in the server. |