Attributes
- idstring
The ID of the MeteredItem.
- objectstring, value is "v2.billing.metered_item"
String representing the object’s type. Objects of the same type share the same value of the object field.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 250 characters.
- invoice_
presentation_ dimensionsarray of stringsPreview feature Optional array of Meter dimensions to group event dimension keys for invoice line items.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular billable item. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- meterstring
ID of the Meter that measures usage for this MeteredItem.
- meter_
segment_ conditionsarray of objectsPreview feature Optional array of Meter segments to filter event dimension keys for billing.
- tax_
detailsnullable objectPreview feature Stripe Tax details.
- unit_
labelnullable string The unit to use when displaying prices for this billable item in places like Checkout. For example, set this field to “CPU-hour” for Checkout to display “(price) per CPU-hour”, or “1 million events” to display “(price) per 1 million events”. Maximum length of 100 characters.
{ "id": "bli_test_61SGRtYMvrf176Kmm16RM8VQESSQ4t1K5KYFAmKUSVdY", "object": "v2.billing.metered_item", "created": "2025-03-27T00:04:48.000Z", "display_name": "Premium Chat API", "lookup_key": null, "metadata": {}, "meter": "mtr_test_61SD5KZ52hzuwbPJE41H5wvQ9UC0V34K", "meter_segment_conditions": [], "unit_label": null}
Create a MeteredItem object.
Learn more about calling API v2 endpoints.Parameters
- display_
namestringRequired Description that customers will see in the invoice line item. Maximum length of 250 characters.
- meterstringRequired
ID of the Meter that measures usage for this MeteredItem.
- invoice_
presentation_ dimensionsarray of stringsPreview feature Optional array of Meter dimensions to group event dimension keys for invoice line items.
- lookup_
keystring An internal key you can use to search for a particular billable item. Must be unique among billable items. Maximum length of 200 characters.
- metadatamap
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- meter_
segment_ conditionsarray of objectsPreview feature Optional array of Meter segments to filter event dimension keys for billing.
- tax_
detailsobjectPreview feature Stripe Tax details.
- unit_
labelstring The unit to use when displaying prices for this billable item in places like Checkout. For example, set this field to “CPU-hour” for Checkout to display “(price) per CPU-hour”, or “1 million events” to display “(price) per 1 million events”. Maximum length of 100 characters.
Returns
Response attributes
- idstring
The ID of the MeteredItem.
- objectstring, value is "v2.billing.metered_item"
String representing the object’s type. Objects of the same type share the same value of the object field.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 250 characters.
- invoice_
presentation_ dimensionsarray of stringsPreview feature Optional array of Meter dimensions to group event dimension keys for invoice line items.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular billable item. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- meterstring
ID of the Meter that measures usage for this MeteredItem.
- meter_
segment_ conditionsarray of objectsPreview feature Optional array of Meter segments to filter event dimension keys for billing.
- tax_
detailsnullable objectPreview feature Stripe Tax details.
- unit_
labelnullable string The unit to use when displaying prices for this billable item in places like Checkout. For example, set this field to “CPU-hour” for Checkout to display “(price) per CPU-hour”, or “1 million events” to display “(price) per 1 million events”. Maximum length of 100 characters.
Returned when another object of the same type already has the given lookup key.
Returned when tax_code.value does not correspond to a Stripe PTC.
Returned when the provided meter ID cannot be found.
{ "id": "bli_test_61SGRtYMvrf176Kmm16RM8VQESSQ4t1K5KYFAmKUSVdY", "object": "v2.billing.metered_item", "created": "2025-03-27T00:04:48.000Z", "display_name": "Chat API", "lookup_key": null, "metadata": {}, "meter": "mtr_test_61SD5KZ52hzuwbPJE41H5wvQ9UC0V34K", "unit_label": null, "livemode": true}
Update a MeteredItem object. At least one of the fields is required.
Learn more about calling API v2 endpoints.Parameters
- idstringRequired
ID of the MeteredItem to update.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 250 characters.
- lookup_
keystring An internal key you can use to search for a particular billable item. Maximum length of 200 characters. To remove the lookup_key from the object, set it to null in the request.
- metadatamap
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- tax_
detailsobjectPreview feature Stripe Tax details.
- unit_
labelstring The unit to use when displaying prices for this billable item in places like Checkout. For example, set this field to “CPU-hour” for Checkout to display “(price) per CPU-hour”, or “1 million events” to display “(price) per 1 million events”. Maximum length of 100 characters. To remove the unit_label from the object, set it to null in the request.
Returns
Response attributes
- idstring
The ID of the MeteredItem.
- objectstring, value is "v2.billing.metered_item"
String representing the object’s type. Objects of the same type share the same value of the object field.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 250 characters.
- invoice_
presentation_ dimensionsarray of stringsPreview feature Optional array of Meter dimensions to group event dimension keys for invoice line items.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular billable item. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- meterstring
ID of the Meter that measures usage for this MeteredItem.
- meter_
segment_ conditionsarray of objectsPreview feature Optional array of Meter segments to filter event dimension keys for billing.
- tax_
detailsnullable objectPreview feature Stripe Tax details.
- unit_
labelnullable string The unit to use when displaying prices for this billable item in places like Checkout. For example, set this field to “CPU-hour” for Checkout to display “(price) per CPU-hour”, or “1 million events” to display “(price) per 1 million events”. Maximum length of 100 characters.
Returned when another object of the same type already has the given lookup key.
Returned when tax_code.value does not correspond to a Stripe PTC.
Returned when the provided metered_item ID cannot be found.
{ "id": "bli_test_61SGRtYMvrf176Kmm16RM8VQESSQ4t1K5KYFAmKUSVdY", "object": "v2.billing.metered_item", "created": "2025-03-27T00:04:48.000Z", "display_name": "Premium Chat API", "lookup_key": null, "metadata": {}, "meter": "mtr_test_61SD5KZ52hzuwbPJE41H5wvQ9UC0V34K", "unit_label": null, "livemode": true}
Retrieve a MeteredItem object.
Learn more about calling API v2 endpoints.Parameters
- idstringRequired
ID of the MeteredItem to retrieve.
Returns
Response attributes
- idstring
The ID of the MeteredItem.
- objectstring, value is "v2.billing.metered_item"
String representing the object’s type. Objects of the same type share the same value of the object field.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 250 characters.
- invoice_
presentation_ dimensionsarray of stringsPreview feature Optional array of Meter dimensions to group event dimension keys for invoice line items.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular billable item. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- meterstring
ID of the Meter that measures usage for this MeteredItem.
- meter_
segment_ conditionsarray of objectsPreview feature Optional array of Meter segments to filter event dimension keys for billing.
- tax_
detailsnullable objectPreview feature Stripe Tax details.
- unit_
labelnullable string The unit to use when displaying prices for this billable item in places like Checkout. For example, set this field to “CPU-hour” for Checkout to display “(price) per CPU-hour”, or “1 million events” to display “(price) per 1 million events”. Maximum length of 100 characters.
Returned when the provided metered_item ID cannot be found.
{ "id": "bli_test_61SGRtYMvrf176Kmm16RM8VQESSQ4t1K5KYFAmKUSVdY", "object": "v2.billing.metered_item", "created": "2025-03-27T00:04:48.000Z", "display_name": "Premium Chat API", "lookup_key": null, "metadata": {}, "meter": "mtr_test_61SD5KZ52hzuwbPJE41H5wvQ9UC0V34K", "unit_label": null, "livemode": false}
List all MeteredItem objects in reverse chronological order of creation.
Learn more about calling API v2 endpoints.Parameters
- limitinteger
Optionally set the maximum number of results per page. Defaults to 20.
- pagestring
Opaque page token.
Returns
Response attributes
- dataarray of objects
The retrieved MeteredItem objects.
- next_
page_ urlnullable string The URL of the next page of results, if there is one.
- previous_
page_ urlnullable string The URL of the previous page of results, if there is one.
{ "data": [ { "id": "bli_test_61SGRtYMvrf176Kmm16RM8VQESSQ4t1K5KYFAmKUSVdY", "object": "v2.billing.metered_item", "created": "2025-03-27T00:04:48.000Z", "display_name": "Premium Chat API", "lookup_key": null, "metadata": {}, "meter": "mtr_test_61SD5KZ52hzuwbPJE41H5wvQ9UC0V34K", "unit_label": null, "livemode": true } ], "next_page_url": null, "previous_page_url": null}