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.
Enroll for Promotions
Enroll loyalty program member to a promotion, while asynchronously sending data to
the Enroll for Promotions API.
Resource
1enrollIn(promotion:for:version:)Signature
1public func enrollIn(
2 promotionName: String,
3 membershipNumber: String,
4 version: String = LoyaltyAPIVersion.defaultVersion) async throwsInput Parameters
| Parameter | Type | Description | Required or Optional |
|---|---|---|---|
| promotionName | String | Name of the promotion that the member wants to enroll into. | Required |
| membershipNumber | String | Unique identifier of the member. | Required |
| version | String | Version of the API. The request body is available in version 55.0 and later. | Optional |
Sample Output
1{
2 "message": null,
3 "outputParameters": {
4 "outputParameters": {
5 "results": [
6 {
7 "MemberId": "1lp4x00000002ffAAA"
8 }
9 ]
10 }
11 },
12 "simulationDetails": {},
13 "status": true
14}Output Parameter
| Parameter | Type | Description |
|---|---|---|
| memberId | String | The ID of the member enrolled for the promotion. |