• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16599

29 Oct 2024 11:04PM UTC coverage: 12.519% (-0.1%) from 12.62%
#16599

push

github

web-flow
Merge pull request #1914 from stripe/latest-codegen-beta

Update generated code for beta

40 of 1580 new or added lines in 51 files covered. (2.53%)

19 existing lines in 15 files now uncovered.

18843 of 150513 relevant lines covered (12.52%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/stripe/model/QuotePreviewInvoice.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.billing.CreditBalanceTransaction;
7
import com.stripe.model.testhelpers.TestClock;
8
import com.stripe.net.ApiRequest;
9
import com.stripe.net.ApiRequestParams;
10
import com.stripe.net.ApiResource;
11
import com.stripe.net.BaseAddress;
12
import com.stripe.net.RequestOptions;
13
import com.stripe.net.StripeResponseGetter;
14
import com.stripe.param.QuotePreviewInvoiceListParams;
15
import java.util.List;
16
import java.util.Map;
17
import java.util.stream.Collectors;
18
import lombok.EqualsAndHashCode;
19
import lombok.Getter;
20
import lombok.Setter;
21

22
/**
23
 * Invoices are statements of amounts owed by a customer, and are either generated one-off, or
24
 * generated periodically from a subscription.
25
 *
26
 * <p>They contain <a href="https://stripe.com/docs/api#invoiceitems">invoice items</a>, and
27
 * proration adjustments that may be caused by subscription upgrades/downgrades (if necessary).
28
 *
29
 * <p>If your invoice is configured to be billed through automatic charges, Stripe automatically
30
 * finalizes your invoice and attempts payment. Note that finalizing the invoice, <a
31
 * href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">when
32
 * automatic</a>, does not happen immediately as the invoice is created. Stripe waits until one hour
33
 * after the last webhook was successfully sent (or the last webhook timed out after failing). If
34
 * you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one
35
 * hour after creation to finalize the invoice.
36
 *
37
 * <p>If your invoice is configured to be billed by sending an email, then based on your <a
38
 * href="https://dashboard.stripe.com/account/billing/automatic">email settings</a>, Stripe will
39
 * email the invoice to your customer and await payment. These emails can contain a link to a hosted
40
 * page to pay the invoice.
41
 *
42
 * <p>Stripe applies any customer credit on the account before determining the amount due for the
43
 * invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is
44
 * less than Stripe's <a
45
 * href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">minimum allowed
46
 * charge per currency</a>, the invoice is automatically marked paid, and we add the amount due to
47
 * the customer's credit balance which is applied to the next invoice.
48
 *
49
 * <p>More details on the customer's credit balance are <a
50
 * href="https://stripe.com/docs/billing/customer/balance">here</a>.
51
 *
52
 * <p>Related guide: <a href="https://stripe.com/docs/billing/invoices/sending">Send invoices to
53
 * customers</a>
54
 */
55
@Getter
56
@Setter
57
@EqualsAndHashCode(callSuper = false)
58
public class QuotePreviewInvoice extends ApiResource implements HasId {
×
59
  /**
60
   * The country of the business associated with this invoice, most often the business creating the
61
   * invoice.
62
   */
63
  @SerializedName("account_country")
64
  String accountCountry;
65

66
  /**
67
   * The public name of the business associated with this invoice, most often the business creating
68
   * the invoice.
69
   */
70
  @SerializedName("account_name")
71
  String accountName;
72

73
  /** The account tax IDs associated with the invoice. Only editable when the invoice is a draft. */
74
  @SerializedName("account_tax_ids")
75
  List<ExpandableField<TaxId>> accountTaxIds;
76

77
  /**
78
   * Final amount due at this time for this invoice. If the invoice's total is smaller than the
79
   * minimum charge amount, for example, or if there is account credit that can be applied to the
80
   * invoice, the {@code amount_due} may be 0. If there is a positive {@code starting_balance} for
81
   * the invoice (the customer owes money), the {@code amount_due} will also take that into account.
82
   * The charge that gets generated for the invoice will be for the amount specified in {@code
83
   * amount_due}.
84
   */
85
  @SerializedName("amount_due")
86
  Long amountDue;
87

88
  /** The amount, in cents (or local equivalent), that was paid. */
89
  @SerializedName("amount_paid")
90
  Long amountPaid;
91

92
  /** The difference between amount_due and amount_paid, in cents (or local equivalent). */
93
  @SerializedName("amount_remaining")
94
  Long amountRemaining;
95

96
  /** This is the sum of all the shipping amounts. */
97
  @SerializedName("amount_shipping")
98
  Long amountShipping;
99

100
  /**
101
   * List of expected payments and corresponding due dates. This value will be null for invoices
102
   * where collection_method=charge_automatically.
103
   */
104
  @SerializedName("amounts_due")
105
  List<QuotePreviewInvoice.AmountsDue> amountsDue;
106

107
  /** ID of the Connect Application that created the invoice. */
108
  @SerializedName("application")
109
  @Getter(lombok.AccessLevel.NONE)
110
  @Setter(lombok.AccessLevel.NONE)
111
  ExpandableField<Application> application;
112

113
  /**
114
   * The fee in cents (or local equivalent) that will be applied to the invoice and transferred to
115
   * the application owner's Stripe account when the invoice is paid.
116
   */
117
  @SerializedName("application_fee_amount")
118
  Long applicationFeeAmount;
119

120
  @SerializedName("applies_to")
121
  AppliesTo appliesTo;
122

123
  /**
124
   * Number of payment attempts made for this invoice, from the perspective of the payment retry
125
   * schedule. Any payment attempt counts as the first attempt, and subsequently only automatic
126
   * retries increment the attempt count. In other words, manual payment attempts after the first
127
   * attempt do not affect the retry schedule. If a failure is returned with a non-retryable return
128
   * code, the invoice can no longer be retried unless a new payment method is obtained. Retries
129
   * will continue to be scheduled, and attempt_count will continue to increment, but retries will
130
   * only be executed if a new payment method is obtained.
131
   */
132
  @SerializedName("attempt_count")
133
  Long attemptCount;
134

135
  /**
136
   * Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour
137
   * after the {@code invoice.created} webhook, for example, so you might not want to display that
138
   * invoice as unpaid to your users.
139
   */
140
  @SerializedName("attempted")
141
  Boolean attempted;
142

143
  @SerializedName("automatic_tax")
144
  AutomaticTax automaticTax;
145

146
  /**
147
   * The time when this invoice is currently scheduled to be automatically finalized. The field will
148
   * be {@code null} if the invoice is not scheduled to finalize in the future. If the invoice is
149
   * not in the draft state, this field will always be {@code null} - see {@code finalized_at} for
150
   * the time when an already-finalized invoice was finalized.
151
   */
152
  @SerializedName("automatically_finalizes_at")
153
  Long automaticallyFinalizesAt;
154

155
  /**
156
   * Indicates the reason why the invoice was created.
157
   *
158
   * <p>* {@code manual}: Unrelated to a subscription, for example, created via the invoice editor.
159
   * * {@code subscription}: No longer in use. Applies to subscriptions from before May 2018 where
160
   * no distinction was made between updates, cycles, and thresholds. * {@code subscription_create}:
161
   * A new subscription was created. * {@code subscription_cycle}: A subscription advanced into a
162
   * new period. * {@code subscription_threshold}: A subscription reached a billing threshold. *
163
   * {@code subscription_update}: A subscription was updated. * {@code upcoming}: Reserved for
164
   * simulated invoices, per the upcoming invoice endpoint.
165
   *
166
   * <p>One of {@code automatic_pending_invoice_item_invoice}, {@code manual}, {@code quote_accept},
167
   * {@code subscription}, {@code subscription_create}, {@code subscription_cycle}, {@code
168
   * subscription_threshold}, {@code subscription_update}, or {@code upcoming}.
169
   */
170
  @SerializedName("billing_reason")
171
  String billingReason;
172

173
  /**
174
   * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically,
175
   * Stripe will attempt to pay this invoice using the default source attached to the customer. When
176
   * sending an invoice, Stripe will email this invoice to the customer with payment instructions.
177
   *
178
   * <p>One of {@code charge_automatically}, or {@code send_invoice}.
179
   */
180
  @SerializedName("collection_method")
181
  String collectionMethod;
182

183
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
184
  @SerializedName("created")
185
  Long created;
186

187
  /**
188
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
189
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
190
   */
191
  @SerializedName("currency")
192
  String currency;
193

194
  /** Custom fields displayed on the invoice. */
195
  @SerializedName("custom_fields")
196
  List<QuotePreviewInvoice.CustomField> customFields;
197

198
  /**
199
   * The customer's address. Until the invoice is finalized, this field will equal {@code
200
   * customer.address}. Once the invoice is finalized, this field will no longer be updated.
201
   */
202
  @SerializedName("customer_address")
203
  Address customerAddress;
204

205
  /**
206
   * The customer's email. Until the invoice is finalized, this field will equal {@code
207
   * customer.email}. Once the invoice is finalized, this field will no longer be updated.
208
   */
209
  @SerializedName("customer_email")
210
  String customerEmail;
211

212
  /**
213
   * The customer's name. Until the invoice is finalized, this field will equal {@code
214
   * customer.name}. Once the invoice is finalized, this field will no longer be updated.
215
   */
216
  @SerializedName("customer_name")
217
  String customerName;
218

219
  /**
220
   * The customer's phone number. Until the invoice is finalized, this field will equal {@code
221
   * customer.phone}. Once the invoice is finalized, this field will no longer be updated.
222
   */
223
  @SerializedName("customer_phone")
224
  String customerPhone;
225

226
  /**
227
   * The customer's shipping information. Until the invoice is finalized, this field will equal
228
   * {@code customer.shipping}. Once the invoice is finalized, this field will no longer be updated.
229
   */
230
  @SerializedName("customer_shipping")
231
  ShippingDetails customerShipping;
232

233
  /**
234
   * The customer's tax exempt status. Until the invoice is finalized, this field will equal {@code
235
   * customer.tax_exempt}. Once the invoice is finalized, this field will no longer be updated.
236
   *
237
   * <p>One of {@code exempt}, {@code none}, or {@code reverse}.
238
   */
239
  @SerializedName("customer_tax_exempt")
240
  String customerTaxExempt;
241

242
  /**
243
   * The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax
244
   * IDs as {@code customer.tax_ids}. Once the invoice is finalized, this field will no longer be
245
   * updated.
246
   */
247
  @SerializedName("customer_tax_ids")
248
  List<QuotePreviewInvoice.CustomerTaxId> customerTaxIds;
249

250
  /**
251
   * The margins applied to the invoice. Can be overridden by line item {@code margins}. Use {@code
252
   * expand[]=default_margins} to expand each margin.
253
   */
254
  @SerializedName("default_margins")
255
  List<ExpandableField<Margin>> defaultMargins;
256

257
  /**
258
   * ID of the default payment method for the invoice. It must belong to the customer associated
259
   * with the invoice. If not set, defaults to the subscription's default payment method, if any, or
260
   * to the default payment method in the customer's invoice settings.
261
   */
262
  @SerializedName("default_payment_method")
263
  @Getter(lombok.AccessLevel.NONE)
264
  @Setter(lombok.AccessLevel.NONE)
265
  ExpandableField<PaymentMethod> defaultPaymentMethod;
266

267
  /**
268
   * ID of the default payment source for the invoice. It must belong to the customer associated
269
   * with the invoice and be in a chargeable state. If not set, defaults to the subscription's
270
   * default source, if any, or to the customer's default source.
271
   */
272
  @SerializedName("default_source")
273
  @Getter(lombok.AccessLevel.NONE)
274
  @Setter(lombok.AccessLevel.NONE)
275
  ExpandableField<PaymentSource> defaultSource;
276

277
  /** The tax rates applied to this invoice, if any. */
278
  @SerializedName("default_tax_rates")
279
  List<TaxRate> defaultTaxRates;
280

281
  /**
282
   * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as
283
   * 'memo' in the Dashboard.
284
   */
285
  @SerializedName("description")
286
  String description;
287

288
  /**
289
   * Describes the current discount applied to this invoice, if there is one. Not populated if there
290
   * are multiple discounts.
291
   */
292
  @SerializedName("discount")
293
  Discount discount;
294

295
  /**
296
   * The discounts applied to the invoice. Line item discounts are applied before invoice discounts.
297
   * Use {@code expand[]=discounts} to expand each discount.
298
   */
299
  @SerializedName("discounts")
300
  List<ExpandableField<Discount>> discounts;
301

302
  /**
303
   * The date on which payment for this invoice is due. This value will be {@code null} for invoices
304
   * where {@code collection_method=charge_automatically}.
305
   */
306
  @SerializedName("due_date")
307
  Long dueDate;
308

309
  /**
310
   * The date when this invoice is in effect. Same as {@code finalized_at} unless overwritten. When
311
   * defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF
312
   * and receipt.
313
   */
314
  @SerializedName("effective_at")
315
  Long effectiveAt;
316

317
  /**
318
   * Ending customer balance after the invoice is finalized. Invoices are finalized approximately an
319
   * hour after successful webhook delivery or when payment collection is attempted for the invoice.
320
   * If the invoice has not been finalized yet, this will be null.
321
   */
322
  @SerializedName("ending_balance")
323
  Long endingBalance;
324

325
  /** Footer displayed on the invoice. */
326
  @SerializedName("footer")
327
  String footer;
328

329
  /**
330
   * Details of the invoice that was cloned. See the <a
331
   * href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more
332
   * details.
333
   */
334
  @SerializedName("from_invoice")
335
  FromInvoice fromInvoice;
336

337
  /**
338
   * Unique identifier for the object. This property is always present unless the invoice is an
339
   * upcoming invoice. See <a href="https://stripe.com/docs/api/invoices/upcoming">Retrieve an
340
   * upcoming invoice</a> for more details.
341
   */
342
  @Getter(onMethod_ = {@Override})
343
  @SerializedName("id")
344
  String id;
345

346
  @SerializedName("issuer")
347
  Issuer issuer;
348

349
  /**
350
   * The error encountered during the previous attempt to finalize the invoice. This field is
351
   * cleared when the invoice is successfully finalized.
352
   */
353
  @SerializedName("last_finalization_error")
354
  StripeError lastFinalizationError;
355

356
  /** The ID of the most recent non-draft revision of this invoice. */
357
  @SerializedName("latest_revision")
358
  @Getter(lombok.AccessLevel.NONE)
359
  @Setter(lombok.AccessLevel.NONE)
360
  ExpandableField<Invoice> latestRevision;
361

362
  /**
363
   * The individual line items that make up the invoice. {@code lines} is sorted as follows: (1)
364
   * pending invoice items (including prorations) in reverse chronological order, (2) subscription
365
   * items in reverse chronological order, and (3) invoice items added after invoice creation in
366
   * chronological order.
367
   */
368
  @SerializedName("lines")
369
  InvoiceLineItemCollection lines;
370

371
  /**
372
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
373
   * object exists in test mode.
374
   */
375
  @SerializedName("livemode")
376
  Boolean livemode;
377

378
  /**
379
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
380
   * to an object. This can be useful for storing additional information about the object in a
381
   * structured format.
382
   */
383
  @SerializedName("metadata")
384
  Map<String, String> metadata;
385

386
  /**
387
   * The time at which payment will next be attempted. This value will be {@code null} for invoices
388
   * where {@code collection_method=send_invoice}.
389
   */
390
  @SerializedName("next_payment_attempt")
391
  Long nextPaymentAttempt;
392

393
  /**
394
   * A unique, identifying string that appears on emails sent to the customer for this invoice. This
395
   * starts with the customer's unique invoice_prefix if it is specified.
396
   */
397
  @SerializedName("number")
398
  String number;
399

400
  /**
401
   * String representing the object's type. Objects of the same type share the same value.
402
   *
403
   * <p>Equal to {@code quote_preview_invoice}.
404
   */
405
  @SerializedName("object")
406
  String object;
407

408
  /**
409
   * The account (if any) for which the funds of the invoice payment are intended. If set, the
410
   * invoice will be presented with the branding and support information of the specified account.
411
   * See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a>
412
   * documentation for details.
413
   */
414
  @SerializedName("on_behalf_of")
415
  @Getter(lombok.AccessLevel.NONE)
416
  @Setter(lombok.AccessLevel.NONE)
417
  ExpandableField<Account> onBehalfOf;
418

419
  /**
420
   * Whether payment was successfully collected for this invoice. An invoice can be paid (most
421
   * commonly) with a charge or with credit from the customer's account balance.
422
   */
423
  @SerializedName("paid")
424
  Boolean paid;
425

426
  /**
427
   * Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been
428
   * paid yet or was paid on Stripe.
429
   */
430
  @SerializedName("paid_out_of_band")
431
  Boolean paidOutOfBand;
432

433
  /**
434
   * The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice
435
   * is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel
436
   * the PaymentIntent.
437
   */
438
  @SerializedName("payment_intent")
439
  @Getter(lombok.AccessLevel.NONE)
440
  @Setter(lombok.AccessLevel.NONE)
441
  ExpandableField<PaymentIntent> paymentIntent;
442

443
  @SerializedName("payment_settings")
444
  PaymentSettings paymentSettings;
445

446
  /** Payments for this invoice. */
447
  @SerializedName("payments")
448
  InvoicePaymentCollection payments;
449

450
  /**
451
   * End of the usage period during which invoice items were added to this invoice. This looks back
452
   * one period for a subscription invoice. Use the <a
453
   * href="https://stripe.com/api/invoices/line_item#invoice_line_item_object-period">line item
454
   * period</a> to get the service period for each price.
455
   */
456
  @SerializedName("period_end")
457
  Long periodEnd;
458

459
  /**
460
   * Start of the usage period during which invoice items were added to this invoice. This looks
461
   * back one period for a subscription invoice. Use the <a
462
   * href="https://stripe.com/api/invoices/line_item#invoice_line_item_object-period">line item
463
   * period</a> to get the service period for each price.
464
   */
465
  @SerializedName("period_start")
466
  Long periodStart;
467

468
  /** Total amount of all post-payment credit notes issued for this invoice. */
469
  @SerializedName("post_payment_credit_notes_amount")
470
  Long postPaymentCreditNotesAmount;
471

472
  /** Total amount of all pre-payment credit notes issued for this invoice. */
473
  @SerializedName("pre_payment_credit_notes_amount")
474
  Long prePaymentCreditNotesAmount;
475

476
  /** The quote this invoice was generated from. */
477
  @SerializedName("quote")
478
  @Getter(lombok.AccessLevel.NONE)
479
  @Setter(lombok.AccessLevel.NONE)
480
  ExpandableField<Quote> quote;
481

482
  /** This is the transaction number that appears on email receipts sent for this invoice. */
483
  @SerializedName("receipt_number")
484
  String receiptNumber;
485

486
  /**
487
   * The rendering-related settings that control how the invoice is displayed on customer-facing
488
   * surfaces such as PDF and Hosted Invoice Page.
489
   */
490
  @SerializedName("rendering")
491
  Rendering rendering;
492

493
  /** The details of the cost of shipping, including the ShippingRate applied on the invoice. */
494
  @SerializedName("shipping_cost")
495
  ShippingCost shippingCost;
496

497
  /**
498
   * Shipping details for the invoice. The Invoice PDF will use the {@code shipping_details} value
499
   * if it is set, otherwise the PDF will render the shipping address from the customer.
500
   */
501
  @SerializedName("shipping_details")
502
  ShippingDetails shippingDetails;
503

504
  /**
505
   * Starting customer balance before the invoice is finalized. If the invoice has not been
506
   * finalized yet, this will be the current customer balance. For revision invoices, this also
507
   * includes any customer balance that was applied to the original invoice.
508
   */
509
  @SerializedName("starting_balance")
510
  Long startingBalance;
511

512
  /** Extra information about an invoice for the customer's credit card statement. */
513
  @SerializedName("statement_descriptor")
514
  String statementDescriptor;
515

516
  /**
517
   * The status of the invoice, one of {@code draft}, {@code open}, {@code paid}, {@code
518
   * uncollectible}, or {@code void}. <a
519
   * href="https://stripe.com/docs/billing/invoices/workflow#workflow-overview">Learn more</a>
520
   */
521
  @SerializedName("status")
522
  String status;
523

524
  @SerializedName("status_transitions")
525
  StatusTransitions statusTransitions;
526

527
  @SerializedName("subscription")
528
  @Getter(lombok.AccessLevel.NONE)
529
  @Setter(lombok.AccessLevel.NONE)
530
  ExpandableField<Subscription> subscription;
531

532
  /** Details about the subscription that created this invoice. */
533
  @SerializedName("subscription_details")
534
  SubscriptionDetails subscriptionDetails;
535

536
  /**
537
   * Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
538
   */
539
  @SerializedName("subscription_proration_date")
540
  Long subscriptionProrationDate;
541

542
  /**
543
   * Total of all subscriptions, invoice items, and prorations on the invoice before any invoice
544
   * level discount or exclusive tax is applied. Item discounts are already incorporated
545
   */
546
  @SerializedName("subtotal")
547
  Long subtotal;
548

549
  /**
550
   * The integer amount in cents (or local equivalent) representing the subtotal of the invoice
551
   * before any invoice level discount or tax is applied. Item discounts are already incorporated
552
   */
553
  @SerializedName("subtotal_excluding_tax")
554
  Long subtotalExcludingTax;
555

556
  /** The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. */
557
  @SerializedName("tax")
558
  Long tax;
559

560
  /** ID of the test clock this invoice belongs to. */
561
  @SerializedName("test_clock")
562
  @Getter(lombok.AccessLevel.NONE)
563
  @Setter(lombok.AccessLevel.NONE)
564
  ExpandableField<TestClock> testClock;
565

566
  @SerializedName("threshold_reason")
567
  ThresholdReason thresholdReason;
568

569
  /** Total after discounts and taxes. */
570
  @SerializedName("total")
571
  Long total;
572

573
  /** The aggregate amounts calculated per discount across all line items. */
574
  @SerializedName("total_discount_amounts")
575
  List<QuotePreviewInvoice.TotalDiscountAmount> totalDiscountAmounts;
576

577
  /**
578
   * The integer amount in cents (or local equivalent) representing the total amount of the invoice
579
   * including all discounts but excluding all tax.
580
   */
581
  @SerializedName("total_excluding_tax")
582
  Long totalExcludingTax;
583

584
  /** The aggregate amounts calculated per margin across all line items. */
585
  @SerializedName("total_margin_amounts")
586
  List<QuotePreviewInvoice.TotalMarginAmount> totalMarginAmounts;
587

588
  /**
589
   * Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice.
590
   * This is a combined list of total_pretax_credit_amounts across all invoice line items.
591
   */
592
  @SerializedName("total_pretax_credit_amounts")
593
  List<QuotePreviewInvoice.TotalPretaxCreditAmount> totalPretaxCreditAmounts;
594

595
  /** The aggregate amounts calculated per tax rate for all line items. */
596
  @SerializedName("total_tax_amounts")
597
  List<QuotePreviewInvoice.TotalTaxAmount> totalTaxAmounts;
598

599
  /**
600
   * The account (if any) the payment will be attributed to for tax reporting, and where funds from
601
   * the payment will be transferred to for the invoice.
602
   */
603
  @SerializedName("transfer_data")
604
  TransferData transferData;
605

606
  /**
607
   * Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all
608
   * webhook delivery attempts have <a
609
   * href="https://stripe.com/docs/billing/webhooks#understand">been exhausted</a>. This field
610
   * tracks the time when webhooks for this invoice were successfully delivered. If the invoice had
611
   * no webhooks to deliver, this will be set while the invoice is being created.
612
   */
613
  @SerializedName("webhooks_delivered_at")
614
  Long webhooksDeliveredAt;
615

616
  /** Get ID of expandable {@code application} object. */
617
  public String getApplication() {
618
    return (this.application != null) ? this.application.getId() : null;
×
619
  }
620

621
  public void setApplication(String id) {
622
    this.application = ApiResource.setExpandableFieldId(id, this.application);
×
623
  }
×
624

625
  /** Get expanded {@code application}. */
626
  public Application getApplicationObject() {
627
    return (this.application != null) ? this.application.getExpanded() : null;
×
628
  }
629

630
  public void setApplicationObject(Application expandableObject) {
631
    this.application = new ExpandableField<Application>(expandableObject.getId(), expandableObject);
×
632
  }
×
633

634
  /** Get ID of expandable {@code defaultPaymentMethod} object. */
635
  public String getDefaultPaymentMethod() {
636
    return (this.defaultPaymentMethod != null) ? this.defaultPaymentMethod.getId() : null;
×
637
  }
638

639
  public void setDefaultPaymentMethod(String id) {
640
    this.defaultPaymentMethod = ApiResource.setExpandableFieldId(id, this.defaultPaymentMethod);
×
641
  }
×
642

643
  /** Get expanded {@code defaultPaymentMethod}. */
644
  public PaymentMethod getDefaultPaymentMethodObject() {
645
    return (this.defaultPaymentMethod != null) ? this.defaultPaymentMethod.getExpanded() : null;
×
646
  }
647

648
  public void setDefaultPaymentMethodObject(PaymentMethod expandableObject) {
649
    this.defaultPaymentMethod =
×
650
        new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
×
651
  }
×
652

653
  /** Get ID of expandable {@code defaultSource} object. */
654
  public String getDefaultSource() {
655
    return (this.defaultSource != null) ? this.defaultSource.getId() : null;
×
656
  }
657

658
  public void setDefaultSource(String id) {
659
    this.defaultSource = ApiResource.setExpandableFieldId(id, this.defaultSource);
×
660
  }
×
661

662
  /** Get expanded {@code defaultSource}. */
663
  public PaymentSource getDefaultSourceObject() {
664
    return (this.defaultSource != null) ? this.defaultSource.getExpanded() : null;
×
665
  }
666

667
  public void setDefaultSourceObject(PaymentSource expandableObject) {
668
    this.defaultSource =
×
669
        new ExpandableField<PaymentSource>(expandableObject.getId(), expandableObject);
×
670
  }
×
671

672
  /** Get ID of expandable {@code latestRevision} object. */
673
  public String getLatestRevision() {
674
    return (this.latestRevision != null) ? this.latestRevision.getId() : null;
×
675
  }
676

677
  public void setLatestRevision(String id) {
678
    this.latestRevision = ApiResource.setExpandableFieldId(id, this.latestRevision);
×
679
  }
×
680

681
  /** Get expanded {@code latestRevision}. */
682
  public Invoice getLatestRevisionObject() {
683
    return (this.latestRevision != null) ? this.latestRevision.getExpanded() : null;
×
684
  }
685

686
  public void setLatestRevisionObject(Invoice expandableObject) {
687
    this.latestRevision = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
×
688
  }
×
689

690
  /** Get ID of expandable {@code onBehalfOf} object. */
691
  public String getOnBehalfOf() {
692
    return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
×
693
  }
694

695
  public void setOnBehalfOf(String id) {
696
    this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
×
697
  }
×
698

699
  /** Get expanded {@code onBehalfOf}. */
700
  public Account getOnBehalfOfObject() {
701
    return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
×
702
  }
703

704
  public void setOnBehalfOfObject(Account expandableObject) {
705
    this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
706
  }
×
707

708
  /** Get ID of expandable {@code paymentIntent} object. */
709
  public String getPaymentIntent() {
710
    return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
711
  }
712

713
  public void setPaymentIntent(String id) {
714
    this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
715
  }
×
716

717
  /** Get expanded {@code paymentIntent}. */
718
  public PaymentIntent getPaymentIntentObject() {
719
    return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
720
  }
721

722
  public void setPaymentIntentObject(PaymentIntent expandableObject) {
723
    this.paymentIntent =
×
724
        new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
725
  }
×
726

727
  /** Get ID of expandable {@code quote} object. */
728
  public String getQuote() {
729
    return (this.quote != null) ? this.quote.getId() : null;
×
730
  }
731

732
  public void setQuote(String id) {
733
    this.quote = ApiResource.setExpandableFieldId(id, this.quote);
×
734
  }
×
735

736
  /** Get expanded {@code quote}. */
737
  public Quote getQuoteObject() {
738
    return (this.quote != null) ? this.quote.getExpanded() : null;
×
739
  }
740

741
  public void setQuoteObject(Quote expandableObject) {
742
    this.quote = new ExpandableField<Quote>(expandableObject.getId(), expandableObject);
×
743
  }
×
744

745
  /** Get ID of expandable {@code subscription} object. */
746
  public String getSubscription() {
747
    return (this.subscription != null) ? this.subscription.getId() : null;
×
748
  }
749

750
  public void setSubscription(String id) {
751
    this.subscription = ApiResource.setExpandableFieldId(id, this.subscription);
×
752
  }
×
753

754
  /** Get expanded {@code subscription}. */
755
  public Subscription getSubscriptionObject() {
756
    return (this.subscription != null) ? this.subscription.getExpanded() : null;
×
757
  }
758

759
  public void setSubscriptionObject(Subscription expandableObject) {
760
    this.subscription =
×
761
        new ExpandableField<Subscription>(expandableObject.getId(), expandableObject);
×
762
  }
×
763

764
  /** Get ID of expandable {@code testClock} object. */
765
  public String getTestClock() {
766
    return (this.testClock != null) ? this.testClock.getId() : null;
×
767
  }
768

769
  public void setTestClock(String id) {
770
    this.testClock = ApiResource.setExpandableFieldId(id, this.testClock);
×
771
  }
×
772

773
  /** Get expanded {@code testClock}. */
774
  public TestClock getTestClockObject() {
775
    return (this.testClock != null) ? this.testClock.getExpanded() : null;
×
776
  }
777

778
  public void setTestClockObject(TestClock expandableObject) {
779
    this.testClock = new ExpandableField<TestClock>(expandableObject.getId(), expandableObject);
×
780
  }
×
781

782
  /** Get IDs of expandable {@code accountTaxIds} object list. */
783
  public List<String> getAccountTaxIds() {
784
    return (this.accountTaxIds != null)
×
785
        ? this.accountTaxIds.stream().map(x -> x.getId()).collect(Collectors.toList())
×
786
        : null;
×
787
  }
788

789
  public void setAccountTaxIds(List<String> ids) {
790
    if (ids == null) {
×
791
      this.accountTaxIds = null;
×
792
      return;
×
793
    }
794
    if (this.accountTaxIds != null
×
795
        && this.accountTaxIds.stream()
×
796
            .map(x -> x.getId())
×
797
            .collect(Collectors.toList())
×
798
            .equals(ids)) {
×
799
      // noop if the ids are equal to what are already present
800
      return;
×
801
    }
802
    this.accountTaxIds =
×
803
        (ids != null)
×
804
            ? ids.stream()
×
805
                .map(id -> new ExpandableField<TaxId>(id, null))
×
806
                .collect(Collectors.toList())
×
807
            : null;
×
808
  }
×
809

810
  /** Get expanded {@code accountTaxIds}. */
811
  public List<TaxId> getAccountTaxIdObjects() {
812
    return (this.accountTaxIds != null)
×
813
        ? this.accountTaxIds.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
814
        : null;
×
815
  }
816

817
  public void setAccountTaxIdObjects(List<TaxId> objs) {
818
    this.accountTaxIds =
×
819
        objs != null
×
820
            ? objs.stream()
×
821
                .map(x -> new ExpandableField<TaxId>(x.getId(), x))
×
822
                .collect(Collectors.toList())
×
823
            : null;
×
824
  }
×
825

826
  /** Get IDs of expandable {@code defaultMargins} object list. */
827
  public List<String> getDefaultMargins() {
828
    return (this.defaultMargins != null)
×
829
        ? this.defaultMargins.stream().map(x -> x.getId()).collect(Collectors.toList())
×
830
        : null;
×
831
  }
832

833
  public void setDefaultMargins(List<String> ids) {
834
    if (ids == null) {
×
835
      this.defaultMargins = null;
×
836
      return;
×
837
    }
838
    if (this.defaultMargins != null
×
839
        && this.defaultMargins.stream()
×
840
            .map(x -> x.getId())
×
841
            .collect(Collectors.toList())
×
842
            .equals(ids)) {
×
843
      // noop if the ids are equal to what are already present
844
      return;
×
845
    }
846
    this.defaultMargins =
×
847
        (ids != null)
×
848
            ? ids.stream()
×
849
                .map(id -> new ExpandableField<Margin>(id, null))
×
850
                .collect(Collectors.toList())
×
851
            : null;
×
852
  }
×
853

854
  /** Get expanded {@code defaultMargins}. */
855
  public List<Margin> getDefaultMarginObjects() {
856
    return (this.defaultMargins != null)
×
857
        ? this.defaultMargins.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
858
        : null;
×
859
  }
860

861
  public void setDefaultMarginObjects(List<Margin> objs) {
862
    this.defaultMargins =
×
863
        objs != null
×
864
            ? objs.stream()
×
865
                .map(x -> new ExpandableField<Margin>(x.getId(), x))
×
866
                .collect(Collectors.toList())
×
867
            : null;
×
868
  }
×
869

870
  /** Get IDs of expandable {@code discounts} object list. */
871
  public List<String> getDiscounts() {
872
    return (this.discounts != null)
×
873
        ? this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList())
×
874
        : null;
×
875
  }
876

877
  public void setDiscounts(List<String> ids) {
878
    if (ids == null) {
×
879
      this.discounts = null;
×
880
      return;
×
881
    }
882
    if (this.discounts != null
×
883
        && this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList()).equals(ids)) {
×
884
      // noop if the ids are equal to what are already present
885
      return;
×
886
    }
887
    this.discounts =
×
888
        (ids != null)
×
889
            ? ids.stream()
×
890
                .map(id -> new ExpandableField<Discount>(id, null))
×
891
                .collect(Collectors.toList())
×
892
            : null;
×
893
  }
