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::Thresholds - A Stripe Billing Thresholds Object

SYNOPSIS

    my $obj = $subscription->billing_thresholds({
        amount_gte => 1000,
        reset_billing_cycle_anchor => $stripe->true,
    });

VERSION

    0.1

DESCRIPTION

Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period

CONSTRUCTOR

new( %ARG )

Creates a new Net::API::Stripe::Billing::Thresholds object.

METHODS

amount_gte integer

Monetary threshold that triggers the subscription to create an invoice

item_reasons array of hashes

Indicates which line items triggered a threshold invoice.

This is an array of Net::API::Stripe::Billing::Thresholds::ItemReasons objects.

reset_billing_cycle_anchor boolean

Indicates if the billing_cycle_anchor should be reset when a threshold is reached. If true, billing_cycle_anchor will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be true if the subscription contains items with plans that have aggregate_usage=last_ever.

usage_gte integer

The quantity threshold boundary that applied to the given line item.

API SAMPLE

        {
          "id": "sub_fake123456789",
          "object": "subscription",
          "application_fee_percent": null,
          "billing_cycle_anchor": 1551492959,
          "billing_thresholds": null,
          "cancel_at_period_end": false,
          "canceled_at": 1555726796,
          "collection_method": "charge_automatically",
          "created": 1551492959,
          "current_period_end": 1556763359,
          "current_period_start": 1554171359,
          "customer": "cus_fake123456789",
          "days_until_due": null,
          "default_payment_method": null,
          "default_source": null,
          "default_tax_rates": [],
          "discount": null,
          "ended_at": 1555726796,
          "items": {
                "object": "list",
                "data": [
                  {
                        "id": "si_fake123456789",
                        "object": "subscription_item",
                        "billing_thresholds": null,
                        "created": 1551492959,
                        "metadata": {},
                        "plan": {
                          "id": "professional-monthly-jpy",
                          "object": "plan",
                          "active": true,
                          "aggregate_usage": null,
                          "amount": 8000,
                          "amount_decimal": "8000",
                          "billing_scheme": "per_unit",
                          "created": 1541833564,
                          "currency": "jpy",
                          "interval": "month",
                          "interval_count": 1,
                          "livemode": false,
                          "metadata": {},
                          "nickname": null,
                          "product": "prod_fake123456789",
                          "tiers": null,
                          "tiers_mode": null,
                          "transform_usage": null,
                          "trial_period_days": null,
                          "usage_type": "licensed"
                        },
                        "quantity": 1,
                        "subscription": "sub_fake123456789",
                        "tax_rates": []
                  }
                ],
                "has_more": false,
                "url": "/v1/subscription_items?subscription=sub_fake123456789"
          },
          "latest_invoice": "in_fake123456789",
          "livemode": false,
          "metadata": {},
          "next_pending_invoice_item_invoice": null,
          "pending_invoice_item_interval": null,
          "pending_setup_intent": null,
          "plan": {
                "id": "professional-monthly-jpy",
                "object": "plan",
                "active": true,
                "aggregate_usage": null,
                "amount": 8000,
                "amount_decimal": "8000",
                "billing_scheme": "per_unit",
                "created": 1541833564,
                "currency": "jpy",
                "interval": "month",
                "interval_count": 1,
                "livemode": false,
                "metadata": {},
                "nickname": null,
                "product": "prod_fake123456789",
                "tiers": null,
                "tiers_mode": null,
                "transform_usage": null,
                "trial_period_days": null,
                "usage_type": "licensed"
          },
          "quantity": 1,
          "start_date": 1551492959,
          "status": "canceled",
          "tax_percent": null,
          "trial_end": null,
          "trial_start": null
        }

HISTORY

v0.1

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation:

https://stripe.com/docs/api/subscriptions/object

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.