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

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

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

51.67
/src/main/java/com/stripe/service/InvoiceService.java
1
// File generated from our OpenAPI spec
2
package com.stripe.service;
3

4
import com.google.gson.reflect.TypeToken;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.Invoice;
7
import com.stripe.model.StripeCollection;
8
import com.stripe.model.StripeSearchResult;
9
import com.stripe.net.ApiRequest;
10
import com.stripe.net.ApiRequestParams;
11
import com.stripe.net.ApiResource;
12
import com.stripe.net.ApiService;
13
import com.stripe.net.BaseAddress;
14
import com.stripe.net.RequestOptions;
15
import com.stripe.net.StripeResponseGetter;
16
import com.stripe.param.InvoiceAddLinesParams;
17
import com.stripe.param.InvoiceAttachPaymentIntentParams;
18
import com.stripe.param.InvoiceAttachPaymentParams;
19
import com.stripe.param.InvoiceCreateParams;
20
import com.stripe.param.InvoiceCreatePreviewParams;
21
import com.stripe.param.InvoiceFinalizeInvoiceParams;
22
import com.stripe.param.InvoiceListParams;
23
import com.stripe.param.InvoiceMarkUncollectibleParams;
24
import com.stripe.param.InvoicePayParams;
25
import com.stripe.param.InvoiceRemoveLinesParams;
26
import com.stripe.param.InvoiceRetrieveParams;
27
import com.stripe.param.InvoiceSearchParams;
28
import com.stripe.param.InvoiceSendInvoiceParams;
29
import com.stripe.param.InvoiceUpcomingParams;
30
import com.stripe.param.InvoiceUpdateLinesParams;
31
import com.stripe.param.InvoiceUpdateParams;
32
import com.stripe.param.InvoiceVoidInvoiceParams;
33

34
public final class InvoiceService extends ApiService {
35
  public InvoiceService(StripeResponseGetter responseGetter) {
36
    super(responseGetter);
1✔
37
  }
1✔
38

39
  /**
40
   * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
41
   * that are no longer in a draft state will fail; once an invoice has been finalized or if an
42
   * invoice is for a subscription, it must be <a
43
   * href="https://stripe.com/docs/api#void_invoice">voided</a>.
44
   */
45
  public Invoice delete(String invoice) throws StripeException {
46
    return delete(invoice, (RequestOptions) null);
1✔
47
  }
48
  /**
49
   * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices
50
   * that are no longer in a draft state will fail; once an invoice has been finalized or if an
51
   * invoice is for a subscription, it must be <a
52
   * href="https://stripe.com/docs/api#void_invoice">voided</a>.
53
   */
54
  public Invoice delete(String invoice, RequestOptions options) throws StripeException {
55
    String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice));
1✔
56
    ApiRequest request =
1✔
57
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, null, options);
58
    return this.request(request, Invoice.class);
1✔
59
  }
60
  /** Retrieves the invoice with the given ID. */
61
  public Invoice retrieve(String invoice, InvoiceRetrieveParams params) throws StripeException {
62
    return retrieve(invoice, params, (RequestOptions) null);
1✔
63
  }
64
  /** Retrieves the invoice with the given ID. */
65
  public Invoice retrieve(String invoice, RequestOptions options) throws StripeException {
66
    return retrieve(invoice, (InvoiceRetrieveParams) null, options);
×
67
  }
68
  /** Retrieves the invoice with the given ID. */
69
  public Invoice retrieve(String invoice) throws StripeException {
70
    return retrieve(invoice, (InvoiceRetrieveParams) null, (RequestOptions) null);
×
71
  }
72
  /** Retrieves the invoice with the given ID. */
73
  public Invoice retrieve(String invoice, InvoiceRetrieveParams params, RequestOptions options)
74
      throws StripeException {
75
    String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice));
1✔
76
    ApiRequest request =
1✔
77
        new ApiRequest(
78
            BaseAddress.API,
79
            ApiResource.RequestMethod.GET,
80
            path,
81
            ApiRequestParams.paramsToMap(params),
1✔
82
            options);
83
    return this.request(request, Invoice.class);
1✔
84
  }
85
  /**
86
   * Draft invoices are fully editable. Once an invoice is <a
87
   * href="https://stripe.com/docs/billing/invoices/workflow#finalized">finalized</a>, monetary
88
   * values, as well as {@code collection_method}, become uneditable.
89
   *
90
   * <p>If you would like to stop the Stripe Billing engine from automatically finalizing,
91
   * reattempting payments on, sending reminders for, or <a
92
   * href="https://stripe.com/docs/billing/invoices/reconciliation">automatically reconciling</a>
93
   * invoices, pass {@code auto_advance=false}.
94
   */
95
  public Invoice update(String invoice, InvoiceUpdateParams params) throws StripeException {
96
    return update(invoice, params, (RequestOptions) null);
1✔
97
  }
