The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::API::Stripe::Billing::UsageRecord - A Stripe Usage Record Object

SYNOPSIS

    my $usage_record = $stripe->usage_record({
        quantity => 1,
        subscription_item => $subscription_item_object,
        # Can be a unix timestamp or an iso 8601 date
        timestamp => '2020-04-01',
    });

VERSION

    0.1

DESCRIPTION

Usage records allow you to report customer usage and metrics to Stripe for metered billing of subscription plans.

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Billing::UsageRecord object. It may also take an hash like arguments, that also are method of the same name.

METHODS

id string

Unique identifier for the object.

object string, value is "usage_record"

String representing the object’s type. Objects of the same type share the same value.

livemode boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

quantity positive integer or zero

The usage quantity for the specified date.

subscription_item string

The ID of the subscription item this usage record contains data for.

timestamp timestamp

The timestamp when this usage occurred.

API SAMPLE

        {
          "id": "mbur_fake123456789",
          "object": "usage_record",
          "livemode": false,
          "quantity": 100,
          "subscription_item": "si_fake123456789",
          "timestamp": 1571397911
        }

HISTORY

v0.1

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/usage_records, https://stripe.com/docs/billing/subscriptions/metered-billing

COPYRIGHT & LICENSE

Copyright (c) 2019-2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.