1. Registry
  2. Packages
  3. Stripe Provider
  4. API Docs
  5. BillingMeter
Viewing docs for Stripe 0.3.0
published on Friday, Aug 14, 2026 by Pulumi
Viewing docs for Stripe 0.3.0
published on Friday, Aug 14, 2026 by Pulumi

    Meters specify how to aggregate meter events over a billing period. Meter events represent the actions that customers take in your system. Meters attach to prices and form the basis of the bill.

    Related guide: Usage based billing

    Create BillingMeter Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BillingMeter(name: string, args: BillingMeterArgs, opts?: CustomResourceOptions);
    @overload
    def BillingMeter(resource_name: str,
                     args: BillingMeterArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def BillingMeter(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     display_name: Optional[str] = None,
                     event_name: Optional[str] = None,
                     customer_mappings: Optional[Sequence[BillingMeterCustomerMappingArgs]] = None,
                     default_aggregations: Optional[Sequence[BillingMeterDefaultAggregationArgs]] = None,
                     event_time_window: Optional[str] = None,
                     value_settings: Optional[Sequence[BillingMeterValueSettingArgs]] = None)
    func NewBillingMeter(ctx *Context, name string, args BillingMeterArgs, opts ...ResourceOption) (*BillingMeter, error)
    public BillingMeter(string name, BillingMeterArgs args, CustomResourceOptions? opts = null)
    public BillingMeter(String name, BillingMeterArgs args)
    public BillingMeter(String name, BillingMeterArgs args, CustomResourceOptions options)
    
    type: stripe:BillingMeter
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "stripe_billing_meter" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args BillingMeterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BillingMeterArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BillingMeterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BillingMeterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BillingMeterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var billingMeterResource = new Stripe.BillingMeter("billingMeterResource", new()
    {
        DisplayName = "string",
        EventName = "string",
        CustomerMappings = new[]
        {
            new Stripe.Inputs.BillingMeterCustomerMappingArgs
            {
                EventPayloadKey = "string",
                Type = "string",
            },
        },
        DefaultAggregations = new[]
        {
            new Stripe.Inputs.BillingMeterDefaultAggregationArgs
            {
                Formula = "string",
            },
        },
        EventTimeWindow = "string",
        ValueSettings = new[]
        {
            new Stripe.Inputs.BillingMeterValueSettingArgs
            {
                EventPayloadKey = "string",
            },
        },
    });
    
    example, err := stripe.NewBillingMeter(ctx, "billingMeterResource", &stripe.BillingMeterArgs{
    	DisplayName: pulumi.String("string"),
    	EventName:   pulumi.String("string"),
    	CustomerMappings: stripe.BillingMeterCustomerMappingArray{
    		&stripe.BillingMeterCustomerMappingArgs{
    			EventPayloadKey: pulumi.String("string"),
    			Type:            pulumi.String("string"),
    		},
    	},
    	DefaultAggregations: stripe.BillingMeterDefaultAggregationArray{
    		&stripe.BillingMeterDefaultAggregationArgs{
    			Formula: pulumi.String("string"),
    		},
    	},
    	EventTimeWindow: pulumi.String("string"),
    	ValueSettings: stripe.BillingMeterValueSettingArray{
    		&stripe.BillingMeterValueSettingArgs{
    			EventPayloadKey: pulumi.String("string"),
    		},
    	},
    })
    
    resource "stripe_billing_meter" "billingMeterResource" {
      lifecycle {
        create_before_destroy = true
      }
      display_name = "string"
      event_name   = "string"
      customer_mappings {
        event_payload_key = "string"
        type              = "string"
      }
      default_aggregations {
        formula = "string"
      }
      event_time_window = "string"
      value_settings {
        event_payload_key = "string"
      }
    }
    
    var billingMeterResource = new BillingMeter("billingMeterResource", BillingMeterArgs.builder()
        .displayName("string")
        .eventName("string")
        .customerMappings(BillingMeterCustomerMappingArgs.builder()
            .eventPayloadKey("string")
            .type("string")
            .build())
        .defaultAggregations(BillingMeterDefaultAggregationArgs.builder()
            .formula("string")
            .build())
        .eventTimeWindow("string")
        .valueSettings(BillingMeterValueSettingArgs.builder()
            .eventPayloadKey("string")
            .build())
        .build());
    
    billing_meter_resource = stripe.BillingMeter("billingMeterResource",
        display_name="string",
        event_name="string",
        customer_mappings=[{
            "event_payload_key": "string",
            "type": "string",
        }],
        default_aggregations=[{
            "formula": "string",
        }],
        event_time_window="string",
        value_settings=[{
            "event_payload_key": "string",
        }])
    
    const billingMeterResource = new stripe.BillingMeter("billingMeterResource", {
        displayName: "string",
        eventName: "string",
        customerMappings: [{
            eventPayloadKey: "string",
            type: "string",
        }],
        defaultAggregations: [{
            formula: "string",
        }],
        eventTimeWindow: "string",
        valueSettings: [{
            eventPayloadKey: "string",
        }],
    });
    
    type: stripe:BillingMeter
    properties:
        customerMappings:
            - eventPayloadKey: string
              type: string
        defaultAggregations:
            - formula: string
        displayName: string
        eventName: string
        eventTimeWindow: string
        valueSettings:
            - eventPayloadKey: string
    

    BillingMeter Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The BillingMeter resource accepts the following input properties:

    DisplayName string
    The meter's name.
    EventName string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    CustomerMappings List<BillingMeterCustomerMapping>
    DefaultAggregations List<BillingMeterDefaultAggregation>
    EventTimeWindow string
    The time window which meter events have been pre-aggregated for, if any.
    ValueSettings List<BillingMeterValueSetting>
    DisplayName string
    The meter's name.
    EventName string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    CustomerMappings []BillingMeterCustomerMappingArgs
    DefaultAggregations []BillingMeterDefaultAggregationArgs
    EventTimeWindow string
    The time window which meter events have been pre-aggregated for, if any.
    ValueSettings []BillingMeterValueSettingArgs
    display_name string
    The meter's name.
    event_name string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    customer_mappings list(object)
    default_aggregations list(object)
    event_time_window string
    The time window which meter events have been pre-aggregated for, if any.
    value_settings list(object)
    displayName String
    The meter's name.
    eventName String
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    customerMappings List<BillingMeterCustomerMapping>
    defaultAggregations List<BillingMeterDefaultAggregation>
    eventTimeWindow String
    The time window which meter events have been pre-aggregated for, if any.
    valueSettings List<BillingMeterValueSetting>
    displayName string
    The meter's name.
    eventName string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    customerMappings BillingMeterCustomerMapping[]
    defaultAggregations BillingMeterDefaultAggregation[]
    eventTimeWindow string
    The time window which meter events have been pre-aggregated for, if any.
    valueSettings BillingMeterValueSetting[]
    display_name str
    The meter's name.
    event_name str
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    customer_mappings Sequence[BillingMeterCustomerMappingArgs]
    default_aggregations Sequence[BillingMeterDefaultAggregationArgs]
    event_time_window str
    The time window which meter events have been pre-aggregated for, if any.
    value_settings Sequence[BillingMeterValueSettingArgs]
    displayName String
    The meter's name.
    eventName String
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    customerMappings List<Property Map>
    defaultAggregations List<Property Map>
    eventTimeWindow String
    The time window which meter events have been pre-aggregated for, if any.
    valueSettings List<Property Map>

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BillingMeter resource produces the following output properties:

    Created double
    Time at which the object was created. Measured in seconds since the Unix epoch.
    Id string
    The provider-assigned unique ID for this managed resource.
    Livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    Object string
    String representing the object's type. Objects of the same type share the same value.
    Status string
    The meter's status.
    StatusTransitions BillingMeterStatusTransitions
    Updated double
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    Created float64
    Time at which the object was created. Measured in seconds since the Unix epoch.
    Id string
    The provider-assigned unique ID for this managed resource.
    Livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    Object string
    String representing the object's type. Objects of the same type share the same value.
    Status string
    The meter's status.
    StatusTransitions BillingMeterStatusTransitions
    Updated float64
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    created number
    Time at which the object was created. Measured in seconds since the Unix epoch.
    id string
    The provider-assigned unique ID for this managed resource.
    livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object string
    String representing the object's type. Objects of the same type share the same value.
    status string
    The meter's status.
    status_transitions object
    updated number
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    created Double
    Time at which the object was created. Measured in seconds since the Unix epoch.
    id String
    The provider-assigned unique ID for this managed resource.
    livemode Boolean
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object String
    String representing the object's type. Objects of the same type share the same value.
    status String
    The meter's status.
    statusTransitions BillingMeterStatusTransitions
    updated Double
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    created number
    Time at which the object was created. Measured in seconds since the Unix epoch.
    id string
    The provider-assigned unique ID for this managed resource.
    livemode boolean
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object string
    String representing the object's type. Objects of the same type share the same value.
    status string
    The meter's status.
    statusTransitions BillingMeterStatusTransitions
    updated number
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    created float
    Time at which the object was created. Measured in seconds since the Unix epoch.
    id str
    The provider-assigned unique ID for this managed resource.
    livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object str
    String representing the object's type. Objects of the same type share the same value.
    status str
    The meter's status.
    status_transitions BillingMeterStatusTransitions
    updated float
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    created Number
    Time at which the object was created. Measured in seconds since the Unix epoch.
    id String
    The provider-assigned unique ID for this managed resource.
    livemode Boolean
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object String
    String representing the object's type. Objects of the same type share the same value.
    status String
    The meter's status.
    statusTransitions Property Map
    updated Number
    Time at which the object was last updated. Measured in seconds since the Unix epoch.

    Look up Existing BillingMeter Resource

    Get an existing BillingMeter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BillingMeterState, opts?: CustomResourceOptions): BillingMeter
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created: Optional[float] = None,
            customer_mappings: Optional[Sequence[BillingMeterCustomerMappingArgs]] = None,
            default_aggregations: Optional[Sequence[BillingMeterDefaultAggregationArgs]] = None,
            display_name: Optional[str] = None,
            event_name: Optional[str] = None,
            event_time_window: Optional[str] = None,
            livemode: Optional[bool] = None,
            object: Optional[str] = None,
            status: Optional[str] = None,
            status_transitions: Optional[BillingMeterStatusTransitionsArgs] = None,
            updated: Optional[float] = None,
            value_settings: Optional[Sequence[BillingMeterValueSettingArgs]] = None) -> BillingMeter
    func GetBillingMeter(ctx *Context, name string, id IDInput, state *BillingMeterState, opts ...ResourceOption) (*BillingMeter, error)
    public static BillingMeter Get(string name, Input<string> id, BillingMeterState? state, CustomResourceOptions? opts = null)
    public static BillingMeter get(String name, Output<String> id, BillingMeterState state, CustomResourceOptions options)
    resources:  _:    type: stripe:BillingMeter    get:      id: ${id}
    import {
      to = stripe_billing_meter.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Created double
    Time at which the object was created. Measured in seconds since the Unix epoch.
    CustomerMappings List<BillingMeterCustomerMapping>
    DefaultAggregations List<BillingMeterDefaultAggregation>
    DisplayName string
    The meter's name.
    EventName string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    EventTimeWindow string
    The time window which meter events have been pre-aggregated for, if any.
    Livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    Object string
    String representing the object's type. Objects of the same type share the same value.
    Status string
    The meter's status.
    StatusTransitions BillingMeterStatusTransitions
    Updated double
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    ValueSettings List<BillingMeterValueSetting>
    Created float64
    Time at which the object was created. Measured in seconds since the Unix epoch.
    CustomerMappings []BillingMeterCustomerMappingArgs
    DefaultAggregations []BillingMeterDefaultAggregationArgs
    DisplayName string
    The meter's name.
    EventName string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    EventTimeWindow string
    The time window which meter events have been pre-aggregated for, if any.
    Livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    Object string
    String representing the object's type. Objects of the same type share the same value.
    Status string
    The meter's status.
    StatusTransitions BillingMeterStatusTransitionsArgs
    Updated float64
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    ValueSettings []BillingMeterValueSettingArgs
    created number
    Time at which the object was created. Measured in seconds since the Unix epoch.
    customer_mappings list(object)
    default_aggregations list(object)
    display_name string
    The meter's name.
    event_name string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    event_time_window string
    The time window which meter events have been pre-aggregated for, if any.
    livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object string
    String representing the object's type. Objects of the same type share the same value.
    status string
    The meter's status.
    status_transitions object
    updated number
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    value_settings list(object)
    created Double
    Time at which the object was created. Measured in seconds since the Unix epoch.
    customerMappings List<BillingMeterCustomerMapping>
    defaultAggregations List<BillingMeterDefaultAggregation>
    displayName String
    The meter's name.
    eventName String
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    eventTimeWindow String
    The time window which meter events have been pre-aggregated for, if any.
    livemode Boolean
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object String
    String representing the object's type. Objects of the same type share the same value.
    status String
    The meter's status.
    statusTransitions BillingMeterStatusTransitions
    updated Double
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    valueSettings List<BillingMeterValueSetting>
    created number
    Time at which the object was created. Measured in seconds since the Unix epoch.
    customerMappings BillingMeterCustomerMapping[]
    defaultAggregations BillingMeterDefaultAggregation[]
    displayName string
    The meter's name.
    eventName string
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    eventTimeWindow string
    The time window which meter events have been pre-aggregated for, if any.
    livemode boolean
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object string
    String representing the object's type. Objects of the same type share the same value.
    status string
    The meter's status.
    statusTransitions BillingMeterStatusTransitions
    updated number
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    valueSettings BillingMeterValueSetting[]
    created float
    Time at which the object was created. Measured in seconds since the Unix epoch.
    customer_mappings Sequence[BillingMeterCustomerMappingArgs]
    default_aggregations Sequence[BillingMeterDefaultAggregationArgs]
    display_name str
    The meter's name.
    event_name str
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    event_time_window str
    The time window which meter events have been pre-aggregated for, if any.
    livemode bool
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object str
    String representing the object's type. Objects of the same type share the same value.
    status str
    The meter's status.
    status_transitions BillingMeterStatusTransitionsArgs
    updated float
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    value_settings Sequence[BillingMeterValueSettingArgs]
    created Number
    Time at which the object was created. Measured in seconds since the Unix epoch.
    customerMappings List<Property Map>
    defaultAggregations List<Property Map>
    displayName String
    The meter's name.
    eventName String
    The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
    eventTimeWindow String
    The time window which meter events have been pre-aggregated for, if any.
    livemode Boolean
    If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
    object String
    String representing the object's type. Objects of the same type share the same value.
    status String
    The meter's status.
    statusTransitions Property Map
    updated Number
    Time at which the object was last updated. Measured in seconds since the Unix epoch.
    valueSettings List<Property Map>

    Supporting Types

    BillingMeterCustomerMapping, BillingMeterCustomerMappingArgs

    EventPayloadKey string
    The key in the meter event payload to use for mapping the event to a customer.
    Type string
    The method for mapping a meter event to a customer.
    EventPayloadKey string
    The key in the meter event payload to use for mapping the event to a customer.
    Type string
    The method for mapping a meter event to a customer.
    event_payload_key string
    The key in the meter event payload to use for mapping the event to a customer.
    type string
    The method for mapping a meter event to a customer.
    eventPayloadKey String
    The key in the meter event payload to use for mapping the event to a customer.
    type String
    The method for mapping a meter event to a customer.
    eventPayloadKey string
    The key in the meter event payload to use for mapping the event to a customer.
    type string
    The method for mapping a meter event to a customer.
    event_payload_key str
    The key in the meter event payload to use for mapping the event to a customer.
    type str
    The method for mapping a meter event to a customer.
    eventPayloadKey String
    The key in the meter event payload to use for mapping the event to a customer.
    type String
    The method for mapping a meter event to a customer.

    BillingMeterDefaultAggregation, BillingMeterDefaultAggregationArgs

    Formula string
    Specifies how events are aggregated.
    Formula string
    Specifies how events are aggregated.
    formula string
    Specifies how events are aggregated.
    formula String
    Specifies how events are aggregated.
    formula string
    Specifies how events are aggregated.
    formula str
    Specifies how events are aggregated.
    formula String
    Specifies how events are aggregated.

    BillingMeterStatusTransitions, BillingMeterStatusTransitionsArgs

    DeactivatedAt double
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
    DeactivatedAt float64
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
    deactivated_at number
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
    deactivatedAt Double
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
    deactivatedAt number
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
    deactivated_at float
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
    deactivatedAt Number
    The time the meter was deactivated, if any. Measured in seconds since Unix epoch.

    BillingMeterValueSetting, BillingMeterValueSettingArgs

    EventPayloadKey string
    The key in the meter event payload to use as the value for this meter.
    EventPayloadKey string
    The key in the meter event payload to use as the value for this meter.
    event_payload_key string
    The key in the meter event payload to use as the value for this meter.
    eventPayloadKey String
    The key in the meter event payload to use as the value for this meter.
    eventPayloadKey string
    The key in the meter event payload to use as the value for this meter.
    event_payload_key str
    The key in the meter event payload to use as the value for this meter.
    eventPayloadKey String
    The key in the meter event payload to use as the value for this meter.

    Package Details

    Repository
    stripe stripe/terraform-provider-stripe
    License
    Notes
    This Pulumi package is based on the stripe Terraform Provider.
    Viewing docs for Stripe 0.3.0
    published on Friday, Aug 14, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial