Get a referral code
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '<string>', program_id: '<string>'})
};
fetch('https://api.useautumn.com/v1/referrals/code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": "<string>",
"customer_id": "<string>",
"created_at": 123
}Referrals
Create a referral code
POST
/
referrals
/
code
Get a referral code
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '<string>', program_id: '<string>'})
};
fetch('https://api.useautumn.com/v1/referrals/code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": "<string>",
"customer_id": "<string>",
"created_at": 123
}This endpoint creates or retrieves a unique referral code for a customer within a specific referral program.
A referral code is unique per customer within each program. On the first call, a new code is created, but subsequent calls will return the same existing code for that customer and program combination.
The
program_id parameter refers to the referral program ID that you define when creating a referral program in the Autumn dashboard. Each program can have different rewards and rules.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I

