Attribute a referral code
curl --request POST \
--url https://api.unitedmarket.ai/referral/attribution \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "UM-7ZAFAB8F"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'UM-7ZAFAB8F'})
};
fetch('https://api.unitedmarket.ai/referral/attribution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.unitedmarket.ai/referral/attribution"
payload = { "code": "UM-7ZAFAB8F" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"changed": true,
"referredBy": "<string>"
}{
"message": "<string>",
"error": "Unauthorized",
"statusCode": 401
}Referral
Attribute a referral code
Records first-touch referral attribution for the authenticated user. Idempotent; self-referral and invalid codes are rejected. Requires SIWE bearer auth.
POST
https://api.unitedmarket.ai
/
referral
/
attribution
Attribute a referral code
curl --request POST \
--url https://api.unitedmarket.ai/referral/attribution \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "UM-7ZAFAB8F"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'UM-7ZAFAB8F'})
};
fetch('https://api.unitedmarket.ai/referral/attribution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.unitedmarket.ai/referral/attribution"
payload = { "code": "UM-7ZAFAB8F" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"changed": true,
"referredBy": "<string>"
}{
"message": "<string>",
"error": "Unauthorized",
"statusCode": 401
}Authorizations
SIWE access token returned by POST /auth/verify.
Body
application/json
Referral code to attribute the authenticated user to.
Maximum string length:
32Example:
"UM-7ZAFAB8F"
