Updates a billing meter.
Parameters
- idstringRequired
Unique identifier for the object.
- display_
namestring The meter’s name. Not visible to the customer.
Returns
Returns a billing meter.
{ "id": "mtr_123", "object": "billing.meter", "created": 1704824589, "customer_mapping": { "type": "by_id", "event_payload_key": "stripe_customer_id" }, "default_aggregation": { "formula": "sum" }, "display_name": "Updated Display Name", "event_name": "ai_search_api", "event_time_window": null, "livemode": false, "status": "active", "status_transitions": { "deactivated_at": null }, "updated": 1704898330, "value_settings": { "event_payload_key": "value" }}
Retrieves a billing meter given an ID.
Parameters
- idstringRequired
Unique identifier for the object.
Returns
Returns a billing meter.
{ "id": "mtr_123", "object": "billing.meter", "created": 1704824589, "customer_mapping": { "type": "by_id", "event_payload_key": "stripe_customer_id" }, "default_aggregation": { "formula": "sum" }, "display_name": "Search API Calls", "event_name": "ai_search_api", "event_time_window": null, "livemode": false, "status": "active", "status_transitions": { "deactivated_at": null }, "updated": 1704898330, "value_settings": { "event_payload_key": "value" }}
Retrieve a list of billing meters.
Parameters
- statusenum
Filter results to only include meters with the given status.
Possible enum valuesactive
The meter is active.
inactive
The meter is inactive. No more events for this meter will be accepted. The meter cannot be attached to a price.
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
Returns a list of billing meters.
{ "object": "list", "data": [ { "id": "mtr_123", "object": "billing.meter", "created": 1704824589, "customer_mapping": { "type": "by_id", "event_payload_key": "stripe_customer_id" }, "default_aggregation": { "formula": "sum" }, "display_name": "Search API Calls", "event_name": "ai_search_api", "event_time_window": null, "livemode": false, "status": "active", "status_transitions": { "deactivated_at": null }, "updated": 1704898330, "value_settings": { "event_payload_key": "value" } } ], "has_more": true, "url": "v1/billing/meters"}
When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.
Parameters
- idstringRequired
Unique identifier for the object.
Returns
Returns a billing meter.
{ "id": "mtr_123", "object": "billing.meter", "created": 1704824589, "customer_mapping": { "type": "by_id", "event_payload_key": "stripe_customer_id" }, "default_aggregation": { "formula": "sum" }, "display_name": "Search API Calls", "event_name": "ai_search_api", "event_time_window": null, "livemode": false, "status": "active", "status_transitions": { "deactivated_at": 1704898330 }, "updated": 1704898330, "value_settings": { "event_payload_key": "value" }}
When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.
Parameters
- idstringRequired
Unique identifier for the object.
Returns
Returns a billing meter.
{ "id": "mtr_123", "object": "billing.meter", "created": 1704824589, "customer_mapping": { "type": "by_id", "event_payload_key": "stripe_customer_id" }, "default_aggregation": { "formula": "sum" }, "display_name": "Search API Calls", "event_name": "ai_search_api", "event_time_window": null, "livemode": false, "status": "active", "status_transitions": { "deactivated_at": null }, "updated": 1704898330, "value_settings": { "event_payload_key": "value" }}