POST
/
v1
/
events
/
simulate-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"
}'
{
  "id": "cal_1234567890",
  "result": [
    {
      "customer_id": "<string>",
      "subscription_id": "<string>",
      "product_id": "itm_AweveQEoewer",
      "price_group": {
        "id": "grp_QalW2vTAdkR6IY",
        "name": "mastercard"
      },
      "amount_excluding_tax": 10000,
      "tax_amount": 2000,
      "total_amount": 12000,
      "currency": "EUR"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

product_id
string

Hyperline ID of the product.

Example:

"itm_AweveQEoewer"

subscription_id
string

Hyperline ID of the subscription.

Example:

"sub_QalW2vTAdkR6IY"

include_tax
boolean | null

Whether to include amounts with tax

Example:

true

Body

application/json
Event payload
event_type
string
required

Type corresponding to the event. When creating a dynamic product, this type will be used to map the related events to specific prices.

Example:

"api_call"

record
object
required

Payload of the event containing an ID and any additional metadata.

Example:
{
  "id": "D32NAA8",
  "durationInMs": 32,
  "isVerified": true
}
customer_id
string

Hyperline ID or external ID of the existing customer.

Example:

"cus_CrqwefTRWBWRT"

timestamp
string

UTC date time string in the ISO 8601 format, or milliseconds since the epoch. The event timestamp is used to retrieve the events related to a specific billing period.

Example:

"2024-12-20T16:04:11Z"

Response

200 - application/json
Event prices simulated
id
string
required

ID of the calculation.

Example:

"cal_1234567890"

result
object[]
required