Class SubscriptionItemUsageRecordService

java.lang.Object
com.stripe.net.ApiService
com.stripe.service.SubscriptionItemUsageRecordService

public final class SubscriptionItemUsageRecordService extends ApiService
  • Constructor Details

    • SubscriptionItemUsageRecordService

      public SubscriptionItemUsageRecordService(StripeResponseGetter responseGetter)
  • Method Details

    • create

      public UsageRecord create(String subscriptionItem, SubscriptionItemUsageRecordCreateParams params) throws StripeException
      Creates a usage record for a specified subscription item and date, and fills it with a quantity.

      Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the metered billing plan, Stripe helps you send accurate invoices to your customers.

      The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan’s aggregate_usage parameter. When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter.

      The default pricing model for metered billing is per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing model.

      Throws:
      StripeException
    • create

      public UsageRecord create(String subscriptionItem, SubscriptionItemUsageRecordCreateParams params, RequestOptions options) throws StripeException
      Creates a usage record for a specified subscription item and date, and fills it with a quantity.

      Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the metered billing plan, Stripe helps you send accurate invoices to your customers.

      The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan’s aggregate_usage parameter. When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter.

      The default pricing model for metered billing is per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing model.

      Throws:
      StripeException