×
894

895
  /** Get expanded {@code discounts}. */
896
  public List<Discount> getDiscountObjects() {
897
    return (this.discounts != null)
×
898
        ? this.discounts.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
899
        : null;
×
900
  }
901

902
  public void setDiscountObjects(List<Discount> objs) {
903
    this.discounts =
×
904
        objs != null
×
905
            ? objs.stream()
×
906
                .map(x -> new ExpandableField<Discount>(x.getId(), x))
×
907
                .collect(Collectors.toList())
×
908
            : null;
×
909
  }
×
910

911
  /** Preview the invoices that would be generated by accepting the quote. */
912
  public static QuotePreviewInvoiceCollection list(String quote, Map<String, Object> params)
913
      throws StripeException {
914
    return list(quote, params, (RequestOptions) null);
×
915
  }
916

917
  /** Preview the invoices that would be generated by accepting the quote. */
918
  public static QuotePreviewInvoiceCollection list(
919
      String quote, Map<String, Object> params, RequestOptions options) throws StripeException {
920
    String path = String.format("/v1/quotes/%s/preview_invoices", ApiResource.urlEncodeId(quote));
×
921
    ApiRequest request =
×
922
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
923
    return getGlobalResponseGetter().request(request, QuotePreviewInvoiceCollection.class);
×
924
  }
