Referrals
Churn Referral
Marks a referral as churned, so it no longer counts as an active paying referral. Use this when a referral cancels their subscription. Identify the referral by your own referral_uid, the referral’s referral_email, or the Reditus referral_id - the same identifiers you use when creating a payment. If the referral pays again afterwards, sending a new payment automatically reactivates it, so no history is lost.
POST
/
v1
/
referrals
/
churn
Churn Referral
curl --request POST \
--url https://api.getreditus.com/api/v1/referrals/churn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"referral_uid": "<string>",
"referral_email": "<string>",
"referral_id": "<string>"
}
'import requests
url = "https://api.getreditus.com/api/v1/referrals/churn"
payload = {
"referral_uid": "<string>",
"referral_email": "<string>",
"referral_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({referral_uid: '<string>', referral_email: '<string>', referral_id: '<string>'})
};
fetch('https://api.getreditus.com/api/v1/referrals/churn', 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.getreditus.com/api/v1/referrals/churn",
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([
'referral_uid' => '<string>',
'referral_email' => '<string>',
'referral_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.getreditus.com/api/v1/referrals/churn"
payload := strings.NewReader("{\n \"referral_uid\": \"<string>\",\n \"referral_email\": \"<string>\",\n \"referral_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.getreditus.com/api/v1/referrals/churn")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"referral_uid\": \"<string>\",\n \"referral_email\": \"<string>\",\n \"referral_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getreditus.com/api/v1/referrals/churn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"referral_uid\": \"<string>\",\n \"referral_email\": \"<string>\",\n \"referral_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "<string>",
"attributes": {
"email": "<string>",
"state": "<string>",
"state_set_at": 123,
"created_at": 123,
"updated_at": 123
}
}
}{
"errors": [
{
"title": "Bad Request",
"details": "Validation failed: one of referral_uid, referral_id or referral_email is required"
}
]
}{
"errors": [
{
"title": "Not Found",
"details": "Referral not found"
}
]
}{
"errors": [
{
"title": "Unprocessable entity",
"details": "Referral in state 'clicked' cannot be churned"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Provide at least one identifier. They are matched in order: referral_uid, then referral_id, then referral_email.
Response
Referral was marked as churned
Show child attributes
Show child attributes
⌘I
Churn Referral
curl --request POST \
--url https://api.getreditus.com/api/v1/referrals/churn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"referral_uid": "<string>",
"referral_email": "<string>",
"referral_id": "<string>"
}
'import requests
url = "https://api.getreditus.com/api/v1/referrals/churn"
payload = {
"referral_uid": "<string>",
"referral_email": "<string>",
"referral_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({referral_uid: '<string>', referral_email: '<string>', referral_id: '<string>'})
};
fetch('https://api.getreditus.com/api/v1/referrals/churn', 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.getreditus.com/api/v1/referrals/churn",
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([
'referral_uid' => '<string>',
'referral_email' => '<string>',
'referral_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.getreditus.com/api/v1/referrals/churn"
payload := strings.NewReader("{\n \"referral_uid\": \"<string>\",\n \"referral_email\": \"<string>\",\n \"referral_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.getreditus.com/api/v1/referrals/churn")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"referral_uid\": \"<string>\",\n \"referral_email\": \"<string>\",\n \"referral_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getreditus.com/api/v1/referrals/churn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"referral_uid\": \"<string>\",\n \"referral_email\": \"<string>\",\n \"referral_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "<string>",
"attributes": {
"email": "<string>",
"state": "<string>",
"state_set_at": 123,
"created_at": 123,
"updated_at": 123
}
}
}{
"errors": [
{
"title": "Bad Request",
"details": "Validation failed: one of referral_uid, referral_id or referral_email is required"
}
]
}{
"errors": [
{
"title": "Not Found",
"details": "Referral not found"
}
]
}{
"errors": [
{
"title": "Unprocessable entity",
"details": "Referral in state 'clicked' cannot be churned"
}
]
}