98
  /**
99
   * Draft invoices are fully editable. Once an invoice is <a
100
   * href="https://stripe.com/docs/billing/invoices/workflow#finalized">finalized</a>, monetary
101
   * values, as well as {@code collection_method}, become uneditable.
102
   *
103
   * <p>If you would like to stop the Stripe Billing engine from automatically finalizing,
104
   * reattempting payments on, sending reminders for, or <a
105
   * href="https://stripe.com/docs/billing/invoices/reconciliation">automatically reconciling</a>
106
   * invoices, pass {@code auto_advance=false}.
107
   */
108
  public Invoice update(String invoice, RequestOptions options) throws StripeException {
109
    return update(invoice, (InvoiceUpdateParams) null, options);
×
110
  }
111
  /**
112
   * Draft invoices are fully editable. Once an invoice is <a
113
   * href="https://stripe.com/docs/billing/invoices/workflow#finalized">finalized</a>, monetary
114
   * values, as well as {@code collection_method}, become uneditable.
115
   *
116
   * <p>If you would like to stop the Stripe Billing engine from automatically finalizing,
117
   * reattempting payments on, sending reminders for, or <a
118
   * href="https://stripe.com/docs/billing/invoices/reconciliation">automatically reconciling</a>
119
   * invoices, pass {@code auto_advance=false}.
120
   */
121
  public Invoice update(String invoice) throws StripeException {
122
    return update(invoice, (InvoiceUpdateParams) null, (RequestOptions) null);
×
123
  }
124
  /**
125
   * Draft invoices are fully editable. Once an invoice is <a
126
   * href="https://stripe.com/docs/billing/invoices/workflow#finalized">finalized</a>, monetary
127
   * values, as well as {@code collection_method}, become uneditable.
128
   *
129
   * <p>If you would like to stop the Stripe Billing engine from automatically finalizing,
130
   * reattempting payments on, sending reminders for, or <a
131
   * href="https://stripe.com/docs/billing/invoices/reconciliation">automatically reconciling</a>
132
   * invoices, pass {@code auto_advance=false}.
133
   */
134
  public Invoice update(String invoice, InvoiceUpdateParams params, RequestOptions options)
135
      throws StripeException {
136
    String path = String.format("/v1/invoices/%s", ApiResource.urlEncodeId(invoice));
1✔
137
    ApiRequest request =
1✔
138
        new ApiRequest(
139
            BaseAddress.API,
140
            ApiResource.RequestMethod.POST,
141
            path,
142
            ApiRequestParams.paramsToMap(params),
1✔
143
            options);
144
    return this.request(request, Invoice.class);
1✔
145
  }
146
  /**
147
   * You can list all invoices, or list the invoices for a specific customer. The invoices are
148
   * returned sorted by creation date, with the most recently created invoices appearing first.
149
   */
150
  public StripeCollection<Invoice> list(InvoiceListParams params) throws StripeException {
151
    return list(params, (RequestOptions) null);
1✔
152
  }
153
  /**
154
   * You can list all invoices, or list the invoices for a specific customer. The invoices are
155
   * returned sorted by creation date, with the most recently created invoices appearing first.
156
   */
157
  public StripeCollection<Invoice> list(RequestOptions options) throws StripeException {
158
    return list((InvoiceListParams) null, options);
×
159
  }
160
  /**
161
   * You can list all invoices, or list the invoices for a specific customer. The invoices are
162
   * returned sorted by creation date, with the most recently created invoices appearing first.
163
   */
164
  public StripeCollection<Invoice> list() throws StripeException {
165
    return list((InvoiceListParams) null, (RequestOptions) null);
×
166
  }
167
  /**
168
   * You can list all invoices, or list the invoices for a specific customer. The invoices are
169
   * returned sorted by creation date, with the most recently created invoices appearing first.
170
   */
171
  public StripeCollection<Invoice> list(InvoiceListParams params, RequestOptions options)
172
      throws StripeException {
173
    String path = "/v1/invoices";
1✔
174
    ApiRequest request =
1✔
175
        new ApiRequest(
176
            BaseAddress.API,
177
            ApiResource.RequestMethod.GET,
178
            path,
179
            ApiRequestParams.paramsToMap(params),
1✔
180
            options);
181
    return this.request(request, new TypeToken<StripeCollection<Invoice>>() {}.getType());
1✔
182
  }
183
  /**
184
   * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until
185
   * you <a href="https://stripe.com/docs/api#finalize_invoice">finalize</a> the invoice, which
186
   * allows you to <a href="https://stripe.com/docs/api#pay_invoice">pay</a> or <a
187
   * href="https://stripe.com/docs/api#send_invoice">send</a> the invoice to your customers.
188
   */
189
  public Invoice create(InvoiceCreateParams params) throws StripeException {
190
    return create(params, (RequestOptions) null);
1✔
191
  }
192
  /**
193
   * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until
194
   * you <a href="https://stripe.com/docs/api#finalize_invoice">finalize</a> the invoice, which
195
   * allows you to <a href="https://stripe.com/docs/api#pay_invoice">pay</a> or <a
196
   * href="https://stripe.com/docs/api#send_invoice">send</a> the invoice to your customers.
197
   */
198
  public Invoice create(RequestOptions options) throws StripeException {
199
    return create((InvoiceCreateParams) null, options);
×
200
  }