925

926
  /** Preview the invoices that would be generated by accepting the quote. */
927
  public static QuotePreviewInvoiceCollection list(
928
      String quote, QuotePreviewInvoiceListParams params) throws StripeException {
929
    return list(quote, params, (RequestOptions) null);
×
930
  }
931

932
  /** Preview the invoices that would be generated by accepting the quote. */
933
  public static QuotePreviewInvoiceCollection list(
934
      String quote, QuotePreviewInvoiceListParams params, RequestOptions options)
935
      throws StripeException {
936
    String path = String.format("/v1/quotes/%s/preview_invoices", ApiResource.urlEncodeId(quote));
×
937
    ApiResource.checkNullTypedParams(path, params);
×
938
    ApiRequest request =
×
939
        new ApiRequest(
940
            BaseAddress.API,
941
            ApiResource.RequestMethod.GET,
942
            path,
943
            ApiRequestParams.paramsToMap(params),
×
944
            options);
945
    return getGlobalResponseGetter().request(request, QuotePreviewInvoiceCollection.class);
×
946
  }
947

948
  /**
949
   * For more details about AmountsDue, please refer to the <a
950
   * href="https://docs.stripe.com/api">API Reference.</a>
951
   */
952
  @Getter
953
  @Setter
954
  @EqualsAndHashCode(callSuper = false)
