Create Referral
Create Referral
The POST /v1/referral
endpoint is used to create a new referral with the provided tracking ID.
A Referral is used to simulate a user in your platform in order to better track the conversions, you should create a referral when a user signs up after using a Partner's link/code.
Request Body
-
tracking_id
(string, required): The unique tracking ID for the referral. You can get this Tracking ID from the click event registered in theGET /v1/:code/hit
route. -
external_id
(string, optional): This is the ID of the user in your platform, it is not required, but strongly recommended in order to make the relation easier and better track the users, you can either send us theexternal_id
or save the referral ID in your platform to maintain the relationship. -
user_agent
(string, optional): The user's user_agent when signing up. -
ip_address
-> The user's IP Address when signing up
If you are creating the referral from your back-end, it is strongly recommended to send the user's user_agent
and ip_address
in order to have better results in the Fraud Detection System, if you are sending it from the front-end or using our SDK, we'll automatically get all headers needed from the client.
Response
Upon successful creation, the API returns a status code of 200 and a JSON object with the referral_id
field.
Example Response:
/v1/referral
Authorization
Authorization
Required<token>In: header
Request Body
application/json
OptionalResponse Body
OK
TypeScript Definitions
Use the response body type in TypeScript.
curl -X POST "https://api.nodiref.com/v1/referral" \
-H "Authorization: <token>" \
-H "Content-Type: application/json" \
-d '{
"tracking_id": "6a0a2f16-647e-4ff4-8705-930e74800f6b"
}'
{
"referral_id": "9ed33f2d-c395-404a-88a3-d8c9e830f4b0"
}