Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Individual Member Enrollments
Enroll an individual member in a loyalty program, while asynchronously sending data to
the Individual Member Enrollments API.
Resource
1postEnrollment(membershipNumber:firstName:lastName:email:phone:emailNotification:version:)Signature
1public func postEnrollment(
2 membershipNumber: String,
3 firstName: String,
4 lastName: String,
5 email: String,
6 phone: String,
7 emailNotification: Bool,
8 version: String = LoyaltyAPIVersion.defaultVersion) async throws -> EnrollmentOutputModelInput Parameters
| Parameter | Type | Description | Required or Optional |
|---|---|---|---|
| String | Email address of the member being enrolled. | Required | |
| emailNotification | Boolean | Indicates whether the member wants to receive email notifications ((true)) or not ((false)). | Required |
| firstName | String | First name of the member being enrolled. | Required |
| lastName | String | Last name of the member being enrolled. | Required |
| membershipNumber | String | Membership number of the member being enrolled. | Required |
| phone | String | Phone number of the member being enrolled. | Required |
| version | String | Version of the API. The request body is available in version 55.0 and later. | Optional |
Return Value
An EnrollmentOutputModel instance of type:
1public struct EnrollmentOutputModel : CodableSample Output
1{
2 "contactId": "0034x00001JdPg6",
3 "loyaltyProgramMemberId": "0lM4x000000LOrM",
4 "loyaltyProgramName": "NTO Insider",
5 "membershipNumber": "Member2",
6 "transactionJournals": [
7 {
8 "activityDate": "2022-01-01T08:00:00.000Z",
9 "journalSubType": "Member Enrollment",
10 "journalType": "Accrual",
11 "loyaltyProgram": "NTO Insider",
12 "loyaltyProgramMember": "Member2",
13 "referredMember": null,
14 "status": "Pending",
15 "transactionJournalId": "0lV4x000000CcBF"
16 }
17 ]
18}Output Parameters
| Parameter | Type | Description |
|---|---|---|
| activityDate | String | The date and time of when transaction journal is created. |
| contactId | String | The ID of the loyalty program member’s person account. |
| journalSubType | String | The journal subtype of the transaction journal. |
| journalType | String | The journal type of the transaction journal. |
| loyaltyProgram | String | The loyalty program related with the transaction journal. |
| loyaltyProgramMember | String | The membership number of the loyalty program related to the transaction journal. |
| loyaltyProgramMemberId | String | The ID of the loyalty program member record created for the member. |
| loyaltyProgramName | String | The name of the loyalty program into which the member is enrolled. |
| membershipNumber | String | The membership number of the enrolled member. |
| referredMember | String | The membership number of the loyalty program member who has been referred by the member. |
| status | String | The status of the transaction journal. |
| transactionJournalId | String | The ID of the transaction journal that is created. |