955
  public static class AmountsDue extends StripeObject {
×
956
    /** Incremental amount due for this payment in cents (or local equivalent). */
957
    @SerializedName("amount")
958
    Long amount;
959

960
    /** The amount in cents (or local equivalent) that was paid for this payment. */
961
    @SerializedName("amount_paid")
962
    Long amountPaid;
963

964
    /**
965
     * The difference between the payment’s amount and amount_paid, in cents (or local equivalent).
966
     */
967
    @SerializedName("amount_remaining")
968
    Long amountRemaining;
969

970
    /** Number of days from when invoice is finalized until the payment is due. */
971
    @SerializedName("days_until_due")
972
    Long daysUntilDue;
973

974
    /** An arbitrary string attached to the object. Often useful for displaying to users. */
975
    @SerializedName("description")
976
    String description;
977

978
    /** Date on which a payment plan’s payment is due. */
979
    @SerializedName("due_date")
980
    Long dueDate;
981

982
    /** Timestamp when the payment was paid. */
983
    @SerializedName("paid_at")
984
    Long paidAt;
985

986
    /** The status of the payment, one of {@code open}, {@code paid}, or {@code past_due}. */
987
    @SerializedName("status")
988
    String status;
989
  }
990

991
  /**
992
   * For more details about AppliesTo, please refer to the <a href="https://docs.stripe.com/api">API
993
   * Reference.</a>
994
   */
995
  @Getter
996
  @Setter
997
  @EqualsAndHashCode(callSuper = false)
998
  public static class AppliesTo extends StripeObject {
×
999
    /**
1000
     * A custom string that identifies a new subscription schedule being created upon quote
1001
     * acceptance. All quote lines with the same {@code new_reference} field will be applied to the
1002
     * creation of a new subscription schedule.
1003
     */
1004
    @SerializedName("new_reference")
1005
    String newReference;
1006

1007
    /** The ID of the schedule the line applies to. */
1008
    @SerializedName("subscription_schedule")
1009
    String subscriptionSchedule;
1010

1011
    /**
1012
     * Describes whether the quote line is affecting a new schedule or an existing schedule.
1013
     *
1014
     * <p>One of {@code new_reference}, or {@code subscription_schedule}.
1015
     */
1016
    @SerializedName("type")
1017
    String type;
1018
  }
1019

1020
  /**
1021
   * For more details about AutomaticTax, please refer to the <a
1022
   * href="https://docs.stripe.com/api">API Reference.</a>
1023
   */
1024
  @Getter
1025
  @Setter
1026
  @EqualsAndHashCode(callSuper = false)
