Report a conversion (no Stripe)
curl --request POST \
--url https://api.referralful.com/v1/conversions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_cents": 123,
"referral_id": "<string>",
"email": "<string>",
"coupon": "<string>",
"currency": "<string>",
"external_id": "<string>",
"customer_name": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.referralful.com/v1/conversions"
payload = {
"amount_cents": 123,
"referral_id": "<string>",
"email": "<string>",
"coupon": "<string>",
"currency": "<string>",
"external_id": "<string>",
"customer_name": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount_cents: 123,
referral_id: '<string>',
email: '<string>',
coupon: '<string>',
currency: '<string>',
external_id: '<string>',
customer_name: '<string>',
occurred_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.referralful.com/v1/conversions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.referralful.com/v1/conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount_cents' => 123,
'referral_id' => '<string>',
'email' => '<string>',
'coupon' => '<string>',
'currency' => '<string>',
'external_id' => '<string>',
'customer_name' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.referralful.com/v1/conversions"
payload := strings.NewReader("{\n \"amount_cents\": 123,\n \"referral_id\": \"<string>\",\n \"email\": \"<string>\",\n \"coupon\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.referralful.com/v1/conversions")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount_cents\": 123,\n \"referral_id\": \"<string>\",\n \"email\": \"<string>\",\n \"coupon\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.referralful.com/v1/conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_cents\": 123,\n \"referral_id\": \"<string>\",\n \"email\": \"<string>\",\n \"coupon\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "<string>",
"duplicate": true,
"sale_id": "<string>",
"commission": {
"id": "<string>",
"object": "commission",
"currency": "<string>",
"amount": 123,
"due_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"campaign_id": "<string>",
"affiliate_id": "<string>"
}
}{
"error": "<string>"
}API Reference
Report a conversion (no Stripe)
Record a sale from any billing system and create the affiliate commission. Provide at least one of referral_id, email, or coupon.
POST
/
conversions
Report a conversion (no Stripe)
curl --request POST \
--url https://api.referralful.com/v1/conversions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_cents": 123,
"referral_id": "<string>",
"email": "<string>",
"coupon": "<string>",
"currency": "<string>",
"external_id": "<string>",
"customer_name": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.referralful.com/v1/conversions"
payload = {
"amount_cents": 123,
"referral_id": "<string>",
"email": "<string>",
"coupon": "<string>",
"currency": "<string>",
"external_id": "<string>",
"customer_name": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount_cents: 123,
referral_id: '<string>',
email: '<string>',
coupon: '<string>',
currency: '<string>',
external_id: '<string>',
customer_name: '<string>',
occurred_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.referralful.com/v1/conversions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.referralful.com/v1/conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount_cents' => 123,
'referral_id' => '<string>',
'email' => '<string>',
'coupon' => '<string>',
'currency' => '<string>',
'external_id' => '<string>',
'customer_name' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.referralful.com/v1/conversions"
payload := strings.NewReader("{\n \"amount_cents\": 123,\n \"referral_id\": \"<string>\",\n \"email\": \"<string>\",\n \"coupon\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.referralful.com/v1/conversions")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount_cents\": 123,\n \"referral_id\": \"<string>\",\n \"email\": \"<string>\",\n \"coupon\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.referralful.com/v1/conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_cents\": 123,\n \"referral_id\": \"<string>\",\n \"email\": \"<string>\",\n \"coupon\": \"<string>\",\n \"currency\": \"<string>\",\n \"external_id\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"object": "<string>",
"duplicate": true,
"sale_id": "<string>",
"commission": {
"id": "<string>",
"object": "commission",
"currency": "<string>",
"amount": 123,
"due_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"campaign_id": "<string>",
"affiliate_id": "<string>"
}
}{
"error": "<string>"
}Authorizations
Use your API secret as the username, with an empty password.
Body
application/json
⌘I
