Push revenue event
curl --request POST \
--url https://api.sendx.io/api/v1/rest/events/revenue \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"amount": 99.99,
"identifier": "customer@example.com",
"source": "website",
"time": 1669990400
}
'import requests
url = "https://api.sendx.io/api/v1/rest/events/revenue"
payload = {
"amount": 99.99,
"identifier": "customer@example.com",
"source": "website",
"time": 1669990400
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 99.99,
identifier: 'customer@example.com',
source: 'website',
time: 1669990400
})
};
fetch('https://api.sendx.io/api/v1/rest/events/revenue', 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.sendx.io/api/v1/rest/events/revenue",
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' => 99.99,
'identifier' => 'customer@example.com',
'source' => 'website',
'time' => 1669990400
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <api-key>"
],
]);
$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.sendx.io/api/v1/rest/events/revenue"
payload := strings.NewReader("{\n \"amount\": 99.99,\n \"identifier\": \"customer@example.com\",\n \"source\": \"website\",\n \"time\": 1669990400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ApiKey", "<api-key>")
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.sendx.io/api/v1/rest/events/revenue")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 99.99,\n \"identifier\": \"customer@example.com\",\n \"source\": \"website\",\n \"time\": 1669990400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/events/revenue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 99.99,\n \"identifier\": \"customer@example.com\",\n \"source\": \"website\",\n \"time\": 1669990400\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Event tracked successfully"
}{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}{
"status": "error",
"message": "Request body is not in proper format"
}{
"status": "error",
"message": "Internal server error occurred"
}Events
Push revenue event
Records revenue events for analytics and attribution.
POST
/
events
/
revenue
Push revenue event
curl --request POST \
--url https://api.sendx.io/api/v1/rest/events/revenue \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"amount": 99.99,
"identifier": "customer@example.com",
"source": "website",
"time": 1669990400
}
'import requests
url = "https://api.sendx.io/api/v1/rest/events/revenue"
payload = {
"amount": 99.99,
"identifier": "customer@example.com",
"source": "website",
"time": 1669990400
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 99.99,
identifier: 'customer@example.com',
source: 'website',
time: 1669990400
})
};
fetch('https://api.sendx.io/api/v1/rest/events/revenue', 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.sendx.io/api/v1/rest/events/revenue",
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' => 99.99,
'identifier' => 'customer@example.com',
'source' => 'website',
'time' => 1669990400
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <api-key>"
],
]);
$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.sendx.io/api/v1/rest/events/revenue"
payload := strings.NewReader("{\n \"amount\": 99.99,\n \"identifier\": \"customer@example.com\",\n \"source\": \"website\",\n \"time\": 1669990400\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ApiKey", "<api-key>")
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.sendx.io/api/v1/rest/events/revenue")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 99.99,\n \"identifier\": \"customer@example.com\",\n \"source\": \"website\",\n \"time\": 1669990400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/events/revenue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 99.99,\n \"identifier\": \"customer@example.com\",\n \"source\": \"website\",\n \"time\": 1669990400\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Event tracked successfully"
}{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}{
"status": "error",
"message": "Request body is not in proper format"
}{
"status": "error",
"message": "Internal server error occurred"
}🎯 Key Features:
- Track purchase events
- Revenue attribution
- Custom properties
- Analytics integration
Authorizations
Team API key for authentication. Find your API key in SendX Settings → Team API Key.
Example:
X-Team-ApiKey: your_team_api_key_here
Body
application/json
Revenue amount
Example:
99.99
Contact email address
Example:
"customer@example.com"
Source of the revenue event
Example:
"website"
Unix timestamp (in seconds since January 1, 1970) representing when the event occurred.
Example:
1669990400
Was this page helpful?
⌘I