201
  /**
202
   * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until
203
   * you <a href="https://stripe.com/docs/api#finalize_invoice">finalize</a> the invoice, which
204
   * allows you to <a href="https://stripe.com/docs/api#pay_invoice">pay</a> or <a
205
   * href="https://stripe.com/docs/api#send_invoice">send</a> the invoice to your customers.
206
   */
207
  public Invoice create() throws StripeException {
208
    return create((InvoiceCreateParams) null, (RequestOptions) null);
×
209
  }
210
  /**
211
   * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until
212
   * you <a href="https://stripe.com/docs/api#finalize_invoice">finalize</a> the invoice, which
213
   * allows you to <a href="https://stripe.com/docs/api#pay_invoice">pay</a> or <a
214
   * href="https://stripe.com/docs/api#send_invoice">send</a> the invoice to your customers.
215
   */
216
  public Invoice create(InvoiceCreateParams params, RequestOptions options) throws StripeException {
217
    String path = "/v1/invoices";
1✔
218
    ApiRequest request =
1✔
219
        new ApiRequest(
220
            BaseAddress.API,
221
            ApiResource.RequestMethod.POST,
222
            path,
223
            ApiRequestParams.paramsToMap(params),
1✔
224
            options);
225
    return this.request(request, Invoice.class);
1✔
226
  }
227
  /**
228
   * Search for invoices you’ve previously created using Stripe’s <a
229
   * href="https://stripe.com/docs/search#search-query-language">Search Query Language</a>. Don’t
230
   * use search in read-after-write flows where strict consistency is necessary. Under normal
231
   * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
232
   * new or updated data can be up to an hour behind during outages. Search functionality is not
233
   * available to merchants in India.
234
   */
235
  public StripeSearchResult<Invoice> search(InvoiceSearchParams params) throws StripeException {
236
    return search(params, (RequestOptions) null);
1✔
237
  }
238
  /**
239
   * Search for invoices you’ve previously created using Stripe’s <a
240
   * href="https://stripe.com/docs/search#search-query-language">Search Query Language</a>. Don’t
241
   * use search in read-after-write flows where strict consistency is necessary. Under normal
242
   * operating conditions, data is searchable in less than a minute. Occasionally, propagation of
243
   * new or updated data can be up to an hour behind during outages. Search functionality is not
244
   * available to merchants in India.
245
   */
246
  public StripeSearchResult<Invoice> search(InvoiceSearchParams params, RequestOptions options)
247
      throws StripeException {
248
    String path = "/v1/invoices/search";
1✔
249
    ApiRequest request =
1✔
250
        new ApiRequest(
251
            BaseAddress.API,
252
            ApiResource.RequestMethod.GET,
253
            path,
254
            ApiRequestParams.paramsToMap(params),
1✔
255
            options);
256
    return this.request(request, new TypeToken<StripeSearchResult<Invoice>>() {}.getType());
1✔
257
  }
258
  /**
259
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
260
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
261
   * will also show you any discounts that are applicable to the invoice.
262
   *
263
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
264
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
265
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
266
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
267
   * or update the customer’s discount.
268
   *
269
   * <p>You can preview the effects of updating a subscription, including a preview of what
270
   * proration will take place. To ensure that the actual proration is calculated exactly the same
271
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
272
   * parameter when doing the actual subscription update. The recommended way to get only the
273
   * prorations being previewed is to consider only proration line items where {@code period[start]}
274
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
275
   *
276
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
277
   * vary between the time of the preview and the time of the actual invoice creation. <a
278
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
279
   */
280
  public Invoice upcoming(InvoiceUpcomingParams params) throws StripeException {
281
    return upcoming(params, (RequestOptions) null);
1✔
282
  }
283
  /**
284
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
285
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
286
   * will also show you any discounts that are applicable to the invoice.
287
   *
288
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
289
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
290
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
291
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
292
   * or update the customer’s discount.
293
   *
294
   * <p>You can preview the effects of updating a subscription, including a preview of what
295
   * proration will take place. To ensure that the actual proration is calculated exactly the same
296
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
297
   * parameter when doing the actual subscription update. The recommended way to get only the
298
   * prorations being previewed is to consider only proration line items where {@code period[start]}
299
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
300
   *
301
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
302
   * vary between the time of the preview and the time of the actual invoice creation. <a
303
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
304
   */
305
  public Invoice upcoming(RequestOptions options) throws StripeException {
306
    return upcoming((InvoiceUpcomingParams) null, options);
×
307
  }
308
  /**
309
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
310
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
311
   * will also show you any discounts that are applicable to the invoice.
312
   *
313
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
314
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
315
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
316
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
317
   * or update the customer’s discount.
318
   *
319
   * <p>You can preview the effects of updating a subscription, including a preview of what
320
   * proration will take place. To ensure that the actual proration is calculated exactly the same
321
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
322
   * parameter when doing the actual subscription update. The recommended way to get only the
323
   * prorations being previewed is to consider only proration line items where {@code period[start]}
324
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
325
   *
326
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
327
   * vary between the time of the preview and the time of the actual invoice creation. <a
328
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
329
   */
330
  public Invoice upcoming() throws StripeException {
331
    return upcoming((InvoiceUpcomingParams) null, (RequestOptions) null);
×
332
  }
