curl --request POST \
--url https://api.justpaid.io/api/v1/usage/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": []
}'import requests
url = "https://api.justpaid.io/api/v1/usage/ingest"
payload = { "events": [] }
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({events: []})
};
fetch('https://api.justpaid.io/api/v1/usage/ingest', 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.justpaid.io/api/v1/usage/ingest",
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([
'events' => [
]
]),
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.justpaid.io/api/v1/usage/ingest"
payload := strings.NewReader("{\n \"events\": []\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.justpaid.io/api/v1/usage/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/usage/ingest")
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 \"events\": []\n}"
response = http.request(request)
puts response.read_bodyIngest Event
Ingests a list of customer events, creating new events and identifying duplicates.
This endpoint processes a batch of customer events, checks for idempotency to prevent duplicates, and attempts to create new events in the system. It returns detailed information about the process, including the number of successfully created events, any duplicates identified, and errors encountered.
Parameters: request: The request object, which includes details about the HTTP request. This is typically provided by the FastAPI framework. customer_event_list (CustomerEventList): An object containing a list of customer events to be ingested. Each event must include an idempotency key to prevent duplicate processing.
Returns: A dictionary with two keys:
- ‘info’: A dictionary containing details about the ingestion process, including the number of events successfully created (‘created_events’) and a list of idempotency keys for events identified as duplicates (‘duplicates’).
- ‘errors’: A list of dictionaries, each representing an error encountered during the ingestion process. Each dictionary includes the ‘idempotency_key’ of the event that caused the error and a description of the error (‘error’).
curl --request POST \
--url https://api.justpaid.io/api/v1/usage/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"events": []
}'import requests
url = "https://api.justpaid.io/api/v1/usage/ingest"
payload = { "events": [] }
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({events: []})
};
fetch('https://api.justpaid.io/api/v1/usage/ingest', 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.justpaid.io/api/v1/usage/ingest",
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([
'events' => [
]
]),
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.justpaid.io/api/v1/usage/ingest"
payload := strings.NewReader("{\n \"events\": []\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.justpaid.io/api/v1/usage/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/usage/ingest")
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 \"events\": []\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Represents a list of customer events.
Attributes: events (list[CustomerEvent]): A list of customer events. Each event should be a dictionary with at-least the following keys: event_name, timestamp, idempotency_key.
Show child attributes
Show child attributes
Response
Detailed information about the customer event ingestion process.
Schema for the response of the customer event ingestion process.
Attributes: info (InfoSchema): Detailed information about the ingestion process, including the number of created events and duplicates. errors (list[ErrorSchema]): A list of errors that occurred during the ingestion process.
Was this page helpful?
