Referral Enrollment

Enroll an existing or new customer to a referral promotion.

Resource

1referralEnrollment(membershipNumber:promotionCode:memberStatus:version:devMode)
1referralEnrollment(contactID:promotionCode:memberStatus:version:devMode)
1referralEnrollment(firstName:lastName:email:membershipNumber:promotionCode:enrollmentChannel:memberStatus:tjStatementFrequency:tjStatementMethod:version:devMode)

Signature

1public func referralEnrollment(membershipNumber: String,
2                                   promotionCode: String,
3                                   memberStatus: String = MemberStatus.active.rawValue,
4                                   version: String = ReferralAPIVersion.defaultVersion,
5                                   devMode: Bool = false) async throws -> ReferralEnrollmentOutputModel
1public func referralEnrollment(contactID: String,
2                                   promotionCode: String,
3                                   memberStatus: String = MemberStatus.active.rawValue,
4                                   version: String = ReferralAPIVersion.defaultVersion,
5                                   devMode: Bool = false) async throws -> ReferralEnrollmentOutputModel
1public func referralEnrollment(firstName: String,
2                                   lastName: String,
3                                   email: String,
4                                   membershipNumber: String,
5                                   promotionCode: String,
6                                   enrollmentChannel: ReferralEnrollmentChannel = ReferralEnrollmentChannel.mobile,
7                                   memberStatus: String = MemberStatus.active.rawValue,
8                                   tjStatementFrequency: TransactionJournalStatementFrequency = .monthly,
9                                   tjStatementMethod: TransactionJournalStatementMethod = .email,
10                                   version: String = ReferralAPIVersion.defaultVersion,
11                                   devMode: Bool = false) async throws -> ReferralEnrollmentOutputModel

Input Parameters

Parameter Type Description
contactID String Required. The contact ID of the existing member. Provide either the contact ID, the membership number, or the person account details (first name, last name, and email), and not all.
country String The name of the country of the member.
devMode Boolean Indicates whether the method is run in the developer mode (true) or not (false).
email String Required. The email ID of the member. Provide either the contact ID, the membership number, or the person account details (first name, last name, and email), and not all.
enrollmentChannel String Channel used to join the referral program. Possible values are:
  • CallCenter
  • Email
  • Franchise
  • Mobile
  • Partner
  • Pos
  • Print
  • Social
  • Store
  • Web
The default value is Email.
firstName String Required. The first name of the member. Provide either the contact ID, the membership number, or the person account details (first name, last name, and email), and not all.
lastName String Required. The last name of the member. Provide either the contact ID, the membership number, or the person account details (first name, last name, and email), and not all.
memberStatus String Status of the new advocate after enrollment.

Possible values are:

  • Active
  • Inactive
  • Custom value - Any 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.
membershipNumber String Required. The membership number of the existing member. Provide either the contact ID, the membership number, or the person account details (first name, last name, and email), and not all.
promotionCode String Required. The promotion code to enroll for.
state String The name of the state of the member.
transactionalJournalFrequency String Frequency at which transaction statements must be generated for the advocate.

Possible values are:

  • Monthly
  • Quarterly
The default value is Monthly.
transactionalJournalMethod String Preferred method of receiving transaction journal statements.

Possible values are:

  • Email
  • Mail
The default value is Email.
version String The API version.

Return Value

ReferralEnrollmentOutputModel instance.

1public struct ReferralEnrollmentOutputModel: Codable

Sample Output

1{
2  "contactId": "003RO000003vJeU",
3  "memberId": "0lMRO00000000nO",
4  "membershipNumber": "DemoJun21",
5  "programName": "DemoProgram",
6  "promotionReferralCode": "ZB74ANSO-DemoPromo1",
7  "transactionJournals": [
8    {
9      "activityDate": "2023-06-21T13:37:26.000Z",
10      "journalSubType": "Member Enrollment",
11      "journalType": "Referral",
12      "membershipNumber": "DemoJun21",
13      "programName": "DemoProgram",
14      "status": "Processed",
15      "transactionJournalId": "0lVRO00000002wV"
16    }
17  ]
18}

Output Parameters

Referral Advocate Enrollment