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::Quote - The quote object

SYNOPSIS

VERSION

    v0.2.0

DESCRIPTION

A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will automatically create an invoice, subscription or subscription schedule.

METHODS

id string

Unique identifier for the object.

object string

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

amount_subtotal integer

Total before any discounts or taxes are applied.

amount_total integer

Total after discounts and taxes are applied.

application_fee_amount integer

The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote.

application_fee_percent decimal

A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote.

automatic_tax hash

Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.

It has the following properties:

enabled boolean

Automatically calculate taxes

status string

The status of the most recent automated tax calculation for this quote.

collection_method string

Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to charge_automatically.

computed hash

The definitive totals and line items for the quote, computed based on your inputted line items as well as other configuration such as trials. Used for rendering the quote to your customer.

It has the following properties:

recurring hash

The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with duration=forever coupons only. Defaults to null if no inputted line items with recurring prices.

When expanded, this is a Net::API::Stripe::Checkout::Session object.

upfront hash

The definitive upfront totals and line items the customer will be charged on the first invoice.

When expanded, this is a Net::API::Stripe::Checkout::Session object.

created timestamp

Time at which the object was created. Measured in seconds since the Unix epoch.

currency string

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customer expandable

The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.

When expanded this is an Net::API::Stripe::Customer object.

default_tax_rates expandable

The tax rates applied to this quote.

When expanded this is an Net::API::Stripe::Tax::Rate object.

description string

A description that will be displayed on the quote PDF.

discounts expandable

The discounts applied to this quote.

When expanded this is an Net::API::Stripe::Billing::Discount object.

expires_at timestamp

The date on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch.

A footer that will be displayed on the quote PDF.

from_quote hash

Details of the quote that was cloned. See the cloning documentation for more details.

It has the following properties:

is_revision boolean

Whether this quote is a revision of a different quote.

quote string expandable

The quote that was cloned.

When expanded this is an Net::API::Stripe::Billing::Quote object.

header string

A header that will be displayed on the quote PDF.

invoice expandable

The invoice that was created from this quote.

When expanded this is an Net::API::Stripe::Billing::Invoice object.

invoice_settings object

All invoices will be billed using the specified settings.

This is a Net::API::Stripe::Billing::Subscription object.

line_items object

A list of items the customer is being quoted for.

This is a Net::API::Stripe::List object.

livemode boolean

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

metadata hash

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

number string

A unique number that identifies this particular quote. This number is assigned once the quote is finalized.

on_behalf_of expandable

The account on behalf of which to charge. See the Connect documentation for details.

When expanded this is an Net::API::Stripe::Connect::Account object.

status string

The status of the quote.

status_transitions hash

The timestamps of which the quote transitioned to a new status.

It has the following properties:

accepted_at timestamp

The time that the quote was accepted. Measured in seconds since Unix epoch.

canceled_at timestamp

The time that the quote was canceled. Measured in seconds since Unix epoch.

finalized_at timestamp

The time that the quote was finalized. Measured in seconds since Unix epoch.

subscription expandable

The subscription that was created or updated from this quote.

When expanded this is an Net::API::Stripe::Billing::Subscription object.

subscription_data object

When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created.

This is a Net::API::Stripe::Billing::Subscription object.

subscription_schedule expandable

The subscription schedule that was created or updated from this quote.

When expanded this is an Net::API::Stripe::Billing::Subscription::Schedule object.

total_details hash

Tax and discount details for the computed total amount.

It has the following properties:

amount_discount integer

This is the sum of all the line item discounts.

amount_shipping integer

This is the sum of all the line item shipping amounts.

amount_tax integer

This is the sum of all the line item tax amounts.

breakdown hash

Breakdown of individual tax and discount amounts that add up to the totals.

discounts array

The aggregated line item discounts.

amount integer

The amount discounted.

discount hash

The discount applied.

taxes array

The aggregated line item tax amounts by rate.

amount integer

Amount of tax applied for this rate.

rate hash

The tax rate applied.

When expanded, this is a Net::API::Stripe::Billing::Quote object.

transfer_data object

The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices.

This is a Net::API::Stripe::Charge object.

API SAMPLE

    {
      "id": "qt_1KJGon2eZvKYlo2CYE6HxURp",
      "object": "quote",
      "amount_subtotal": 0,
      "amount_total": 0,
      "application_fee_amount": null,
      "application_fee_percent": null,
      "automatic_tax": {
        "enabled": false,
        "status": null
      },
      "collection_method": "charge_automatically",
      "computed": {
        "recurring": null,
        "upfront": {
          "amount_subtotal": 0,
          "amount_total": 0,
          "total_details": {
            "amount_discount": 0,
            "amount_shipping": 0,
            "amount_tax": 0
          }
        }
      },
      "created": 1642508985,
      "currency": "usd",
      "customer": "cus_AJ6yY15pe9xOZe",
      "default_tax_rates": [
    
      ],
      "description": null,
      "discounts": [
    
      ],
      "expires_at": 1645100985,
      "footer": null,
      "from_quote": null,
      "header": null,
      "invoice": null,
      "invoice_settings": {
        "days_until_due": null
      },
      "livemode": false,
      "metadata": {
      },
      "number": null,
      "on_behalf_of": null,
      "status": "draft",
      "status_transitions": {
        "accepted_at": null,
        "canceled_at": null,
        "finalized_at": null
      },
      "subscription": null,
      "subscription_data": {
        "effective_date": null,
        "trial_period_days": null
      },
      "subscription_schedule": null,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      },
      "transfer_data": null
    }

HISTORY

v0.1.0

Initial version

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Stripe API documentation

COPYRIGHT & LICENSE

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

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