1027
  public static class AutomaticTax extends StripeObject {
×
1028
    /**
1029
     * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice
1030
     * items (invoice items with manually specified <a
1031
     * href="https://stripe.com/docs/api/tax_rates">tax rates</a>, negative amounts, or {@code
1032
     * tax_behavior=unspecified}) cannot be added to automatic tax invoices.
1033
     */
1034
    @SerializedName("enabled")
1035
    Boolean enabled;
1036

1037
    /**
1038
     * The account that's liable for tax. If set, the business address and tax registrations
1039
     * required to perform the tax calculation are loaded from this account. The tax transaction is
1040
     * returned in the report of the connected account.
1041
     */
1042
    @SerializedName("liability")
1043
    Liability liability;
1044

1045
    /**
1046
     * The status of the most recent automated tax calculation for this invoice.
1047
     *
1048
     * <p>One of {@code complete}, {@code failed}, or {@code requires_location_inputs}.
1049
     */
1050
    @SerializedName("status")
1051
    String status;
1052

1053
    /**
1054
     * For more details about Liability, please refer to the <a
1055
     * href="https://docs.stripe.com/api">API Reference.</a>
1056
     */
1057
    @Getter
1058
    @Setter
1059
    @EqualsAndHashCode(callSuper = false)
1060
    public static class Liability extends StripeObject {
×
1061
      /** The connected account being referenced when {@code type} is {@code account}. */
1062
      @SerializedName("account")
1063
      @Getter(lombok.AccessLevel.NONE)
1064
      @Setter(lombok.AccessLevel.NONE)
1065
      ExpandableField<Account> account;
1066

1067
      /**
1068
       * Type of the account referenced.
1069
       *
1070
       * <p>One of {@code account}, or {@code self}.
1071
       */
1072
      @SerializedName("type")
1073
      String type;
1074

1075
      /** Get ID of expandable {@code account} object. */
1076
      public String getAccount() {
1077
        return (this.account != null) ? this.account.getId() : null;
×
1078
      }
1079

1080
      public void setAccount(String id) {
1081
        this.account = ApiResource.setExpandableFieldId(id, this.account);
×
1082
      }
×
1083

1084
      /** Get expanded {@code account}. */
1085
      public Account getAccountObject() {
1086
        return (this.account != null) ? this.account.getExpanded() : null;
×
1087
      }
1088

1089
      public void setAccountObject(Account expandableObject) {
1090
        this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1091
      }
×
1092
    }
1093
  }
1094

1095
  /**
1096
   * For more details about CustomField, please refer to the <a
1097
   * href="https://docs.stripe.com/api">API Reference.</a>
1098
   */
1099
  @Getter
1100
  @Setter
1101
  @EqualsAndHashCode(callSuper = false)
1102
  public static class CustomField extends StripeObject {
×
1103
    /** The name of the custom field. */
1104
    @SerializedName("name")
1105
    String name;
1106

1107
    /** The value of the custom field. */
1108
    @SerializedName("value")
1109
    String value;
1110
  }
1111

1112
  /**
1113
   * For more details about CustomerTaxId, please refer to the <a
1114
   * href="https://docs.stripe.com/api">API Reference.</a>
1115
   */
1116
  @Getter
1117
  @Setter
1118
  @EqualsAndHashCode(callSuper = false)
1119
  public static class CustomerTaxId extends StripeObject {
×
1120
    /**
1121
     * The type of the tax ID, one of {@code ad_nrt}, {@code ar_cuit}, {@code eu_vat}, {@code
1122
     * bo_tin}, {@code br_cnpj}, {@code br_cpf}, {@code cn_tin}, {@code co_nit}, {@code cr_tin},
1123
     * {@code do_rcn}, {@code ec_ruc}, {@code eu_oss_vat}, {@code hr_oib}, {@code pe_ruc}, {@code
1124
     * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin},
1125
     * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code
1126
     * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen},
1127
     * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat},
1128
     * {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code my_itn},
1129
     * {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code
1130
     * ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code
1131
     * cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat},
1132
     * {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code
1133
     * ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, {@code kz_bin},
1134
     * {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code
1135
     * uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or {@code unknown}.
1136
     */
1137
    @SerializedName("type")
1138
    String type;
1139

1140
    /** The value of the tax ID. */
1141
    @SerializedName("value")
1142
    String value;
1143
  }
1144

1145
  /**
1146
   * For more details about FromInvoice, please refer to the <a
1147
   * href="https://docs.stripe.com/api">API Reference.</a>
1148
   */
1149
  @Getter
1150
  @Setter
1151
  @EqualsAndHashCode(callSuper = false)
1152
  public static class FromInvoice extends StripeObject {
×
1153
    /** The relation between this invoice and the cloned invoice. */
1154
    @SerializedName("action")
1155
    String action;
1156

1157
    /** The invoice that was cloned. */
1158
    @SerializedName("invoice")
1159
    @Getter(lombok.AccessLevel.NONE)
1160
    @Setter(lombok.AccessLevel.NONE)
1161
    ExpandableField<Invoice> invoice;
1162

1163
    /** Get ID of expandable {@code invoice} object. */
1164
    public String getInvoice() {
1165
      return (this.invoice != null) ? this.invoice.getId() : null;
×
1166
    }
1167

1168
    public void setInvoice(String id) {
1169
      this.invoice = ApiResource.setExpandableFieldId(id, this.invoice);
×
1170
    }
×
1171

1172
    /** Get expanded {@code invoice}. */
1173
    public Invoice getInvoiceObject() {
1174
      return (this.invoice != null) ? this.invoice.getExpanded() : null;
×
1175
    }
1176

1177
    public void setInvoiceObject(Invoice expandableObject) {
1178
      this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
×
1179
    }
×
1180
  }
1181

1182
  /**
1183
   * For more details about Issuer, please refer to the <a href="https://docs.stripe.com/api">API
1184
   * Reference.</a>
1185
   */
1186
  @Getter
1187
  @Setter
1188
  @EqualsAndHashCode(callSuper = false)
1189
  public static class Issuer extends StripeObject {
×
1190
    /** The connected account being referenced when {@code type} is {@code account}. */
1191
    @SerializedName("account")
1192
    @Getter(lombok.AccessLevel.NONE)
1193
    @Setter(lombok.AccessLevel.NONE)
1194
    ExpandableField<Account> account;
1195

1196
    /**
1197
     * Type of the account referenced.
1198
     *
1199
     * <p>One of {@code account}, or {@code self}.
1200
     */
1201
    @SerializedName("type")
1202
    String type;
1203

1204
    /** Get ID of expandable {@code account} object. */
1205
    public String getAccount() {
1206
      return (this.account != null) ? this.account.getId() : null;
×
1207
    }
1208

1209
    public void setAccount(String id) {
1210
      this.account = ApiResource.setExpandableFieldId(id, this.account);
×
1211
    }
×
1212

1213
    /** Get expanded {@code account}. */
1214
    public Account getAccountObject() {
1215
      return (this.account != null) ? this.account.getExpanded() : null;
×
1216
    }
1217

1218
    public void setAccountObject(Account expandableObject) {
1219
      this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1220
    }
×
1221
  }
1222

1223
  /**
1224
   * For more details about PaymentSettings, please refer to the <a
1225
   * href="https://docs.stripe.com/api">API Reference.</a>
1226
   */
1227
  @Getter
1228
  @Setter
1229
  @EqualsAndHashCode(callSuper = false)
