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 throws

Input Parameters 

ParameterTypeDescriptionRequired or Optional
promotionNameStringName of the promotion that the member wants to enroll into.Required
membershipNumberStringUnique identifier of the member.Required
versionStringVersion 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 

ParameterTypeDescription
memberIdStringThe ID of the member enrolled for the promotion.