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
{
"inputs":[
{
"referralCode":"referralCode-promotionCode",
"referralContactId":"003xx000004WkhEAAS",
"referralFirstName":"Michael",
"referralLastName":"Clare",
"referralEmail":"mclare@salesforce.com",
"activityDateTime":"2021-04-13T00:00:00",
"eventType":"Purchase",
"productId":"01txx0000006iGyAAI",
"purchaseAmount":40000,
"purchaseQuantity":34,
"externalReferenceNumber":"003xx00000000fxEAA"
}
]
}
Sample Response
[
{
"actionName":"processReferralEvent",
"errors":null,
"isSuccess":true,
"outputValues":{
"contactId":"003RM000008O9ZT",
"transactionJournalIds":[
"0lVRM0000002qtT",
"0lVRM0000002qtU"
],
"referralId":"0wiRM0000004CPf",
"referralStage":"Friend Completes First Purchase",
"voucherId":"0kDRM0000004DZl2AM"
},
"version":1
}
]