referralRecordCreate
mutation
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Create a referral relationship between the referrer and the invitee based on the referral code.
Arguments
Return
The errors that occur when creating a referral relationship.
The referrer information.
The invitee information.
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Create a referral relationship between the referrer and the invitee
Code
mutation referralRecordCreate {
referralRecordCreate(customerAccessToken:"tokenxxx",senderReferralCode:"7M**")
{
senderCustomer{
customerId
email
phone
firstName
lastName
levelName
levelCode
referralUrl
referralCode
},
receiverCustomer{
customerId
email
phone
firstName
lastName
levelName
levelCode
referralUrl
referralCode
}
}
}
Response
{
"data": {
"referralRecordCreate": {
"receiverCustomer": {
"lastName": "li",
"levelCode": "gid://shopline/Membership/MLC644317****",
"levelName": "middle",
"referralCode": "G6***",
"customerId": "gid://shopline/Customer/46037****",
"email": "***@qq.com",
"firstName": "zha**",
"phone": "0086135604****",
"referralUrl": "https://****.myshopline.com/user/signUp?referral_code=G6***&source_type=member_plugin_referral&slt=member_plugin_referral"
},
"senderCustomer": {
"email": "***@qq.com",
"firstName": "zha**",
"customerId": "gid://shopline/Customer/420010****",
"lastName": "mian***",
"levelCode": "gid://shopline/Membership/MLC6443****",
"levelName": "middle",
"phone": "0086135604****",
"referralCode": "7M***",
"referralUrl": "https://***.myshopline.com/user/signUp?referral_code=7M2***&source_type=member_plugin_referral&slt=member_plugin_referral"
}
}
}
}
Was this article helpful to you?