Class: Stripe::QuoteCreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/quote_create_params.rb

Defined Under Namespace

Classes: AutomaticTax, Discount, FromQuote, InvoiceSettings, Line, LineItem, SubscriptionData, SubscriptionDataOverride, TransferData

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(allow_backdated_lines: nil, application_fee_amount: nil, application_fee_percent: nil, automatic_tax: nil, collection_method: nil, customer: nil, customer_account: nil, default_tax_rates: nil, description: nil, discounts: nil, expand: nil, expires_at: nil, footer: nil, from_quote: nil, header: nil, invoice_settings: nil, line_items: nil, lines: nil, metadata: nil, on_behalf_of: nil, subscription_data: nil, subscription_data_overrides: nil, test_clock: nil, transfer_data: nil) ⇒ QuoteCreateParams

Returns a new instance of QuoteCreateParams.



1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
# File 'lib/stripe/params/quote_create_params.rb', line 1477

def initialize(
  allow_backdated_lines: nil,
  application_fee_amount: nil,
  application_fee_percent: nil,
  automatic_tax: nil,
  collection_method: nil,
  customer: nil,
  customer_account: nil,
  default_tax_rates: nil,
  description: nil,
  discounts: nil,
  expand: nil,
  expires_at: nil,
  footer: nil,
  from_quote: nil,
  header: nil,
  invoice_settings: nil,
  line_items: nil,
  lines: nil,
  metadata: nil,
  on_behalf_of: nil,
  subscription_data: nil,
  subscription_data_overrides: nil,
  test_clock: nil,
  transfer_data: nil
)
  @allow_backdated_lines = allow_backdated_lines
  @application_fee_amount = application_fee_amount
  @application_fee_percent = application_fee_percent
  @automatic_tax = automatic_tax
  @collection_method = collection_method
  @customer = customer
  @customer_account = 
  @default_tax_rates = default_tax_rates
  @description = description
  @discounts = discounts
  @expand = expand
  @expires_at = expires_at
  @footer = footer
  @from_quote = from_quote
  @header = header
  @invoice_settings = invoice_settings
  @line_items = line_items
  @lines = lines
  @metadata = 
  @on_behalf_of = on_behalf_of
  @subscription_data = subscription_data
  @subscription_data_overrides = subscription_data_overrides
  @test_clock = test_clock
  @transfer_data = transfer_data
end

Instance Attribute Details

#allow_backdated_linesObject

Set to true to allow quote lines to have ‘starts_at` in the past if collection is paused between `starts_at` and now.



1429
1430
1431
# File 'lib/stripe/params/quote_create_params.rb', line 1429

def allow_backdated_lines
  @allow_backdated_lines
end

#application_fee_amountObject

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. There cannot be any line items with recurring prices when using this field.



1431
1432
1433
# File 'lib/stripe/params/quote_create_params.rb', line 1431

def application_fee_amount
  @application_fee_amount
end

#application_fee_percentObject

A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. There must be at least 1 line item with a recurring price to use this field.



1433
1434
1435
# File 'lib/stripe/params/quote_create_params.rb', line 1433

def application_fee_percent
  @application_fee_percent
end

#automatic_taxObject

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



1435
1436
1437
# File 'lib/stripe/params/quote_create_params.rb', line 1435

def automatic_tax
  @automatic_tax
end

#collection_methodObject

Either ‘charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice 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 and mark the subscription as `active`. Defaults to `charge_automatically`.



1437
1438
1439
# File 'lib/stripe/params/quote_create_params.rb', line 1437

def collection_method
  @collection_method
end

#customerObject

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



1439
1440
1441
# File 'lib/stripe/params/quote_create_params.rb', line 1439

def customer
  @customer
end

#customer_accountObject

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



1441
1442
1443
# File 'lib/stripe/params/quote_create_params.rb', line 1441

def 
  @customer_account
end

#default_tax_ratesObject

The tax rates that will apply to any line item that does not have ‘tax_rates` set.



1443
1444
1445
# File 'lib/stripe/params/quote_create_params.rb', line 1443

def default_tax_rates
  @default_tax_rates
end

#descriptionObject

A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](dashboard.stripe.com/settings/billing/quote) will be used.



1445
1446
1447
# File 'lib/stripe/params/quote_create_params.rb', line 1445

def description
  @description
end

#discountsObject

The discounts applied to the quote.



1447
1448
1449
# File 'lib/stripe/params/quote_create_params.rb', line 1447

def discounts
  @discounts
end

#expandObject

Specifies which fields in the response should be expanded.



1449
1450
1451
# File 'lib/stripe/params/quote_create_params.rb', line 1449

def expand
  @expand
end

#expires_atObject

A future timestamp on which the quote will be canceled if in ‘open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](dashboard.stripe.com/settings/billing/quote) will be used.



1451
1452
1453
# File 'lib/stripe/params/quote_create_params.rb', line 1451

def expires_at
  @expires_at
end

A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](dashboard.stripe.com/settings/billing/quote) will be used.



1453
1454
1455
# File 'lib/stripe/params/quote_create_params.rb', line 1453

def footer
  @footer
end

#from_quoteObject

Clone an existing quote. The new quote will be created in ‘status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`.



1455
1456
1457
# File 'lib/stripe/params/quote_create_params.rb', line 1455

def from_quote
  @from_quote
end

#headerObject

A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](dashboard.stripe.com/settings/billing/quote) will be used.



1457
1458
1459
# File 'lib/stripe/params/quote_create_params.rb', line 1457

def header
  @header
end

#invoice_settingsObject

All invoices will be billed using the specified settings.



1459
1460
1461
# File 'lib/stripe/params/quote_create_params.rb', line 1459

def invoice_settings
  @invoice_settings
end

#line_itemsObject

A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.



1461
1462
1463
# File 'lib/stripe/params/quote_create_params.rb', line 1461

def line_items
  @line_items
end

#linesObject

A list of [quote lines](docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.



1463
1464
1465
# File 'lib/stripe/params/quote_create_params.rb', line 1463

def lines
  @lines
end

#metadataObject

Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



1465
1466
1467
# File 'lib/stripe/params/quote_create_params.rb', line 1465

def 
  @metadata
end

#on_behalf_ofObject

The account on behalf of which to charge.



1467
1468
1469
# File 'lib/stripe/params/quote_create_params.rb', line 1467

def on_behalf_of
  @on_behalf_of
end

#subscription_dataObject

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. A subscription schedule is created if ‘subscription_data` is present and in the future, otherwise a subscription is created.



1469
1470
1471
# File 'lib/stripe/params/quote_create_params.rb', line 1469

def subscription_data
  @subscription_data
end

#subscription_data_overridesObject

List representing overrides for ‘subscription_data` configurations for specific subscription schedules.



1471
1472
1473
# File 'lib/stripe/params/quote_create_params.rb', line 1471

def subscription_data_overrides
  @subscription_data_overrides
end

#test_clockObject

ID of the test clock to attach to the quote.



1473
1474
1475
# File 'lib/stripe/params/quote_create_params.rb', line 1473

def test_clock
  @test_clock
end

#transfer_dataObject

The data with which to automatically create a Transfer for each of the invoices.



1475
1476
1477
# File 'lib/stripe/params/quote_create_params.rb', line 1475

def transfer_data
  @transfer_data
end

Class Method Details

.field_encodingsObject



1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
# File 'lib/stripe/params/quote_create_params.rb', line 1529

def self.field_encodings
  @field_encodings = {
    line_items: {
      kind: :array,
      element: {
        kind: :object,
        fields: { price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } } },
      },
    },
  }
end