Create Referral Event
Create referral event records when an advocate refers a friend, or when
referred friends sign up or make a purchase.
This action is available in API version 60.0 and later for users with the Referral Marketing license.
Supported REST HTTP Methods
- URI
- /services/data/vXX.X/actions/standard/processReferralEvent
- Formats
- JSON
- HTTP Methods
- POST
- Authentication
- Authorization: Bearer token
Inputs
| Input | Details |
|---|---|
| activityDateTime |
|
| eventType |
|
| externalReferenceNumber |
|
| referralCode |
|
| referralContactId |
|
| referralEmail |
|
| referralFirstName |
|
| referralLastName |
|
| productId |
|
| purchaseAmount |
|
| purchaseQuantity |
|
Outputs
| Output | Details |
|---|---|
| contactId |
|
| referralId |
|
| referralStage |
|
| transactionJournalIds |
|
| voucherId |
|
Example
Sample Request
1{
2 "inputs":[
3 {
4 "referralCode":"referralCode-promotionCode",
5 "referralContactId":"003xx000004WkhEAAS",
6 "referralFirstName":"Michael",
7 "referralLastName":"Clare",
8 "referralEmail":"mclare@salesforce.com",
9 "activityDateTime":"2021-04-13T00:00:00",
10 "eventType":"Purchase",
11 "productId":"01txx0000006iGyAAI",
12 "purchaseAmount":40000,
13 "purchaseQuantity":34,
14 "externalReferenceNumber":"003xx00000000fxEAA"
15 }
16 ]
17}Sample Response
1[
2 {
3 "actionName":"processReferralEvent",
4 "errors":null,
5 "isSuccess":true,
6 "outputValues":{
7 "contactId":"003RM000008O9ZT",
8 "transactionJournalIds":[
9 "0lVRM0000002qtT",
10 "0lVRM0000002qtU"
11 ],
12 "referralId":"0wiRM0000004CPf",
13 "referralStage":"Friend Completes First Purchase",
14 "voucherId":"0kDRM0000004DZl2AM"
15 },
16 "version":1
17 }
18]