333
  /**
334
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
335
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
336
   * will also show you any discounts that are applicable to the invoice.
337
   *
338
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
339
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
340
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
341
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
342
   * or update the customer’s discount.
343
   *
344
   * <p>You can preview the effects of updating a subscription, including a preview of what
345
   * proration will take place. To ensure that the actual proration is calculated exactly the same
346
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
347
   * parameter when doing the actual subscription update. The recommended way to get only the
348
   * prorations being previewed is to consider only proration line items where {@code period[start]}
349
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
350
   *
351
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
352
   * vary between the time of the preview and the time of the actual invoice creation. <a
353
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
354
   */
355
  public Invoice upcoming(InvoiceUpcomingParams params, RequestOptions options)
356
      throws StripeException {
357
    String path = "/v1/invoices/upcoming";
1✔
358
    ApiRequest request =
1✔
359
        new ApiRequest(
360
            BaseAddress.API,
361
            ApiResource.RequestMethod.GET,
362
            path,
363
            ApiRequestParams.paramsToMap(params),
1✔
364
            options);
365
    return this.request(request, Invoice.class);
1✔
366
  }
367
  /**
368
   * Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
369
   */
370
  public Invoice addLines(String invoice, InvoiceAddLinesParams params) throws StripeException {
371
    return addLines(invoice, params, (RequestOptions) null);
×
372
  }
373
  /**
374
   * Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
375
   */
376
  public Invoice addLines(String invoice, InvoiceAddLinesParams params, RequestOptions options)
377
      throws StripeException {
378
    String path = String.format("/v1/invoices/%s/add_lines", ApiResource.urlEncodeId(invoice));
×
379
    ApiRequest request =
×
380
        new ApiRequest(
381
            BaseAddress.API,
382
            ApiResource.RequestMethod.POST,
383
            path,
384
            ApiRequestParams.paramsToMap(params),
×
385
            options);
UNCOV
386
    return this.request(request, Invoice.class);
×
387
  }
388
  /**
389
   * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
390
   * {@code payments}.
391
   *
392
   * <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
393
   * {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
394
   * {@code paid} if necessary.
395
   *
396
   * <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
397
   * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
398
   * fully paid, the invoice’s status becomes {@code paid}.
399
   *
400
   * <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
401
   * to the invoice immediately.
402
   *
403
   * <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
404
   * payment</a> to learn more.
405
   */
406
  public Invoice attachPayment(String invoice, InvoiceAttachPaymentParams params)
407
      throws StripeException {
408
    return attachPayment(invoice, params, (RequestOptions) null);
×
409
  }
410
  /**
411
   * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
412
   * {@code payments}.
413
   *
414
   * <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
415
   * {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
416
   * {@code paid} if necessary.
417
   *
418
   * <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
419
   * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
420
   * fully paid, the invoice’s status becomes {@code paid}.
421
   *
422
   * <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
423
   * to the invoice immediately.
424
   *
425
   * <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
426
   * payment</a> to learn more.
427
   */
428
  public Invoice attachPayment(String invoice, RequestOptions options) throws StripeException {
429
    return attachPayment(invoice, (InvoiceAttachPaymentParams) null, options);
×
430
  }
431
  /**
432
   * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
433
   * {@code payments}.
434
   *
435
   * <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
436
   * {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
437
   * {@code paid} if necessary.
438
   *
439
   * <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
440
   * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
441
   * fully paid, the invoice’s status becomes {@code paid}.
442
   *
443
   * <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
444
   * to the invoice immediately.
445
   *
446
   * <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
447
   * payment</a> to learn more.
448
   */
449
  public Invoice attachPayment(String invoice) throws StripeException {
450
    return attachPayment(invoice, (InvoiceAttachPaymentParams) null, (RequestOptions) null);
×
451
  }
452
  /**
453
   * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of
454
   * {@code payments}.
455
   *
456
   * <p>For Out of Band Payment, the payment is credited to the invoice immediately, increasing the
457
   * {@code amount_paid} of the invoice and subsequently transitioning the status of the invoice to
458
   * {@code paid} if necessary.
459
   *
460
   * <p>For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the
461
   * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is
462
   * fully paid, the invoice’s status becomes {@code paid}.
463
   *
464
   * <p>If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited
465
   * to the invoice immediately.
466
   *
467
   * <p>See: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
468
   * payment</a> to learn more.
469
   */
470
  public Invoice attachPayment(
471
      String invoice, InvoiceAttachPaymentParams params, RequestOptions options)
472
      throws StripeException {
473
    String path = String.format("/v1/invoices/%s/attach_payment", ApiResource.urlEncodeId(invoice));
×
474
    ApiRequest request =
×
475
        new ApiRequest(
476
            BaseAddress.API,
477
            ApiResource.RequestMethod.POST,
478
            path,
479
            ApiRequestParams.paramsToMap(params),
×
480
            options);
UNCOV
481
    return this.request(request, Invoice.class);
×
482
  }
