Ingest billable event
curl --request POST \
--url https://ingest.hyperline.co/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "cus_CrqwefTRWBWRT",
"event_type": "api_call",
"timestamp": "2024-12-20T16:04:11Z",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": true
}
}
'import requests
url = "https://ingest.hyperline.co/v1/events"
payload = {
"customer_id": "cus_CrqwefTRWBWRT",
"event_type": "api_call",
"timestamp": "2024-12-20T16:04:11Z",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": True
}
}
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({
customer_id: 'cus_CrqwefTRWBWRT',
event_type: 'api_call',
timestamp: '2024-12-20T16:04:11Z',
record: {id: 'D32NAA8', durationInMs: 32, isVerified: true}
})
};
fetch('https://ingest.hyperline.co/v1/events', 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://ingest.hyperline.co/v1/events",
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([
'customer_id' => 'cus_CrqwefTRWBWRT',
'event_type' => 'api_call',
'timestamp' => '2024-12-20T16:04:11Z',
'record' => [
'id' => 'D32NAA8',
'durationInMs' => 32,
'isVerified' => true
]
]),
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://ingest.hyperline.co/v1/events"
payload := strings.NewReader("{\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"event_type\": \"api_call\",\n \"timestamp\": \"2024-12-20T16:04:11Z\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n }\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://ingest.hyperline.co/v1/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"event_type\": \"api_call\",\n \"timestamp\": \"2024-12-20T16:04:11Z\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ingest.hyperline.co/v1/events")
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 \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"event_type\": \"api_call\",\n \"timestamp\": \"2024-12-20T16:04:11Z\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n }\n}"
response = http.request(request)
puts response.read_bodyBillable events
Ingest billable event
Ingest a new billable event. This endpoint is idempotent, an event with the same id will be updated if it already exists.
POST
/
v1
/
events
Ingest billable event
curl --request POST \
--url https://ingest.hyperline.co/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "cus_CrqwefTRWBWRT",
"event_type": "api_call",
"timestamp": "2024-12-20T16:04:11Z",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": true
}
}
'import requests
url = "https://ingest.hyperline.co/v1/events"
payload = {
"customer_id": "cus_CrqwefTRWBWRT",
"event_type": "api_call",
"timestamp": "2024-12-20T16:04:11Z",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": True
}
}
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({
customer_id: 'cus_CrqwefTRWBWRT',
event_type: 'api_call',
timestamp: '2024-12-20T16:04:11Z',
record: {id: 'D32NAA8', durationInMs: 32, isVerified: true}
})
};
fetch('https://ingest.hyperline.co/v1/events', 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://ingest.hyperline.co/v1/events",
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([
'customer_id' => 'cus_CrqwefTRWBWRT',
'event_type' => 'api_call',
'timestamp' => '2024-12-20T16:04:11Z',
'record' => [
'id' => 'D32NAA8',
'durationInMs' => 32,
'isVerified' => true
]
]),
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://ingest.hyperline.co/v1/events"
payload := strings.NewReader("{\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"event_type\": \"api_call\",\n \"timestamp\": \"2024-12-20T16:04:11Z\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n }\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://ingest.hyperline.co/v1/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"event_type\": \"api_call\",\n \"timestamp\": \"2024-12-20T16:04:11Z\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ingest.hyperline.co/v1/events")
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 \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"event_type\": \"api_call\",\n \"timestamp\": \"2024-12-20T16:04:11Z\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Whether to simulate prices for the event. Will be received in webhooks.
Example:
true
Body
application/json
Event payload
Hyperline ID or external ID of the existing customer.
Example:
"cus_CrqwefTRWBWRT"
Type corresponding to the event. When creating a dynamic product, this type will be used to map the related events to specific prices.
Minimum string length:
1Example:
"api_call"
Payload of the event containing an ID and any additional metadata.
Show child attributes
Show child attributes
Example:
{
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": true
}
Response
201
Event ingested
Was this page helpful?
⌘I

