ReferralsRepository

The ReferralsRepository interface invokes and manages referral-related REST API requests. Use this class to interact with the Salesforce Referral Marketing APIs and manage referral-related operations.

The ReferralsRepository interface class provides these methods:

enrollNewCustomerAsAdvocateOfPromotion 

Enroll a new member to a given promotion.

1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollNewCustomerAsAdvocateOfPromotion(firstName = "John",
2                                                                                                        lastName = "Doe",
3                                                                                                        email = "john.doe@example.com",
4                                                                                                        promotionName  = "Referral Program",
5                                                                                                        promotionCode  = "PromoCode"
6                                                                                                    )

country 

Type: String

Description: The name of the country of the member.

email 

Type: String

Description: Required. The email ID of the member.

enrollmentChannel 

Type: String

Description: Channel used to join the referral program. Possible values are CallCenter, Email, Franchise, Mobile, Partner, Pos, Print, Social, Store, or Web. The default value is Email.

firstName 

Type: String

Description: Required. The first name of the member.

lastName 

Type: String

Description: Required. The last name of the member.

memberStatus 

Type: String

Description: Status of the new advocate after enrollment. Possible values are Active, Inactive, or a custom value defined in your org. For example, if an advocate must be evaluated before confirming enrollment, you can create a status called On Hold and assign it to this field. The default value is Active.

promotionName 

Type: String

Description: Required. The promotion name to enroll for.

promotionCode 

Type: String

Description: Required. The promotion code to enroll for.

state 

Type: String

Description: The name of the state of the member.

transactionalJournalFrequency 

Type: String

Description: Frequency at which transaction statements must be generated for the advocate. Possible values are Monthly or Quarterly. The default value is Monthly.

transactionalJournalMethod 

Type: String

Description: Preferred method of receiving transaction journal statements. Possible values are Email or Mail. The default value is Email.

enrollExistingAdvocateToPromotionWithMembershipNumber 

Enroll an existing member to a given promotion using the membership number.

1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollExistingAdvocateToPromotionWithMembershipNumber(
2                        promotionName = "Referral Program", promotionCode = "PromoCode", membershipNumber = "1234567890"
3                    )

promotionName 

Type: String

Description: Required. The promotion name to enroll for.

promotionCode 

Type: String

Description: Required. The promotion code to enroll for.

membershipNumber 

Type: String

Description: Required. The membership number of the existing member.

enrollExistingAdvocateToPromotionWithContactId 

Enroll an existing member to a given promotion using the contact ID.

1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollExistingAdvocateToPromotionWithContactId(
2                        promotionName = "Referral Program", promotionCode = "PromoCode", contactId = "0c12sed3456kpPl"
3                    )

promotionName 

Type: String

Description: Required. The promotion name to enroll for.

promotionCode 

Type: String

Description: Required. The promotion code to enroll for.

contactId 

Type: String

Description: Required. The contact ID of the existing member.

enrollExistingAdvocateToNewPromotion 

Enroll an existing member to a new promotion.

1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollExistingAdvocateToNewPromotion(
2                        promotionName = "Referral Program", promotionCode = "PromoCode""
3                    )

promotionName 

Type: String

Description: Required. The promotion name to enroll for.

promotionCode 

Type: String

Description: Required. The promotion code to enroll for.

sendReferrals 

Send referral emails to the given recipients.

1val eventOutput: ApiResponse<ReferralEventResponse> = repository.sendReferrals(referralCode = "ReferralCode", emails = listOf("john.doe@example.com")

referralCode 

Type: String

Description: Required. The referral code to share with the recipients.

emails 

Type: List<String>

Description: Required. A list of recipient emails to share the referral code with.