curl --request POST \
--url https://api.withorb.com/v1/prices/evaluate_preview_events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timeframe_start": "2023-11-07T05:31:56Z",
"timeframe_end": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"external_customer_id": "<string>",
"events": [],
"price_evaluations": []
}
'{
"data": [
{
"price_groups": [
{
"grouping_values": [
"<string>"
],
"quantity": 123,
"amount": "<string>"
}
],
"currency": "<string>",
"price_id": "<string>",
"external_price_id": "<string>",
"inline_price_index": 123
}
]
}This endpoint evaluates prices on preview events instead of actual usage, making it ideal for building price calculators and cost estimation tools. You can filter and group results using computed properties to analyze pricing across different dimensions.
Prices may either reference existing prices in your Orb account or be defined inline in the request body. The endpoint has the following limitations:
A top-level customer_id is required to evaluate the preview events. Additionally, all events without a customer_id will have the top-level customer_id added.
Note that this is a POST endpoint rather than a GET endpoint because it employs a JSON body rather than query parameters.
curl --request POST \
--url https://api.withorb.com/v1/prices/evaluate_preview_events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timeframe_start": "2023-11-07T05:31:56Z",
"timeframe_end": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"external_customer_id": "<string>",
"events": [],
"price_evaluations": []
}
'{
"data": [
{
"price_groups": [
{
"grouping_values": [
"<string>"
],
"quantity": 123,
"amount": "<string>"
}
],
"currency": "<string>",
"price_id": "<string>",
"external_price_id": "<string>",
"inline_price_index": 123
}
]
}API Keys can be issued in the Orb's web application.
The inclusive lower bound for event timestamps
The exclusive upper bound for event timestamps
The ID of the customer to which this evaluation is scoped.
The external customer ID of the customer to which this evaluation is scoped.
List of preview events to use instead of actual usage data
1 - 500 elementsShow child attributes
A name to meaningfully identify the action or event type.
An ISO 8601 format date with no timezone offset (i.e. UTC). This should represent the time that usage was recorded, and is particularly important to attribute usage to a given billing period.
A dictionary of custom properties. Values in this dictionary must be numeric, boolean, or strings. Nested dictionaries are disallowed.
The Orb Customer identifier
An alias for the Orb customer, whose mapping is specified when creating the customer
List of prices to evaluate (max 100)
1 - 100 elementsShow child attributes
The ID of a price to evaluate that exists in your Orb account.
An inline price definition to evaluate, allowing you to test price configurations before adding them to Orb.
Show child attributes
The pricing model type
unit The name of the price.
The id of the item the price will be associated with.
The cadence to bill for this price on.
annual, semi_annual, monthly, quarterly, one_time, custom An ISO 4217 currency string for which this price is billed in.
User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.
Show child attributes
An alias for the price.
For dimensional price: specifies a price group and dimension values
Show child attributes
The list of dimension values matching (in order) the dimensions of the price group
The id of the dimensional price group to include this price in
The external id of the dimensional price group to include this price in
The id of the billable metric for the price. Only needed if the price is usage-based.
If the Price represents a fixed cost, the price will be billed in-advance if this is true, and in-arrears if this is false.
If the Price represents a fixed cost, this represents the quantity of units applied.
The property used to group this price on an invoice
1For custom cadence: specifies the duration of the billing period in days or months.
Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle.
The per unit conversion rate of the price currency to the invoicing currency.
The configuration for the rate of the price currency to the invoicing currency.
Show child attributes
unit The external ID of a price to evaluate that exists in your Orb account.
A boolean computed property used to filter the underlying billable metric
"my_numeric_property > 100 AND my_other_property = 'bar'"
Properties (or computed properties) used to group the underlying billable metric
OK
Show child attributes
The computed price groups associated with input price.
Show child attributes
The currency of the price
The ID of the price
The external ID of the price
The index of the inline price
Was this page helpful?