483
  /**
484
   * Attaches a PaymentIntent to the invoice, adding it to the list of {@code payments}. When the
485
   * PaymentIntent’s status changes to {@code succeeded}, the payment is credited to the invoice,
486
   * increasing its {@code amount_paid}. When the invoice is fully paid, the invoice’s status
487
   * becomes {@code paid}.
488
   *
489
   * <p>If the PaymentIntent’s status is already {@code succeeded} when it is attached, it is
490
   * credited to the invoice immediately.
491
   *
492
   * <p>Related guide: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
493
   * payment</a>
494
   */
495
  public Invoice attachPaymentIntent(String invoice, InvoiceAttachPaymentIntentParams params)
496
      throws StripeException {
497
    return attachPaymentIntent(invoice, params, (RequestOptions) null);
×
498
  }
499
  /**
500
   * Attaches a PaymentIntent to the invoice, adding it to the list of {@code payments}. When the
501
   * PaymentIntent’s status changes to {@code succeeded}, the payment is credited to the invoice,
502
   * increasing its {@code amount_paid}. When the invoice is fully paid, the invoice’s status
503
   * becomes {@code paid}.
504
   *
505
   * <p>If the PaymentIntent’s status is already {@code succeeded} when it is attached, it is
506
   * credited to the invoice immediately.
507
   *
508
   * <p>Related guide: <a href="https://stripe.com/docs/invoicing/payments/create">Create an invoice
509
   * payment</a>
510
   */
511
  public Invoice attachPaymentIntent(
512
      String invoice, InvoiceAttachPaymentIntentParams params, RequestOptions options)
513
      throws StripeException {
514
    String path =
×
515
        String.format("/v1/invoices/%s/attach_payment_intent", ApiResource.urlEncodeId(invoice));
×
516
    ApiRequest request =
×
517
        new ApiRequest(
518
            BaseAddress.API,
519
            ApiResource.RequestMethod.POST,
520
            path,
521
            ApiRequestParams.paramsToMap(params),
×
522
            options);
UNCOV
523
    return this.request(request, Invoice.class);
×
524
  }
525
  /**
526
   * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
527
   * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
528
   */
529
  public Invoice finalizeInvoice(String invoice, InvoiceFinalizeInvoiceParams params)
530
      throws StripeException {
531
    return finalizeInvoice(invoice, params, (RequestOptions) null);
1✔
532
  }
533
  /**
534
   * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
535
   * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
536
   */
537
  public Invoice finalizeInvoice(String invoice, RequestOptions options) throws StripeException {
538
    return finalizeInvoice(invoice, (InvoiceFinalizeInvoiceParams) null, options);
×
539
  }
540
  /**
541
   * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
542
   * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
543
   */
544
  public Invoice finalizeInvoice(String invoice) throws StripeException {
545
    return finalizeInvoice(invoice, (InvoiceFinalizeInvoiceParams) null, (RequestOptions) null);
×
546
  }
547
  /**
548
   * Stripe automatically finalizes drafts before sending and attempting payment on invoices.
549
   * However, if you’d like to finalize a draft invoice manually, you can do so using this method.
550
   */
551
  public Invoice finalizeInvoice(
552
      String invoice, InvoiceFinalizeInvoiceParams params, RequestOptions options)
553
      throws StripeException {
554
    String path = String.format("/v1/invoices/%s/finalize", ApiResource.urlEncodeId(invoice));
1✔
555
    ApiRequest request =
1✔
556
        new ApiRequest(
557
            BaseAddress.API,
558
            ApiResource.RequestMethod.POST,
559
            path,
560
            ApiRequestParams.paramsToMap(params),
1✔
561
            options);
562
    return this.request(request, Invoice.class);
1✔
563
  }
564
  /**
565
   * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
566
   * written off for accounting purposes.
567
   */
568
  public Invoice markUncollectible(String invoice, InvoiceMarkUncollectibleParams params)
569
      throws StripeException {
570
    return markUncollectible(invoice, params, (RequestOptions) null);
1✔
571
  }
572
  /**
573
   * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
574
   * written off for accounting purposes.
575
   */
576
  public Invoice markUncollectible(String invoice, RequestOptions options) throws StripeException {
577
    return markUncollectible(invoice, (InvoiceMarkUncollectibleParams) null, options);
×
578
  }
579
  /**
580
   * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
581
   * written off for accounting purposes.
582
   */
583
  public Invoice markUncollectible(String invoice) throws StripeException {
584
    return markUncollectible(invoice, (InvoiceMarkUncollectibleParams) null, (RequestOptions) null);
×
585
  }
586
  /**
587
   * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
588
   * written off for accounting purposes.
589
   */
590
  public Invoice markUncollectible(
591
      String invoice, InvoiceMarkUncollectibleParams params, RequestOptions options)
592
      throws StripeException {
593
    String path =
1✔
594
        String.format("/v1/invoices/%s/mark_uncollectible", ApiResource.urlEncodeId(invoice));
1✔
595
    ApiRequest request =
1✔
596
        new ApiRequest(
597
            BaseAddress.API,
598
            ApiResource.RequestMethod.POST,
599
            path,
600
            ApiRequestParams.paramsToMap(params),
1✔
601
            options);
602
    return this.request(request, Invoice.class);
1✔
603
  }
