Class: Stripe::InvoiceService::CreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/services/invoice_service.rb

Defined Under Namespace

Classes: AmountsDue, AutomaticTax, CustomField, Discount, FromInvoice, Issuer, PaymentSettings, Rendering, ShippingCost, ShippingDetails, TransferData

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(account_tax_ids: nil, amounts_due: nil, application_fee_amount: nil, auto_advance: nil, automatic_tax: nil, automatically_finalizes_at: nil, collection_method: nil, currency: nil, custom_fields: nil, customer: nil, customer_account: nil, days_until_due: nil, default_margins: nil, default_payment_method: nil, default_source: nil, default_tax_rates: nil, description: nil, discounts: nil, due_date: nil, effective_at: nil, expand: nil, footer: nil, from_invoice: nil, issuer: nil, metadata: nil, number: nil, on_behalf_of: nil, payment_settings: nil, pending_invoice_items_behavior: nil, rendering: nil, shipping_cost: nil, shipping_details: nil, statement_descriptor: nil, subscription: nil, transfer_data: nil) ⇒ CreateParams

Returns a new instance of CreateParams.



1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/stripe/services/invoice_service.rb', line 1312

def initialize(
  account_tax_ids: nil,
  amounts_due: nil,
  application_fee_amount: nil,
  auto_advance: nil,
  automatic_tax: nil,
  automatically_finalizes_at: nil,
  collection_method: nil,
  currency: nil,
  custom_fields: nil,
  customer: nil,
  customer_account: nil,
  days_until_due: nil,
  default_margins: nil,
  default_payment_method: nil,
  default_source: nil,
  default_tax_rates: nil,
  description: nil,
  discounts: nil,
  due_date: nil,
  effective_at: nil,
  expand: nil,
  footer: nil,
  from_invoice: nil,
  issuer: nil,
  metadata: nil,
  number: nil,
  on_behalf_of: nil,
  payment_settings: nil,
  pending_invoice_items_behavior: nil,
  rendering: nil,
  shipping_cost: nil,
  shipping_details: nil,
  statement_descriptor: nil,
  subscription: nil,
  transfer_data: nil
)
  @account_tax_ids = 
  @amounts_due = amounts_due
  @application_fee_amount = application_fee_amount
  @auto_advance = auto_advance
  @automatic_tax = automatic_tax
  @automatically_finalizes_at = automatically_finalizes_at
  @collection_method = collection_method
  @currency = currency
  @custom_fields = custom_fields
  @customer = customer
  @customer_account = 
  @days_until_due = days_until_due
  @default_margins = default_margins
  @default_payment_method = default_payment_method
  @default_source = default_source
  @default_tax_rates = default_tax_rates
  @description = description
  @discounts = discounts
  @due_date = due_date
  @effective_at = effective_at
  @expand = expand
  @footer = footer
  @from_invoice = from_invoice
  @issuer = issuer
  @metadata = 
  @number = number
  @on_behalf_of = on_behalf_of
  @payment_settings = payment_settings
  @pending_invoice_items_behavior = pending_invoice_items_behavior
  @rendering = rendering
  @shipping_cost = shipping_cost
  @shipping_details = shipping_details
  @statement_descriptor = statement_descriptor
  @subscription = subscription
  @transfer_data = transfer_data
end

Instance Attribute Details

#account_tax_idsObject

The account tax IDs associated with the invoice. Only editable when the invoice is a draft.



1242
1243
1244
# File 'lib/stripe/services/invoice_service.rb', line 1242

def 
  @account_tax_ids
end

#amounts_dueObject

List of expected payments and corresponding due dates. Valid only for invoices where ‘collection_method=send_invoice`.



1244
1245
1246
# File 'lib/stripe/services/invoice_service.rb', line 1244

def amounts_due
  @amounts_due
end

#application_fee_amountObject

A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](stripe.com/docs/billing/invoices/connect#collecting-fees).



1246
1247
1248
# File 'lib/stripe/services/invoice_service.rb', line 1246

def application_fee_amount
  @application_fee_amount
end

#auto_advanceObject

Controls whether Stripe performs [automatic collection](stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If ‘false`, the invoice’s state doesn’t automatically advance without an explicit action.



1248
1249
1250
# File 'lib/stripe/services/invoice_service.rb', line 1248

def auto_advance
  @auto_advance
end

#automatic_taxObject

Settings for automatic tax lookup for this invoice.



1250
1251
1252
# File 'lib/stripe/services/invoice_service.rb', line 1250

def automatic_tax
  @automatic_tax
end

#automatically_finalizes_atObject

The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state.



1252
1253
1254
# File 'lib/stripe/services/invoice_service.rb', line 1252

def automatically_finalizes_at
  @automatically_finalizes_at
end

#collection_methodObject

Either ‘charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.



1254
1255
1256
# File 'lib/stripe/services/invoice_service.rb', line 1254

def collection_method
  @collection_method
end

#currencyObject

The currency to create this invoice in. Defaults to that of ‘customer` if not specified.



1256
1257
1258
# File 'lib/stripe/services/invoice_service.rb', line 1256

def currency
  @currency
end

#custom_fieldsObject

A list of up to 4 custom fields to be displayed on the invoice.



1258
1259
1260
# File 'lib/stripe/services/invoice_service.rb', line 1258

def custom_fields
  @custom_fields
end

#customerObject

The ID of the customer who will be billed.



1260
1261
1262
# File 'lib/stripe/services/invoice_service.rb', line 1260

def customer
  @customer
end

#customer_accountObject

The ID of the account who will be billed.



1262
1263
1264
# File 'lib/stripe/services/invoice_service.rb', line 1262

def 
  @customer_account
end

#days_until_dueObject

The number of days from when the invoice is created until it is due. Valid only for invoices where ‘collection_method=send_invoice`.