1230
  public static class PaymentSettings extends StripeObject {
×
1231
    /**
1232
     * ID of the mandate to be used for this invoice. It must correspond to the payment method used
1233
     * to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1234
     */
1235
    @SerializedName("default_mandate")
1236
    String defaultMandate;
1237

1238
    /** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
1239
    @SerializedName("payment_method_options")
1240
    PaymentMethodOptions paymentMethodOptions;
1241

1242
    /**
1243
     * The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
1244
     * not set, Stripe attempts to automatically determine the types to use by looking at the
1245
     * invoice’s default payment method, the subscription’s default payment method, the customer’s
1246
     * default payment method, and your <a
1247
     * href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
1248
     */
1249
    @SerializedName("payment_method_types")
1250
    List<String> paymentMethodTypes;
1251

1252
    /**
1253
     * For more details about PaymentMethodOptions, please refer to the <a
1254
     * href="https://docs.stripe.com/api">API Reference.</a>
1255
     */
1256
    @Getter
1257
    @Setter
1258
    @EqualsAndHashCode(callSuper = false)
1259
    public static class PaymentMethodOptions extends StripeObject {
×
1260
      /**
1261
       * If paying by {@code acss_debit}, this sub-hash contains details about the Canadian
1262
       * pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1263
       */
1264
      @SerializedName("acss_debit")
1265
      AcssDebit acssDebit;
1266

1267
      /**
1268
       * If paying by {@code bancontact}, this sub-hash contains details about the Bancontact
1269
       * payment method options to pass to the invoice’s PaymentIntent.
1270
       */
1271
      @SerializedName("bancontact")
1272
      Bancontact bancontact;
1273

1274
      /**
1275
       * If paying by {@code card}, this sub-hash contains details about the Card payment method
1276
       * options to pass to the invoice’s PaymentIntent.
1277
       */
1278
      @SerializedName("card")
1279
      Card card;
1280

1281
      /**
1282
       * If paying by {@code customer_balance}, this sub-hash contains details about the Bank
1283
       * transfer payment method options to pass to the invoice’s PaymentIntent.
1284
       */
1285
      @SerializedName("customer_balance")
1286
      CustomerBalance customerBalance;
1287

1288
      /**
1289
       * If paying by {@code id_bank_transfer}, this sub-hash contains details about the Indonesia
1290
       * bank transfer payment method options to pass to the invoice’s PaymentIntent.
1291
       */
1292
      @SerializedName("id_bank_transfer")
1293
      IdBankTransfer idBankTransfer;
1294

1295
      /**
1296
       * If paying by {@code konbini}, this sub-hash contains details about the Konbini payment
1297
       * method options to pass to the invoice’s PaymentIntent.
1298
       */
1299
      @SerializedName("konbini")
1300
      Konbini konbini;
1301

1302
      /**
1303
       * If paying by {@code sepa_debit}, this sub-hash contains details about the SEPA Direct Debit
1304
       * payment method options to pass to the invoice’s PaymentIntent.
1305
       */
1306
      @SerializedName("sepa_debit")
1307
      SepaDebit sepaDebit;
1308

1309
      /**
1310
       * If paying by {@code us_bank_account}, this sub-hash contains details about the ACH direct
1311
       * debit payment method options to pass to the invoice’s PaymentIntent.
1312
       */
1313
      @SerializedName("us_bank_account")
1314
      UsBankAccount usBankAccount;
1315

1316
      /**
1317
       * For more details about AcssDebit, please refer to the <a
1318
       * href="https://docs.stripe.com/api">API Reference.</a>
1319
       */
1320
      @Getter
1321
      @Setter
1322
      @EqualsAndHashCode(callSuper = false)
1323
      public static class AcssDebit extends StripeObject {
×
1324
        @SerializedName("mandate_options")
1325
        MandateOptions mandateOptions;
1326

1327
        /**
1328
         * Bank account verification method.
1329
         *
1330
         * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1331
         */
1332
        @SerializedName("verification_method")
1333
        String verificationMethod;
1334

1335
        /**
1336
         * For more details about MandateOptions, please refer to the <a
1337
         * href="https://docs.stripe.com/api">API Reference.</a>
1338
         */
1339
        @Getter
1340
        @Setter
1341
        @EqualsAndHashCode(callSuper = false)
1342
        public static class MandateOptions extends StripeObject {
×
1343
          /**
1344
           * Transaction type of the mandate.
1345
           *
1346
           * <p>One of {@code business}, or {@code personal}.
1347
           */
1348
          @SerializedName("transaction_type")
1349
          String transactionType;
1350
        }
1351
      }
1352

1353
      /**
1354
       * For more details about Bancontact, please refer to the <a
1355
       * href="https://docs.stripe.com/api">API Reference.</a>
1356
       */
1357
      @Getter
1358
      @Setter
1359
      @EqualsAndHashCode(callSuper = false)
1360
      public static class Bancontact extends StripeObject {
×
1361
        /**
1362
         * Preferred language of the Bancontact authorization page that the customer is redirected
1363
         * to.
1364
         *
1365
         * <p>One of {@code de}, {@code en}, {@code fr}, or {@code nl}.
1366
         */
1367
        @SerializedName("preferred_language")
1368
        String preferredLanguage;
1369
      }
1370

1371
      /**
1372
       * For more details about Card, please refer to the <a href="https://docs.stripe.com/api">API
1373
       * Reference.</a>
1374
       */
1375
      @Getter
1376
      @Setter
1377
      @EqualsAndHashCode(callSuper = false)
1378
      public static class Card extends StripeObject {
×
1379
        @SerializedName("installments")
1380
        Installments installments;
1381

1382
        /**
1383
         * We strongly recommend that you rely on our SCA Engine to automatically prompt your
1384
         * customers for authentication based on risk level and <a
1385
         * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
1386
         * However, if you wish to request 3D Secure based on logic from your own fraud engine,
1387
         * provide this option. Read our guide on <a
1388
         * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
1389
         * requesting 3D Secure</a> for more information on how this configuration interacts with
1390
         * Radar and our SCA Engine.
1391
         *
1392
         * <p>One of {@code any}, {@code automatic}, or {@code challenge}.
1393
         */
1394
        @SerializedName("request_three_d_secure")
1395
        String requestThreeDSecure;
1396

1397
        /**
1398
         * For more details about Installments, please refer to the <a
1399
         * href="https://docs.stripe.com/api">API Reference.</a>
1400
         */
1401
        @Getter
1402
        @Setter
1403
        @EqualsAndHashCode(callSuper = false)
1404
        public static class Installments extends StripeObject {
×
1405
          /** Whether Installments are enabled for this Invoice. */
1406
          @SerializedName("enabled")
1407
          Boolean enabled;
1408
        }
1409
      }
1410

1411
      /**
1412
       * For more details about CustomerBalance, please refer to the <a
1413
       * href="https://docs.stripe.com/api">API Reference.</a>
1414
       */
1415
      @Getter
1416
      @Setter
1417
      @EqualsAndHashCode(callSuper = false)
1418
      public static class CustomerBalance extends StripeObject {
×
1419
        @SerializedName("bank_transfer")
1420
        BankTransfer bankTransfer;
1421

1422
        /**
1423
         * The funding method type to be used when there are not enough funds in the customer
1424
         * balance. Permitted values include: {@code bank_transfer}.
1425
         *
1426
         * <p>Equal to {@code bank_transfer}.
1427
         */
1428
        @SerializedName("funding_type")
1429
        String fundingType;
1430

1431
        /**
1432
         * For more details about BankTransfer, please refer to the <a
1433
         * href="https://docs.stripe.com/api">API Reference.</a>
1434
         */
1435
        @Getter
1436
        @Setter
1437
        @EqualsAndHashCode(callSuper = false)
1438
        public static class BankTransfer extends StripeObject {
×
1439
          @SerializedName("eu_bank_transfer")
1440
          EuBankTransfer euBankTransfer;
1441

1442
          /**
1443
           * The bank transfer type that can be used for funding. Permitted values include: {@code
1444
           * eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer}, {@code
1445
           * mx_bank_transfer}, or {@code us_bank_transfer}.
1446
           */
1447
          @SerializedName("type")
1448
          String type;
1449

1450
          /**
1451
           * For more details about EuBankTransfer, please refer to the <a
1452
           * href="https://docs.stripe.com/api">API Reference.</a>
1453
           */
1454
          @Getter
1455
          @Setter
1456
          @EqualsAndHashCode(callSuper = false)
1457
          public static class EuBankTransfer extends StripeObject {
×
1458
            /**
1459
             * The desired country code of the bank account information. Permitted values include:
1460
             * {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}.
1461
             *
1462
             * <p>One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}.
1463
             */
1464
            @SerializedName("country")
1465
            String country;
1466
          }
1467
        }
1468
      }
1469

1470
      /**
1471
       * For more details about IdBankTransfer, please refer to the <a
1472
       * href="https://docs.stripe.com/api">API Reference.</a>
1473
       */
1474
      @Getter
1475
      @Setter
1476
      @EqualsAndHashCode(callSuper = false)
NEW
1477
      public static class IdBankTransfer extends StripeObject {}
×
1478

1479
      /**
1480
       * For more details about Konbini, please refer to the <a
1481
       * href="https://docs.stripe.com/api">API Reference.</a>
1482
       */
1483
      @Getter
1484
      @Setter
1485
      @EqualsAndHashCode(callSuper = false)
1486
      public static class Konbini extends StripeObject {}
×
1487

1488
      /**
1489
       * For more details about SepaDebit, please refer to the <a
1490
       * href="https://docs.stripe.com/api">API Reference.</a>
1491
       */
1492
      @Getter
1493
      @Setter
1494
      @EqualsAndHashCode(callSuper = false)
1495
      public static class SepaDebit extends StripeObject {}
×
1496

1497
      /**
1498
       * For more details about UsBankAccount, please refer to the <a
1499
       * href="https://docs.stripe.com/api">API Reference.</a>
1500
       */
1501
      @Getter
1502
      @Setter
1503
      @EqualsAndHashCode(callSuper = false)
1504
      public static class UsBankAccount extends StripeObject {
×
1505
        @SerializedName("financial_connections")
1506
        FinancialConnections financialConnections;
1507

1508
        /**
1509
         * Bank account verification method.
1510
         *
1511
         * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1512
         */
1513
        @SerializedName("verification_method")
1514
        String verificationMethod;
1515

1516
        /**
1517
         * For more details about FinancialConnections, please refer to the <a
1518
         * href="https://docs.stripe.com/api">API Reference.</a>
1519
         */
1520
        @Getter
1521
        @Setter
1522
        @EqualsAndHashCode(callSuper = false)
1523
        public static class FinancialConnections extends StripeObject {
×
1524
          @SerializedName("filters")
1525
          Filters filters;
1526

1527
          /**
1528
           * The list of permissions to request. The {@code payment_method} permission must be
1529
           * included.
1530
           */
1531
          @SerializedName("permissions")
1532
          List<String> permissions;
1533

1534
          /** Data features requested to be retrieved upon account creation. */
1535
          @SerializedName("prefetch")
1536
          List<String> prefetch;
1537

1538
          /**
1539
           * For more details about Filters, please refer to the <a
1540
           * href="https://docs.stripe.com/api">API Reference.</a>
1541
           */
1542
          @Getter
1543
          @Setter
1544
          @EqualsAndHashCode(callSuper = false)
1545
          public static class Filters extends StripeObject {
×
1546
            /**
1547
             * The account subcategories to use to filter for possible accounts to link. Valid
1548
             * subcategories are {@code checking} and {@code savings}.
1549
             */
1550
            @SerializedName("account_subcategories")
1551
            List<String> accountSubcategories;
1552

1553
            /** The institution to use to filter for possible accounts to link. */
1554
            @SerializedName("institution")
1555
            String institution;
1556
          }
1557
        }
1558
      }
1559
    }
1560
  }
1561

1562
  /**
1563
   * For more details about Rendering, please refer to the <a href="https://docs.stripe.com/api">API
1564
   * Reference.</a>
1565
   */
1566
  @Getter
1567
  @Setter
1568
  @EqualsAndHashCode(callSuper = false)
1569
  public static class Rendering extends StripeObject {
×
1570
    /** How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. */
1571
    @SerializedName("amount_tax_display")
1572
    String amountTaxDisplay;
1573

1574
    /** Invoice pdf rendering options. */
1575
    @SerializedName("pdf")
1576
    Pdf pdf;
1577

1578
    /** ID of the rendering template that the invoice is formatted by. */
1579
    @SerializedName("template")
1580
    String template;
1581

1582
    /** Version of the rendering template that the invoice is using. */
1583
    @SerializedName("template_version")
1584
    Long templateVersion;
1585

1586
    /**
1587
     * For more details about Pdf, please refer to the <a href="https://docs.stripe.com/api">API
1588
     * Reference.</a>
1589
     */
1590
    @Getter
1591
    @Setter
1592
    @EqualsAndHashCode(callSuper = false)
1593
    public static class Pdf extends StripeObject {
×
1594
      /**
1595
       * Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size
1596
       * will be switched to a4 or letter based on customer locale.
1597
       *
1598
       * <p>One of {@code a4}, {@code auto}, or {@code letter}.
1599
       */
1600
      @SerializedName("page_size")
1601
      String pageSize;
1602
    }
1603
  }
1604

1605
  /**
1606
   * For more details about ShippingCost, please refer to the <a
1607
   * href="https://docs.stripe.com/api">API Reference.</a>
1608
   */
1609
  @Getter
1610
  @Setter
1611
  @EqualsAndHashCode(callSuper = false)
