Class MeterEventStream

java.lang.Object
com.stripe.examples.MeterEventStream

public class MeterEventStream extends Object
Use the high-throughput meter event stream API to report create billing meter events.

In this example, we:

  • create a meter event session and store the session's authentication token
  • define an event with a payload
  • use the meterEventStream service to create an event stream that reports this event

This example expects a billing meter with an event_name of 'alpaca_ai_tokens'. If you have a different meter event name, you can change it before running this example.

  • Constructor Details

    • MeterEventStream

      public MeterEventStream(String apiKey)
  • Method Details

    • sendMeterEvent

      public void sendMeterEvent(String eventName, String stripeCustomerId, String value)
    • main

      public static void main(String[] args)