604
  /**
605
   * Stripe automatically creates and then attempts to collect payment on invoices for customers on
606
   * subscriptions according to your <a
607
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
608
   * However, if you’d like to attempt payment on an invoice out of the normal collection schedule
609
   * or for some other reason, you can do so.
610
   */
611
  public Invoice pay(String invoice, InvoicePayParams params) throws StripeException {
612
    return pay(invoice, params, (RequestOptions) null);
1✔
613
  }
614
  /**
615
   * Stripe automatically creates and then attempts to collect payment on invoices for customers on
616
   * subscriptions according to your <a
617
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
618
   * However, if you’d like to attempt payment on an invoice out of the normal collection schedule
619
   * or for some other reason, you can do so.
620
   */
621
  public Invoice pay(String invoice, RequestOptions options) throws StripeException {
622
    return pay(invoice, (InvoicePayParams) null, options);
×
623
  }
624
  /**
625
   * Stripe automatically creates and then attempts to collect payment on invoices for customers on
626
   * subscriptions according to your <a
627
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
628
   * However, if you’d like to attempt payment on an invoice out of the normal collection schedule
629
   * or for some other reason, you can do so.
630
   */
631
  public Invoice pay(String invoice) throws StripeException {
632
    return pay(invoice, (InvoicePayParams) null, (RequestOptions) null);
×
633
  }
634
  /**
635
   * Stripe automatically creates and then attempts to collect payment on invoices for customers on
636
   * subscriptions according to your <a
637
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
638
   * However, if you’d like to attempt payment on an invoice out of the normal collection schedule
639
   * or for some other reason, you can do so.
640
   */
641
  public Invoice pay(String invoice, InvoicePayParams params, RequestOptions options)
642
      throws StripeException {
643
    String path = String.format("/v1/invoices/%s/pay", ApiResource.urlEncodeId(invoice));
1✔
644
    ApiRequest request =
1✔
645
        new ApiRequest(
646
            BaseAddress.API,
647
            ApiResource.RequestMethod.POST,
648
            path,
649
            ApiRequestParams.paramsToMap(params),
1✔
650
            options);
651
    return this.request(request, Invoice.class);
1✔
652
  }
653
  /**
654
   * Removes multiple line items from an invoice. This is only possible when an invoice is still a
655
   * draft.
656
   */
657
  public Invoice removeLines(String invoice, InvoiceRemoveLinesParams params)
658
      throws StripeException {
659
    return removeLines(invoice, params, (RequestOptions) null);
×
660
  }
661
  /**
662
   * Removes multiple line items from an invoice. This is only possible when an invoice is still a
663
   * draft.
664
   */
665
  public Invoice removeLines(
666
      String invoice, InvoiceRemoveLinesParams params, RequestOptions options)
667
      throws StripeException {
668
    String path = String.format("/v1/invoices/%s/remove_lines", ApiResource.urlEncodeId(invoice));
×
669
    ApiRequest request =
×
670
        new ApiRequest(
671
            BaseAddress.API,
672
            ApiResource.RequestMethod.POST,
673
            path,
674
            ApiRequestParams.paramsToMap(params),
×
675
            options);
UNCOV
676
    return this.request(request, Invoice.class);
×
677
  }
678
  /**
679
   * Stripe will automatically send invoices to customers according to your <a
680
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
681
   * However, if you’d like to manually send an invoice to your customer out of the normal schedule,
682
   * you can do so. When sending invoices that have already been paid, there will be no reference to
683
   * the payment in the email.
684
   *
685
   * <p>Requests made in test-mode result in no emails being sent, despite sending an {@code
686
   * invoice.sent} event.
687
   */
688
  public Invoice sendInvoice(String invoice, InvoiceSendInvoiceParams params)
689
      throws StripeException {
690
    return sendInvoice(invoice, params, (RequestOptions) null);
1✔
691
  }
692
  /**
693
   * Stripe will automatically send invoices to customers according to your <a
694
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
695
   * However, if you’d like to manually send an invoice to your customer out of the normal schedule,
696
   * you can do so. When sending invoices that have already been paid, there will be no reference to
697
   * the payment in the email.
698
   *
699
   * <p>Requests made in test-mode result in no emails being sent, despite sending an {@code
700
   * invoice.sent} event.
701
   */
702
  public Invoice sendInvoice(String invoice, RequestOptions options) throws StripeException {
703
    return sendInvoice(invoice, (InvoiceSendInvoiceParams) null, options);
×
704
  }
705
  /**
706
   * Stripe will automatically send invoices to customers according to your <a
707
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
708
   * However, if you’d like to manually send an invoice to your customer out of the normal schedule,
709
   * you can do so. When sending invoices that have already been paid, there will be no reference to
710
   * the payment in the email.
711
   *
712
   * <p>Requests made in test-mode result in no emails being sent, despite sending an {@code
713
   * invoice.sent} event.
714
   */
715
  public Invoice sendInvoice(String invoice) throws StripeException {
716
    return sendInvoice(invoice, (InvoiceSendInvoiceParams) null, (RequestOptions) null);
×
717
  }