1264
1265
1266
# File 'lib/stripe/services/invoice_service.rb', line 1264

def days_until_due
  @days_until_due
end

#default_marginsObject

The ids of the margins to apply to the invoice. Can be overridden by line item ‘margins`.



1266
1267
1268
# File 'lib/stripe/services/invoice_service.rb', line 1266

def default_margins
  @default_margins
end

#default_payment_methodObject

ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription’s default payment method, if any, or to the default payment method in the customer’s invoice settings.



1268
1269
1270
# File 'lib/stripe/services/invoice_service.rb', line 1268

def default_payment_method
  @default_payment_method
end

#default_sourceObject

ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription’s default source, if any, or to the customer’s default source.



1270
1271
1272
# File 'lib/stripe/services/invoice_service.rb', line 1270

def default_source
  @default_source
end

#default_tax_ratesObject

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



1272
1273
1274
# File 'lib/stripe/services/invoice_service.rb', line 1272

def default_tax_rates
  @default_tax_rates
end

#descriptionObject

An arbitrary string attached to the object. Often useful for displaying to users. Referenced as ‘memo’ in the Dashboard.



1274
1275
1276
# File 'lib/stripe/services/invoice_service.rb', line 1274

def description
  @description
end

#discountsObject

The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice’s customer. Pass an empty string to avoid inheriting any discounts.



1276
1277
1278
# File 'lib/stripe/services/invoice_service.rb', line 1276

def discounts
  @discounts
end

#due_dateObject

The date on which payment for this invoice is due. Valid only for invoices where ‘collection_method=send_invoice`.



1278
1279
1280
# File 'lib/stripe/services/invoice_service.rb', line 1278

def due_date
  @due_date
end

#effective_atObject

The date when this invoice is in effect. Same as ‘finalized_at` unless overwritten. When defined, this value replaces the system-generated ’Date of issue’ printed on the invoice PDF and receipt.



1280
1281
1282
# File 'lib/stripe/services/invoice_service.rb', line 1280

def effective_at
  @effective_at
end

#expandObject

Specifies which fields in the response should be expanded.



1282
1283
1284
# File 'lib/stripe/services/invoice_service.rb', line 1282

def expand
  @expand
end

Footer to be displayed on the invoice.



1284
1285
1286
# File 'lib/stripe/services/invoice_service.rb', line 1284

def footer
  @footer
end

#from_invoiceObject

Revise an existing invoice. The new invoice will be created in ‘status=draft`. See the [revision documentation](stripe.com/docs/invoicing/invoice-revisions) for more details.



1286
1287
1288
# File 'lib/stripe/services/invoice_service.rb', line 1286

def from_invoice
  @from_invoice
end

#issuerObject

The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.



1288
1289
1290
# File 'lib/stripe/services/invoice_service.rb', line 1288

def issuer
  @issuer
end

#metadataObject

Set of [key-value pairs](stripe.com/docs/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`.



1290
1291
1292
# File 'lib/stripe/services/invoice_service.rb', line 1290

def 
  @metadata
end

#numberObject

Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.



1292
1293
1294
# File 'lib/stripe/services/invoice_service.rb', line 1292

def number
  @number
end

#on_behalf_ofObject

The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](stripe.com/docs/billing/invoices/connect) documentation for details.



1294
1295
1296
# File 'lib/stripe/services/invoice_service.rb', line 1294

def on_behalf_of
  @on_behalf_of
end

#payment_settingsObject

Configuration settings for the PaymentIntent that is generated when the invoice is finalized.



1296
1297
1298
# File 'lib/stripe/services/invoice_service.rb', line 1296

def payment_settings
  @payment_settings
end

#pending_invoice_items_behaviorObject

How to handle pending invoice items on invoice creation. Defaults to ‘exclude` if the parameter is omitted.



1298
1299
1300
# File 'lib/stripe/services/invoice_service.rb', line 1298

def pending_invoice_items_behavior
  @pending_invoice_items_behavior
end

#renderingObject

The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.



1300
1301
1302
# File 'lib/stripe/services/invoice_service.rb', line 1300

def rendering
  @rendering
end

#shipping_costObject

Settings for the cost of shipping for this invoice.



1302
1303
1304
# File 'lib/stripe/services/invoice_service.rb', line 1302

def shipping_cost
  @shipping_cost
end

#shipping_detailsObject

Shipping details for the invoice. The Invoice PDF will use the ‘shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.



1304
1305
1306
# File 'lib/stripe/services/invoice_service.rb', line 1304

def shipping_details
  @shipping_details
end

#statement_descriptorObject

Extra information about a charge for the customer’s credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default ‘statement_descriptor` will be set to the first subscription item’s product’s ‘statement_descriptor`.



1306
1307
1308
# File 'lib/stripe/services/invoice_service.rb', line 1306

def statement_descriptor
  @statement_descriptor
end

#subscriptionObject

The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription’s billing cycle and regular subscription events won’t be affected.



1308
1309
1310
# File 'lib/stripe/services/invoice_service.rb', line 1308

def subscription
  @subscription
end

#transfer_dataObject

If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice’s charge.



1310
1311
1312
# File 'lib/stripe/services/invoice_service.rb', line 1310

def transfer_data
  @transfer_data
end