Register Conversion
The endpoint POST /v1/convert
is used to register a new conversion for a referral.
In order to create a new conversion, you will need a referral to link it back to the partner who created it. If your flow does not require users to sign up for the conversion, you might create a new Referral using the POST /v1/referral
route and using the ID provided to create the conversion.
Request Body
-
referral_id
(string): The referral ID for the conversion. You can also use theexternal_id
instead, if you've register it in the Referral creation. -
event_type
(string): The type of event for the conversion. -
payload
(object): The payload containing the data to be converted.
If the request is being sent in the back-end, in order to enable the correct Fraud Detection checks, make sure to forward the headers sent from the front-end to correctly register them. The most important headers are:
-
REMOTE_ADDR
-> The IP Address of the client, make sure it's the IP sent by the client. If you use a internal proxy, you might have aX-FORWARDED-FOR
header with the client's IP forwarded by your proxy or theX-Real-IP
forwarded by external proxys. -
User-Agent
-> This is the User Agent of your client, if you cannot override theUser-Agent
in the Headers of your request, you can sent aX-User-Agent
instead with the client's User Agent.
/v1/convert
Authorization
Authorization
Required<token>In: header
Request Body
application/json
OptionalResponse Body
OK
TypeScript Definitions
Use the response body type in TypeScript.
response
Requiredstringcurl -X POST "https://api.nodiref.com/v1/convert" \
-H "Authorization: <token>" \
-H "Content-Type: application/json" \
-d '{
"referral_id": "9eed7027-ce39-4e55-9d0d-bb1ac5985a39",
"event_type": "subscription",
"payload": {
"amount": 79.98
}
}'
"string"