Attributes
- objectstring
String representing the object’s type. Objects of the same type share the same value.
- cancelnullable object
Specifies which event to cancel.
- event_
namestring The name of the meter event. Corresponds with the
event_
field on a meter.name - livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - statusenum
The meter event adjustment’s status.
Possible enum valuescomplete
The event adjustment has been processed.
pending
The event adjustment is still being processed.
- typeenum
Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
Possible enum valuescancel
Cancel a single meter event by identifier.
{ "object": "billing.meter_event_adjustment", "livemode": false, "status": "pending", "event_name": "ai_search_api", "type": "cancel", "cancel": { "identifier": "identifier_123" }}
Creates a billing meter event adjustment.
Parameters
- event_
namestringRequired The name of the meter event. Corresponds with the
event_
field on a meter.name - typeenumRequired
Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
Possible enum valuescancel
Cancel a single meter event by identifier.
- cancelobject
Specifies which event to cancel.
Returns
Returns a billing meter event adjustment.
{ "object": "billing.meter_event_adjustment", "livemode": false, "status": "pending", "event_name": "ai_search_api", "type": "cancel", "cancel": { "identifier": "identifier_123" }}
A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer.
You can send a higher-throughput of meter events using meter event streams. For this flow, you must first create a meter event session, which will provide you with a session token. You can then create meter events through the meter event stream endpoint, using the session token for authentication. The session tokens are short-lived and you will need to create a new meter event session when the token expires.
A billing meter event summary represents an aggregated view of a customer’s billing meter events within a specified timeframe. It indicates how much usage was accrued by a customer for that period.
Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.