1612
  public static class ShippingCost extends StripeObject {
×
1613
    /** Total shipping cost before any taxes are applied. */
1614
    @SerializedName("amount_subtotal")
1615
    Long amountSubtotal;
1616

1617
    /** Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. */
1618
    @SerializedName("amount_tax")
1619
    Long amountTax;
1620

1621
    /** Total shipping cost after taxes are applied. */
1622
    @SerializedName("amount_total")
1623
    Long amountTotal;
1624

1625
    /** The ID of the ShippingRate for this invoice. */
1626
    @SerializedName("shipping_rate")
1627
    @Getter(lombok.AccessLevel.NONE)
1628
    @Setter(lombok.AccessLevel.NONE)
1629
    ExpandableField<ShippingRate> shippingRate;
1630

1631
    /** The taxes applied to the shipping rate. */
1632
    @SerializedName("taxes")
1633
    List<QuotePreviewInvoice.ShippingCost.Tax> taxes;
1634

1635
    /** Get ID of expandable {@code shippingRate} object. */
1636
    public String getShippingRate() {
1637
      return (this.shippingRate != null) ? this.shippingRate.getId() : null;
×
1638
    }
1639

1640
    public void setShippingRate(String id) {
1641
      this.shippingRate = ApiResource.setExpandableFieldId(id, this.shippingRate);
×
1642
    }
×
1643

1644
    /** Get expanded {@code shippingRate}. */
1645
    public ShippingRate getShippingRateObject() {
1646
      return (this.shippingRate != null) ? this.shippingRate.getExpanded() : null;
×
1647
    }
1648

1649
    public void setShippingRateObject(ShippingRate expandableObject) {
1650
      this.shippingRate =
×
1651
          new ExpandableField<ShippingRate>(expandableObject.getId(), expandableObject);
×
1652
    }
×
1653

1654
    /**
1655
     * For more details about Tax, please refer to the <a href="https://docs.stripe.com/api">API
1656
     * Reference.</a>
1657
     */
1658
    @Getter
1659
    @Setter
1660
    @EqualsAndHashCode(callSuper = false)
1661
    public static class Tax extends StripeObject {
×
1662
      /** Amount of tax applied for this rate. */
1663
      @SerializedName("amount")
1664
      Long amount;
1665

1666
      /**
1667
       * Tax rates can be applied to <a
1668
       * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
1669
       * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
1670
       * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
1671
       * Sessions</a> to collect tax.
1672
       *
1673
       * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
1674
       */
1675
      @SerializedName("rate")
1676
      TaxRate rate;
1677

1678
      /**
1679
       * The reasoning behind this tax, for example, if the product is tax exempt. The possible
1680
       * values for this field may be extended as new tax rules are supported.
1681
       *
1682
       * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
1683
       * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
1684
       * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
1685
       * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
1686
       * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
1687
       */
1688
      @SerializedName("taxability_reason")
1689
      String taxabilityReason;
1690

1691
      /** The amount on which tax is calculated, in cents (or local equivalent). */
1692
      @SerializedName("taxable_amount")
1693
      Long taxableAmount;
1694
    }
1695
  }
1696

1697
  /**
1698
   * For more details about StatusTransitions, please refer to the <a
1699
   * href="https://docs.stripe.com/api">API Reference.</a>
1700
   */
1701
  @Getter
1702
  @Setter
1703
  @EqualsAndHashCode(callSuper = false)
1704
  public static class StatusTransitions extends StripeObject {
×
1705
    /** The time that the invoice draft was finalized. */
1706
    @SerializedName("finalized_at")
1707
    Long finalizedAt;
1708

1709
    /** The time that the invoice was marked uncollectible. */
1710
    @SerializedName("marked_uncollectible_at")
1711
    Long markedUncollectibleAt;
1712

1713
    /** The time that the invoice was paid. */
1714
    @SerializedName("paid_at")
1715
    Long paidAt;
1716

1717
    /** The time that the invoice was voided. */
1718
    @SerializedName("voided_at")
1719
    Long voidedAt;
1720
  }
1721

1722
  /**
1723
   * For more details about SubscriptionDetails, please refer to the <a
1724
   * href="https://docs.stripe.com/api">API Reference.</a>
1725
   */
1726
  @Getter
1727
  @Setter
1728
  @EqualsAndHashCode(callSuper = false)
1729
  public static class SubscriptionDetails extends StripeObject {
×
1730
    /**
1731
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> defined as
1732
     * subscription metadata when an invoice is created. Becomes an immutable snapshot of the
1733
     * subscription metadata at the time of invoice finalization. <em>Note: This attribute is
1734
     * populated only for invoices created on or after June 29, 2023.</em>
1735
     */
1736
    @SerializedName("metadata")
1737
    Map<String, String> metadata;
1738

1739
    /**
1740
     * If specified, payment collection for this subscription will be paused. Note that the
1741
     * subscription status will be unchanged and will not be updated to {@code paused}. Learn more
1742
     * about <a href="https://stripe.com/billing/subscriptions/pause-payment">pausing
1743
     * collection</a>.
1744
     */
1745
    @SerializedName("pause_collection")
1746
    PauseCollection pauseCollection;
1747

1748
    /**
1749
     * The Pause Collection settings determine how we will pause collection for this subscription
1750
     * and for how long the subscription should be paused.
1751
     */
1752
    @Getter
1753
    @Setter
1754
    @EqualsAndHashCode(callSuper = false)
1755
    public static class PauseCollection extends StripeObject {
×
1756
      /**
1757
       * The payment collection behavior for this subscription while paused. One of {@code
1758
       * keep_as_draft}, {@code mark_uncollectible}, or {@code void}.
1759
       */
1760
      @SerializedName("behavior")
1761
      String behavior;
1762

1763
      /** The time after which the subscription will resume collecting payments. */
1764
      @SerializedName("resumes_at")
1765
      Long resumesAt;
1766
    }
1767
  }
1768

1769
  /**
1770
   * For more details about ThresholdReason, please refer to the <a
1771
   * href="https://docs.stripe.com/api">API Reference.</a>
1772
   */
1773
  @Getter
1774
  @Setter
1775
  @EqualsAndHashCode(callSuper = false)
1776
  public static class ThresholdReason extends StripeObject {
×
1777
    /** The total invoice amount threshold boundary if it triggered the threshold invoice. */
1778
    @SerializedName("amount_gte")
1779
    Long amountGte;
1780

1781
    /** Indicates which line items triggered a threshold invoice. */
1782
    @SerializedName("item_reasons")
1783
    List<QuotePreviewInvoice.ThresholdReason.ItemReason> itemReasons;
1784

1785
    /**
1786
     * For more details about ItemReason, please refer to the <a
1787
     * href="https://docs.stripe.com/api">API Reference.</a>
1788
     */
1789
    @Getter
1790
    @Setter
1791
    @EqualsAndHashCode(callSuper = false)
1792
    public static class ItemReason extends StripeObject {
×
1793
      /** The IDs of the line items that triggered the threshold invoice. */
1794
      @SerializedName("line_item_ids")
1795
      List<String> lineItemIds;
1796

1797
      /** The quantity threshold boundary that applied to the given line item. */
1798
      @SerializedName("usage_gte")
1799
      Long usageGte;
1800
    }
1801
  }
1802

1803
  /**
1804
   * For more details about TotalDiscountAmount, please refer to the <a
1805
   * href="https://docs.stripe.com/api">API Reference.</a>
1806
   */
1807
  @Getter
1808
  @Setter
1809
  @EqualsAndHashCode(callSuper = false)
1810
  public static class TotalDiscountAmount extends StripeObject {
×
1811
    /** The amount, in cents (or local equivalent), of the discount. */
1812
    @SerializedName("amount")
1813
    Long amount;
1814

1815
    /** The discount that was applied to get this discount amount. */
1816
    @SerializedName("discount")
1817
    @Getter(lombok.AccessLevel.NONE)
1818
    @Setter(lombok.AccessLevel.NONE)
1819
    ExpandableField<Discount> discount;
1820

1821
    /** Get ID of expandable {@code discount} object. */
1822
    public String getDiscount() {
1823
      return (this.discount != null) ? this.discount.getId() : null;
×
1824
    }
1825

1826
    public void setDiscount(String id) {
1827
      this.discount = ApiResource.setExpandableFieldId(id, this.discount);
×
1828
    }
×
1829

1830
    /** Get expanded {@code discount}. */
1831
    public Discount getDiscountObject() {
1832
      return (this.discount != null) ? this.discount.getExpanded() : null;
×
1833
    }
1834

1835
    public void setDiscountObject(Discount expandableObject) {
1836
      this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
×
1837
    }
×
1838
  }
1839

1840
  /**
1841
   * For more details about TotalMarginAmount, please refer to the <a
1842
   * href="https://docs.stripe.com/api">API Reference.</a>
1843
   */
1844
  @Getter
1845
  @Setter
1846
  @EqualsAndHashCode(callSuper = false)
1847
  public static class TotalMarginAmount extends StripeObject {
×
1848
    /** The amount, in cents (or local equivalent), of the reduction in line item amount. */
1849
    @SerializedName("amount")
1850
    Long amount;
1851

1852
    /** The margin that was applied to get this margin amount. */
1853
    @SerializedName("margin")
1854
    @Getter(lombok.AccessLevel.NONE)
1855
    @Setter(lombok.AccessLevel.NONE)
1856
    ExpandableField<Margin> margin;
1857

1858
    /** Get ID of expandable {@code margin} object. */
1859
    public String getMargin() {
1860
      return (this.margin != null) ? this.margin.getId() : null;
×
1861
    }
1862

1863
    public void setMargin(String id) {
1864
      this.margin = ApiResource.setExpandableFieldId(id, this.margin);
×
1865
    }
×
1866

1867
    /** Get expanded {@code margin}. */
1868
    public Margin getMarginObject() {
1869
      return (this.margin != null) ? this.margin.getExpanded() : null;
×
1870
    }
1871

1872
    public void setMarginObject(Margin expandableObject) {
1873
      this.margin = new ExpandableField<Margin>(expandableObject.getId(), expandableObject);
×
1874
    }
×
1875
  }
1876

1877
  /**
1878
   * For more details about TotalPretaxCreditAmount, please refer to the <a
1879
   * href="https://docs.stripe.com/api">API Reference.</a>
1880
   */