718
  /**
719
   * Stripe will automatically send invoices to customers according to your <a
720
   * href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
721
   * However, if you’d like to manually send an invoice to your customer out of the normal schedule,
722
   * you can do so. When sending invoices that have already been paid, there will be no reference to
723
   * the payment in the email.
724
   *
725
   * <p>Requests made in test-mode result in no emails being sent, despite sending an {@code
726
   * invoice.sent} event.
727
   */
728
  public Invoice sendInvoice(
729
      String invoice, InvoiceSendInvoiceParams params, RequestOptions options)
730
      throws StripeException {
731
    String path = String.format("/v1/invoices/%s/send", ApiResource.urlEncodeId(invoice));
1✔
732
    ApiRequest request =
1✔
733
        new ApiRequest(
734
            BaseAddress.API,
735
            ApiResource.RequestMethod.POST,
736
            path,
737
            ApiRequestParams.paramsToMap(params),
1✔
738
            options);
739
    return this.request(request, Invoice.class);
1✔
740
  }
741
  /**
742
   * Updates multiple line items on an invoice. This is only possible when an invoice is still a
743
   * draft.
744
   */
745
  public Invoice updateLines(String invoice, InvoiceUpdateLinesParams params)
746
      throws StripeException {
747
    return updateLines(invoice, params, (RequestOptions) null);
×
748
  }
749
  /**
750
   * Updates multiple line items on an invoice. This is only possible when an invoice is still a
751
   * draft.
752
   */
753
  public Invoice updateLines(
754
      String invoice, InvoiceUpdateLinesParams params, RequestOptions options)
755
      throws StripeException {
756
    String path = String.format("/v1/invoices/%s/update_lines", ApiResource.urlEncodeId(invoice));
×
757
    ApiRequest request =
×
758
        new ApiRequest(
759
            BaseAddress.API,
760
            ApiResource.RequestMethod.POST,
761
            path,
762
            ApiRequestParams.paramsToMap(params),
×
763
            options);
UNCOV
764
    return this.request(request, Invoice.class);
×
765
  }
766
  /**
767
   * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a
768
   * href="https://stripe.com/docs/api#delete_invoice">deletion</a>, however it only applies to
769
   * finalized invoices and maintains a papertrail where the invoice can still be found.
770
   *
771
   * <p>Consult with local regulations to determine whether and how an invoice might be amended,
772
   * canceled, or voided in the jurisdiction you’re doing business in. You might need to <a
773
   * href="https://stripe.com/docs/api#create_invoice">issue another invoice</a> or <a
774
   * href="https://stripe.com/docs/api#create_credit_note">credit note</a> instead. Stripe
775
   * recommends that you consult with your legal counsel for advice specific to your business.
776
   */
777
  public Invoice voidInvoice(String invoice, InvoiceVoidInvoiceParams params)
778
      throws StripeException {
779
    return voidInvoice(invoice, params, (RequestOptions) null);
1✔
780
  }
781
  /**
782
   * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a
783
   * href="https://stripe.com/docs/api#delete_invoice">deletion</a>, however it only applies to
784
   * finalized invoices and maintains a papertrail where the invoice can still be found.
785
   *
786
   * <p>Consult with local regulations to determine whether and how an invoice might be amended,
787
   * canceled, or voided in the jurisdiction you’re doing business in. You might need to <a
788
   * href="https://stripe.com/docs/api#create_invoice">issue another invoice</a> or <a
789
   * href="https://stripe.com/docs/api#create_credit_note">credit note</a> instead. Stripe
790
   * recommends that you consult with your legal counsel for advice specific to your business.
791
   */
792
  public Invoice voidInvoice(String invoice, RequestOptions options) throws StripeException {
793
    return voidInvoice(invoice, (InvoiceVoidInvoiceParams) null, options);
×
794
  }
795
  /**
796
   * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a
797
   * href="https://stripe.com/docs/api#delete_invoice">deletion</a>, however it only applies to
798
   * finalized invoices and maintains a papertrail where the invoice can still be found.
799
   *
800
   * <p>Consult with local regulations to determine whether and how an invoice might be amended,
801
   * canceled, or voided in the jurisdiction you’re doing business in. You might need to <a
802
   * href="https://stripe.com/docs/api#create_invoice">issue another invoice</a> or <a
803
   * href="https://stripe.com/docs/api#create_credit_note">credit note</a> instead. Stripe
804
   * recommends that you consult with your legal counsel for advice specific to your business.
805
   */
806
  public Invoice voidInvoice(String invoice) throws StripeException {
807
    return voidInvoice(invoice, (InvoiceVoidInvoiceParams) null, (RequestOptions) null);
×
808
  }
809
  /**
810
   * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a
811
   * href="https://stripe.com/docs/api#delete_invoice">deletion</a>, however it only applies to
812
   * finalized invoices and maintains a papertrail where the invoice can still be found.
813
   *
814
   * <p>Consult with local regulations to determine whether and how an invoice might be amended,
815
   * canceled, or voided in the jurisdiction you’re doing business in. You might need to <a
816
   * href="https://stripe.com/docs/api#create_invoice">issue another invoice</a> or <a
817
   * href="https://stripe.com/docs/api#create_credit_note">credit note</a> instead. Stripe
818
   * recommends that you consult with your legal counsel for advice specific to your business.
819
   */
