Skip to content

Estimate fees for a hypothetical event

POST
/v1/events/estimate_fees

Estimate fees from a hypothetical event.

Aggregates current-period usage for the given metric, adds the hypothetical event’s contribution, and applies the charge model to return the estimated fee amount.

EstimateFeesRequest

Request body for fee estimation from a hypothetical event.

object
subscription_id
required
Subscription Id
string format: uuid
code
required
Code
string
properties
Properties
object
key
additional properties
any

Successful Response

EstimateFeesResponse

Response for fee estimation.

object
charge_model
Any of:
string
metric_code
required
Metric Code
string
units
required
Units
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
amount_cents
required
Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
unit_amount_cents
required
Unit Amount Cents
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/

Unauthorized – invalid or missing API key

Subscription or charge not found

Billable metric code does not exist