1881
  @Getter
1882
  @Setter
1883
  @EqualsAndHashCode(callSuper = false)
1884
  public static class TotalPretaxCreditAmount extends StripeObject {
×
1885
    /** The amount, in cents (or local equivalent), of the pretax credit amount. */
1886
    @SerializedName("amount")
1887
    Long amount;
1888

1889
    /** The credit balance transaction that was applied to get this pretax credit amount. */
1890
    @SerializedName("credit_balance_transaction")
1891
    @Getter(lombok.AccessLevel.NONE)
1892
    @Setter(lombok.AccessLevel.NONE)
1893
    ExpandableField<CreditBalanceTransaction> creditBalanceTransaction;
1894

1895
    /** The discount that was applied to get this pretax credit amount. */
1896
    @SerializedName("discount")
1897
    @Getter(lombok.AccessLevel.NONE)
1898
    @Setter(lombok.AccessLevel.NONE)
1899
    ExpandableField<Discount> discount;
1900

1901
    /** The margin that was applied to get this pretax credit amount. */
1902
    @SerializedName("margin")
1903
    @Getter(lombok.AccessLevel.NONE)
1904
    @Setter(lombok.AccessLevel.NONE)
1905
    ExpandableField<Margin> margin;
1906

1907
    /**
1908
     * Type of the pretax credit amount referenced.
1909
     *
1910
     * <p>One of {@code credit_balance_transaction}, {@code discount}, or {@code margin}.
1911
     */
1912
    @SerializedName("type")
1913
    String type;
1914

1915
    /** Get ID of expandable {@code creditBalanceTransaction} object. */
1916
    public String getCreditBalanceTransaction() {
1917
      return (this.creditBalanceTransaction != null) ? this.creditBalanceTransaction.getId() : null;
×
1918
    }
1919

1920
    public void setCreditBalanceTransaction(String id) {
1921
      this.creditBalanceTransaction =
×
1922
          ApiResource.setExpandableFieldId(id, this.creditBalanceTransaction);
×
1923
    }
×
1924

1925
    /** Get expanded {@code creditBalanceTransaction}. */
1926
    public CreditBalanceTransaction getCreditBalanceTransactionObject() {
1927
      return (this.creditBalanceTransaction != null)
×
1928
          ? this.creditBalanceTransaction.getExpanded()
×
1929
          : null;
×
1930
    }
1931

1932
    public void setCreditBalanceTransactionObject(CreditBalanceTransaction expandableObject) {
1933
      this.creditBalanceTransaction =
×
1934
          new ExpandableField<CreditBalanceTransaction>(expandableObject.getId(), expandableObject);
×
1935
    }
×
1936

1937
    /** Get ID of expandable {@code discount} object. */
1938
    public String getDiscount() {
1939
      return (this.discount != null) ? this.discount.getId() : null;
×
1940
    }
1941

1942
    public void setDiscount(String id) {
1943
      this.discount = ApiResource.setExpandableFieldId(id, this.discount);
×
1944
    }
×
1945

1946
    /** Get expanded {@code discount}. */
1947
    public Discount getDiscountObject() {
1948
      return (this.discount != null) ? this.discount.getExpanded() : null;
×
1949
    }
1950

1951
    public void setDiscountObject(Discount expandableObject) {
1952
      this.discount = new ExpandableField<Discount>(expandableObject.getId(), expandableObject);
×
1953
    }
×
1954

1955
    /** Get ID of expandable {@code margin} object. */
1956
    public String getMargin() {
1957
      return (this.margin != null) ? this.margin.getId() : null;
×
1958
    }
1959

1960
    public void setMargin(String id) {
1961
      this.margin = ApiResource.setExpandableFieldId(id, this.margin);
×
1962
    }
×
1963

1964
    /** Get expanded {@code margin}. */
1965
    public Margin getMarginObject() {
1966
      return (this.margin != null) ? this.margin.getExpanded() : null;
×
1967
    }
1968

1969
    public void setMarginObject(Margin expandableObject) {
1970
      this.margin = new ExpandableField<Margin>(expandableObject.getId(), expandableObject);
×
1971
    }
×
1972
  }
1973

1974
  /**
1975
   * For more details about TotalTaxAmount, please refer to the <a
1976
   * href="https://docs.stripe.com/api">API Reference.</a>
1977
   */
1978
  @Getter
1979
  @Setter
1980
  @EqualsAndHashCode(callSuper = false)
1981
  public static class TotalTaxAmount extends StripeObject {
×
1982
    /** The amount, in cents (or local equivalent), of the tax. */
1983
    @SerializedName("amount")
1984
    Long amount;
1985

1986
    /** Whether this tax amount is inclusive or exclusive. */
1987
    @SerializedName("inclusive")
1988
    Boolean inclusive;
1989

1990
    /** The tax rate that was applied to get this tax amount. */
1991
    @SerializedName("tax_rate")
1992
    @Getter(lombok.AccessLevel.NONE)
1993
    @Setter(lombok.AccessLevel.NONE)
1994
    ExpandableField<TaxRate> taxRate;
1995

1996
    /**
1997
     * The reasoning behind this tax, for example, if the product is tax exempt. The possible values
1998
     * for this field may be extended as new tax rules are supported.
1999
     *
2000
     * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax}, {@code
2001
     * not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated}, {@code
2002
     * portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday}, {@code
2003
     * proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code standard_rated},
2004
     * {@code taxable_basis_reduced}, or {@code zero_rated}.
2005
     */
2006
    @SerializedName("taxability_reason")
2007
    String taxabilityReason;
2008

2009
    /** The amount on which tax is calculated, in cents (or local equivalent). */
2010
    @SerializedName("taxable_amount")
2011
    Long taxableAmount;
2012

2013
    /** Get ID of expandable {@code taxRate} object. */
2014
    public String getTaxRate() {
2015
      return (this.taxRate != null) ? this.taxRate.getId() : null;
×
2016
    }
2017

2018
    public void setTaxRate(String id) {
2019
      this.taxRate = ApiResource.setExpandableFieldId(id, this.taxRate);
×
2020
    }
×
2021

2022
    /** Get expanded {@code taxRate}. */
2023
    public TaxRate getTaxRateObject() {
2024
      return (this.taxRate != null) ? this.taxRate.getExpanded() : null;
×
2025
    }
2026

2027
    public void setTaxRateObject(TaxRate expandableObject) {
2028
      this.taxRate = new ExpandableField<TaxRate>(expandableObject.getId(), expandableObject);
×
2029
    }
×
2030
  }
2031

2032
  /**
2033
   * For more details about TransferData, please refer to the <a
2034
   * href="https://docs.stripe.com/api">API Reference.</a>
2035
   */
2036
  @Getter
2037
  @Setter
2038
  @EqualsAndHashCode(callSuper = false)
2039
  public static class TransferData extends StripeObject {
×
2040
    /**
2041
     * The amount in cents (or local equivalent) that will be transferred to the destination account
2042
     * when the invoice is paid. By default, the entire amount is transferred to the destination.
2043
     */
2044
    @SerializedName("amount")
2045
    Long amount;
2046

2047
    /** The account where funds from the payment will be transferred to upon payment success. */
2048
    @SerializedName("destination")
2049
    @Getter(lombok.AccessLevel.NONE)
2050
    @Setter(lombok.AccessLevel.NONE)
2051
    ExpandableField<Account> destination;
2052

2053
    /** Get ID of expandable {@code destination} object. */
2054
    public String getDestination() {
2055
      return (this.destination != null) ? this.destination.getId() : null;
×
2056
    }
2057

2058
    public void setDestination(String id) {
2059
      this.destination = ApiResource.setExpandableFieldId(id, this.destination);
×
2060
    }
×
2061

2062
    /** Get expanded {@code destination}. */
2063
    public Account getDestinationObject() {
2064
      return (this.destination != null) ? this.destination.getExpanded() : null;
×
2065
    }
2066

2067
    public void setDestinationObject(Account expandableObject) {
2068
      this.destination = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
2069
    }
×
2070
  }
2071

2072
  @Override
2073
  public void setResponseGetter(StripeResponseGetter responseGetter) {
2074
    super.setResponseGetter(responseGetter);
×
2075
    trySetResponseGetter(application, responseGetter);
×
2076
    trySetResponseGetter(appliesTo, responseGetter);
×
2077
    trySetResponseGetter(automaticTax, responseGetter);
×
2078
    trySetResponseGetter(customerAddress, responseGetter);
×
2079
    trySetResponseGetter(customerShipping, responseGetter);
×
2080
    trySetResponseGetter(defaultPaymentMethod, responseGetter);
×
2081
    trySetResponseGetter(defaultSource, responseGetter);
×
2082
    trySetResponseGetter(discount, responseGetter);
×
2083
    trySetResponseGetter(fromInvoice, responseGetter);
×
2084
    trySetResponseGetter(issuer, responseGetter);
×
2085
    trySetResponseGetter(lastFinalizationError, responseGetter);
×
2086
    trySetResponseGetter(latestRevision, responseGetter);
×
2087
    trySetResponseGetter(lines, responseGetter);
×
2088
    trySetResponseGetter(onBehalfOf, responseGetter);
×
2089
    trySetResponseGetter(paymentIntent, responseGetter);
×
2090
    trySetResponseGetter(paymentSettings, responseGetter);
×
2091
    trySetResponseGetter(payments, responseGetter);
×
2092
    trySetResponseGetter(quote, responseGetter);
×
2093
    trySetResponseGetter(rendering, responseGetter);
×
2094
    trySetResponseGetter(shippingCost, responseGetter);
×
2095
    trySetResponseGetter(shippingDetails, responseGetter);
×
2096
    trySetResponseGetter(statusTransitions, responseGetter);
×
2097
    trySetResponseGetter(subscription, responseGetter);
×
2098
    trySetResponseGetter(subscriptionDetails, responseGetter);
×
2099
    trySetResponseGetter(testClock, responseGetter);
×
2100
    trySetResponseGetter(thresholdReason, responseGetter);
×
2101
    trySetResponseGetter(transferData, responseGetter);
×
2102
  }
×
2103
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc