Simulate billable event prices
curl --request POST \
--url https://ingest.hyperline.co/v1/events/simulate-prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_type": "api_call",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": true
},
"customer_id": "cus_CrqwefTRWBWRT",
"timestamp": "2024-12-20T16:04:11Z"
}
'import requests
url = "https://ingest.hyperline.co/v1/events/simulate-prices"
payload = {
"event_type": "api_call",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": True
},
"customer_id": "cus_CrqwefTRWBWRT",
"timestamp": "2024-12-20T16:04:11Z"
}
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({
event_type: 'api_call',
record: {id: 'D32NAA8', durationInMs: 32, isVerified: true},
customer_id: 'cus_CrqwefTRWBWRT',
timestamp: '2024-12-20T16:04:11Z'
})
};
fetch('https://ingest.hyperline.co/v1/events/simulate-prices', 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/simulate-prices",
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([
'event_type' => 'api_call',
'record' => [
'id' => 'D32NAA8',
'durationInMs' => 32,
'isVerified' => true
],
'customer_id' => 'cus_CrqwefTRWBWRT',
'timestamp' => '2024-12-20T16:04:11Z'
]),
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/simulate-prices"
payload := strings.NewReader("{\n \"event_type\": \"api_call\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n },\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"timestamp\": \"2024-12-20T16:04:11Z\"\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/simulate-prices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"api_call\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n },\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"timestamp\": \"2024-12-20T16:04:11Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ingest.hyperline.co/v1/events/simulate-prices")
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 \"event_type\": \"api_call\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n },\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"timestamp\": \"2024-12-20T16:04:11Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cal_1234567890",
"result": [
{
"product_id": "itm_AweveQEoewer",
"amount_excluding_tax": 10000,
"currency": "EUR",
"customer_id": "<string>",
"subscription_id": "<string>",
"price_group": {
"id": "grp_QalW2vTAdkR6IY",
"name": "mastercard"
},
"tax_amount": 2000,
"total_amount": 12000
}
]
}Billable events
Simulate billable event prices
Simulate prices for a single billable event without ingesting it.
POST
/
v1
/
events
/
simulate-prices
Simulate billable event prices
curl --request POST \
--url https://ingest.hyperline.co/v1/events/simulate-prices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_type": "api_call",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": true
},
"customer_id": "cus_CrqwefTRWBWRT",
"timestamp": "2024-12-20T16:04:11Z"
}
'import requests
url = "https://ingest.hyperline.co/v1/events/simulate-prices"
payload = {
"event_type": "api_call",
"record": {
"id": "D32NAA8",
"durationInMs": 32,
"isVerified": True
},
"customer_id": "cus_CrqwefTRWBWRT",
"timestamp": "2024-12-20T16:04:11Z"
}
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({
event_type: 'api_call',
record: {id: 'D32NAA8', durationInMs: 32, isVerified: true},
customer_id: 'cus_CrqwefTRWBWRT',
timestamp: '2024-12-20T16:04:11Z'
})
};
fetch('https://ingest.hyperline.co/v1/events/simulate-prices', 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/simulate-prices",
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([
'event_type' => 'api_call',
'record' => [
'id' => 'D32NAA8',
'durationInMs' => 32,
'isVerified' => true
],
'customer_id' => 'cus_CrqwefTRWBWRT',
'timestamp' => '2024-12-20T16:04:11Z'
]),
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/simulate-prices"
payload := strings.NewReader("{\n \"event_type\": \"api_call\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n },\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"timestamp\": \"2024-12-20T16:04:11Z\"\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/simulate-prices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"api_call\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n },\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"timestamp\": \"2024-12-20T16:04:11Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ingest.hyperline.co/v1/events/simulate-prices")
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 \"event_type\": \"api_call\",\n \"record\": {\n \"id\": \"D32NAA8\",\n \"durationInMs\": 32,\n \"isVerified\": true\n },\n \"customer_id\": \"cus_CrqwefTRWBWRT\",\n \"timestamp\": \"2024-12-20T16:04:11Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cal_1234567890",
"result": [
{
"product_id": "itm_AweveQEoewer",
"amount_excluding_tax": 10000,
"currency": "EUR",
"customer_id": "<string>",
"subscription_id": "<string>",
"price_group": {
"id": "grp_QalW2vTAdkR6IY",
"name": "mastercard"
},
"tax_amount": 2000,
"total_amount": 12000
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Hyperline ID of the product.
Example:
"itm_AweveQEoewer"
Hyperline ID of the subscription.
Example:
"sub_QalW2vTAdkR6IY"
Whether to include amounts with tax
Example:
true
Body
application/json
Event payload
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
}
Hyperline ID or external ID of the existing customer.
Example:
"cus_CrqwefTRWBWRT"
Was this page helpful?
⌘I