820
  public Invoice voidInvoice(
821
      String invoice, InvoiceVoidInvoiceParams params, RequestOptions options)
822
      throws StripeException {
823
    String path = String.format("/v1/invoices/%s/void", ApiResource.urlEncodeId(invoice));
1✔
824
    ApiRequest request =
1✔
825
        new ApiRequest(
826
            BaseAddress.API,
827
            ApiResource.RequestMethod.POST,
828
            path,
829
            ApiRequestParams.paramsToMap(params),
1✔
830
            options);
831
    return this.request(request, Invoice.class);
1✔
832
  }
833
  /**
834
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
835
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
836
   * will also show you any discounts that are applicable to the invoice.
837
   *
838
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
839
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
840
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
841
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
842
   * or update the customer’s discount.
843
   *
844
   * <p>You can preview the effects of updating a subscription, including a preview of what
845
   * proration will take place. To ensure that the actual proration is calculated exactly the same
846
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
847
   * parameter when doing the actual subscription update. The recommended way to get only the
848
   * prorations being previewed is to consider only proration line items where {@code period[start]}
849
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
850
   *
851
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
852
   * vary between the time of the preview and the time of the actual invoice creation. <a
853
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
854
   */
855
  public Invoice createPreview(InvoiceCreatePreviewParams params) throws StripeException {
856
    return createPreview(params, (RequestOptions) null);
×
857
  }
858
  /**
859
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
860
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
861
   * will also show you any discounts that are applicable to the invoice.
862
   *
863
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
864
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
865
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
866
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
867
   * or update the customer’s discount.
868
   *
869
   * <p>You can preview the effects of updating a subscription, including a preview of what
870
   * proration will take place. To ensure that the actual proration is calculated exactly the same
871
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
872
   * parameter when doing the actual subscription update. The recommended way to get only the
873
   * prorations being previewed is to consider only proration line items where {@code period[start]}
874
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
875
   *
876
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
877
   * vary between the time of the preview and the time of the actual invoice creation. <a
878
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
879
   */
880
  public Invoice createPreview(RequestOptions options) throws StripeException {
881
    return createPreview((InvoiceCreatePreviewParams) null, options);
×
882
  }
883
  /**
884
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
885
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
886
   * will also show you any discounts that are applicable to the invoice.
887
   *
888
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
889
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
890
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
891
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
892
   * or update the customer’s discount.
893
   *
894
   * <p>You can preview the effects of updating a subscription, including a preview of what
895
   * proration will take place. To ensure that the actual proration is calculated exactly the same
896
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
897
   * parameter when doing the actual subscription update. The recommended way to get only the
898
   * prorations being previewed is to consider only proration line items where {@code period[start]}
899
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
900
   *
901
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
902
   * vary between the time of the preview and the time of the actual invoice creation. <a
903
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
904
   */
905
  public Invoice createPreview() throws StripeException {
906
    return createPreview((InvoiceCreatePreviewParams) null, (RequestOptions) null);
×
907
  }
908
  /**
909
   * At any time, you can preview the upcoming invoice for a customer. This will show you all the
910
   * charges that are pending, including subscription renewal charges, invoice item charges, etc. It
911
   * will also show you any discounts that are applicable to the invoice.
912
   *
913
   * <p>Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the
914
   * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice
915
   * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the
916
   * amount that your customer will be billed, you can add, remove, or update pending invoice items,
917
   * or update the customer’s discount.
918
   *
919
   * <p>You can preview the effects of updating a subscription, including a preview of what
920
   * proration will take place. To ensure that the actual proration is calculated exactly the same
921
   * as the previewed proration, you should pass the {@code subscription_details.proration_date}
922
   * parameter when doing the actual subscription update. The recommended way to get only the
923
   * prorations being previewed is to consider only proration line items where {@code period[start]}
924
   * is equal to the {@code subscription_details.proration_date} value passed in the request.
925
   *
926
   * <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
927
   * vary between the time of the preview and the time of the actual invoice creation. <a
928
   * href="https://docs.stripe.com/currencies/conversions">Learn more</a>
929
   */
930
  public Invoice createPreview(InvoiceCreatePreviewParams params, RequestOptions options)
931
      throws StripeException {
932
    String path = "/v1/invoices/create_preview";
×
933
    ApiRequest request =
×
934
        new ApiRequest(
935
            BaseAddress.API,
936
            ApiResource.RequestMethod.POST,
937
            path,
938
            ApiRequestParams.paramsToMap(params),
×
939
            options);
UNCOV
940
    return this.request(request, Invoice.class);
×
941
  }
942

943
  public com.stripe.service.InvoiceLineItemService lineItems() {
944
    return new com.stripe.service.InvoiceLineItemService(this.getResponseGetter());
×
945
  }
946

947
  public com.stripe.service.InvoicePaymentService payments() {
948
    return new com.stripe.service.InvoicePaymentService(this.getResponseGetter());
×
949
  }
950

951
  public com.stripe.service.InvoiceUpcomingLinesService upcomingLines() {
952
    return new com.stripe.service.InvoiceUpcomingLinesService(this.getResponseGetter());
×
953
  }
954
}
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