stripe 16.1.0 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 16.2.0 - 2024-07-05
4
+ * [#2125](https://github.com/stripe/stripe-node/pull/2125) Update generated code
5
+ * Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice`
6
+ * Add support for new value `payment_intent_fx_quote_invalid` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
7
+ * Add support for `posted_at` on `Tax.TransactionCreateFromCalculationParams` and `Tax.Transaction`
8
+
3
9
  ## 16.1.0 - 2024-06-27
4
10
  * [#2120](https://github.com/stripe/stripe-node/pull/2120) Update generated code
5
11
  * Add support for `filters` on `Checkout.Session.payment_method_options.us_bank_account.financial_connections`, `Invoice.payment_settings.payment_method_options.us_bank_account.financial_connections`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections`, `PaymentIntent.payment_method_options.us_bank_account.financial_connections`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account.financial_connections`, `PaymentIntentCreateParams.payment_method_options.us_bank_account.financial_connections`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account.financial_connections`, `SetupIntent.payment_method_options.us_bank_account.financial_connections`, `SetupIntentConfirmParams.payment_method_options.us_bank_account.financial_connections`, `SetupIntentCreateParams.payment_method_options.us_bank_account.financial_connections`, `SetupIntentUpdateParams.payment_method_options.us_bank_account.financial_connections`, `Subscription.payment_settings.payment_method_options.us_bank_account.financial_connections`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 16.1.0
1
+ 16.2.0
@@ -14,6 +14,10 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
14
14
  methodType: 'list',
15
15
  }),
16
16
  del: stripeMethod({ method: 'DELETE', fullPath: '/v1/invoices/{invoice}' }),
17
+ addLines: stripeMethod({
18
+ method: 'POST',
19
+ fullPath: '/v1/invoices/{invoice}/add_lines',
20
+ }),
17
21
  createPreview: stripeMethod({
18
22
  method: 'POST',
19
23
  fullPath: '/v1/invoices/create_preview',
@@ -37,6 +41,10 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
37
41
  fullPath: '/v1/invoices/{invoice}/mark_uncollectible',
38
42
  }),
39
43
  pay: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}/pay' }),
44
+ removeLines: stripeMethod({
45
+ method: 'POST',
46
+ fullPath: '/v1/invoices/{invoice}/remove_lines',
47
+ }),
40
48
  retrieveUpcoming: stripeMethod({
41
49
  method: 'GET',
42
50
  fullPath: '/v1/invoices/upcoming',
@@ -50,6 +58,10 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
50
58
  method: 'POST',
51
59
  fullPath: '/v1/invoices/{invoice}/send',
52
60
  }),
61
+ updateLines: stripeMethod({
62
+ method: 'POST',
63
+ fullPath: '/v1/invoices/{invoice}/update_lines',
64
+ }),
53
65
  updateLineItem: stripeMethod({
54
66
  method: 'POST',
55
67
  fullPath: '/v1/invoices/{invoice}/lines/{line_item_id}',
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
34
34
  ];
35
35
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
36
36
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
37
- Stripe.PACKAGE_VERSION = '16.1.0';
37
+ Stripe.PACKAGE_VERSION = '16.2.0';
38
38
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
39
39
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
40
40
  Stripe.resources = resources;
@@ -11,6 +11,10 @@ export const Invoices = StripeResource.extend({
11
11
  methodType: 'list',
12
12
  }),
13
13
  del: stripeMethod({ method: 'DELETE', fullPath: '/v1/invoices/{invoice}' }),
14
+ addLines: stripeMethod({
15
+ method: 'POST',
16
+ fullPath: '/v1/invoices/{invoice}/add_lines',
17
+ }),
14
18
  createPreview: stripeMethod({
15
19
  method: 'POST',
16
20
  fullPath: '/v1/invoices/create_preview',
@@ -34,6 +38,10 @@ export const Invoices = StripeResource.extend({
34
38
  fullPath: '/v1/invoices/{invoice}/mark_uncollectible',
35
39
  }),
36
40
  pay: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}/pay' }),
41
+ removeLines: stripeMethod({
42
+ method: 'POST',
43
+ fullPath: '/v1/invoices/{invoice}/remove_lines',
44
+ }),
37
45
  retrieveUpcoming: stripeMethod({
38
46
  method: 'GET',
39
47
  fullPath: '/v1/invoices/upcoming',
@@ -47,6 +55,10 @@ export const Invoices = StripeResource.extend({
47
55
  method: 'POST',
48
56
  fullPath: '/v1/invoices/{invoice}/send',
49
57
  }),
58
+ updateLines: stripeMethod({
59
+ method: 'POST',
60
+ fullPath: '/v1/invoices/{invoice}/update_lines',
61
+ }),
50
62
  updateLineItem: stripeMethod({
51
63
  method: 'POST',
52
64
  fullPath: '/v1/invoices/{invoice}/lines/{line_item_id}',
@@ -31,7 +31,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
31
31
  ];
32
32
  const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
33
33
  export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
34
- Stripe.PACKAGE_VERSION = '16.1.0';
34
+ Stripe.PACKAGE_VERSION = '16.2.0';
35
35
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
36
36
  Stripe.StripeResource = StripeResource;
37
37
  Stripe.resources = resources;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "16.1.0",
3
+ "version": "16.2.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -24,7 +24,7 @@ declare module 'stripe' {
24
24
  aggregated_value: number;
25
25
 
26
26
  /**
27
- * End timestamp for this event summary (inclusive).
27
+ * End timestamp for this event summary (exclusive). Must be aligned with minute boundaries.
28
28
  */
29
29
  end_time: number;
30
30
 
@@ -39,7 +39,7 @@ declare module 'stripe' {
39
39
  meter: string;
40
40
 
41
41
  /**
42
- * Start timestamp for this event summary (inclusive).
42
+ * Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries.
43
43
  */
44
44
  start_time: number;
45
45
  }
@@ -123,12 +123,12 @@ declare module 'stripe' {
123
123
  customer: string;
124
124
 
125
125
  /**
126
- * The timestamp from when to stop aggregating meter events (exclusive).
126
+ * The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries.
127
127
  */
128
128
  end_time: number;
129
129
 
130
130
  /**
131
- * The timestamp from when to start aggregating meter events (inclusive).
131
+ * The timestamp from when to start aggregating meter events (inclusive). Must be aligned with minute boundaries.
132
132
  */
133
133
  start_time: number;
134
134
 
@@ -3,8 +3,8 @@
3
3
  declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  /**
6
- * A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
7
- * control over a customer.
6
+ * A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
7
+ * control over a Customer.
8
8
  */
9
9
  interface CustomerSession {
10
10
  /**
@@ -13,14 +13,14 @@ declare module 'stripe' {
13
13
  object: 'customer_session';
14
14
 
15
15
  /**
16
- * The client secret of this customer session. Used on the client to set up secure access to the given `customer`.
16
+ * The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`.
17
17
  *
18
18
  * The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.
19
19
  */
20
20
  client_secret: string;
21
21
 
22
22
  /**
23
- * Configuration for the components supported by this customer session.
23
+ * Configuration for the components supported by this Customer Session.
24
24
  */
25
25
  components?: CustomerSession.Components;
26
26
 
@@ -30,12 +30,12 @@ declare module 'stripe' {
30
30
  created: number;
31
31
 
32
32
  /**
33
- * The customer the customer session was created for.
33
+ * The Customer the Customer Session was created for.
34
34
  */
35
35
  customer: string | Stripe.Customer;
36
36
 
37
37
  /**
38
- * The timestamp at which this customer session will expire.
38
+ * The timestamp at which this Customer Session will expire.
39
39
  */
40
40
  expires_at: number;
41
41
 
@@ -9,7 +9,7 @@ declare module 'stripe' {
9
9
  components: CustomerSessionCreateParams.Components;
10
10
 
11
11
  /**
12
- * The ID of an existing customer for which to create the customer session.
12
+ * The ID of an existing customer for which to create the Customer Session.
13
13
  */
14
14
  customer: string;
15
15
 
@@ -51,7 +51,7 @@ declare module 'stripe' {
51
51
 
52
52
  class CustomerSessionsResource {
53
53
  /**
54
- * Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
54
+ * Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
55
55
  */
56
56
  create(
57
57
  params: CustomerSessionCreateParams,
@@ -109,7 +109,7 @@ declare module 'stripe' {
109
109
  name?: string | null;
110
110
 
111
111
  /**
112
- * The suffix of the customer's next invoice number (for example, 0001).
112
+ * The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
113
113
  */
114
114
  next_invoice_sequence?: number;
115
115
 
@@ -1070,7 +1070,7 @@ declare module 'stripe' {
1070
1070
  }
1071
1071
 
1072
1072
  /**
1073
- * Occurs whenever a card or source will expire at the end of the month.
1073
+ * Occurs whenever a card or source will expire at the end of the month. This event only works with legacy integrations using Card or Source objects. If you use the PaymentMethod API, this event won't occur.
1074
1074
  */
1075
1075
  interface CustomerSourceExpiringEvent extends EventBase {
1076
1076
  type: 'customer.source.expiring';
@@ -879,6 +879,7 @@ declare module 'stripe' {
879
879
  | 'parameters_exclusive'
880
880
  | 'payment_intent_action_required'
881
881
  | 'payment_intent_authentication_failure'
882
+ | 'payment_intent_fx_quote_invalid'
882
883
  | 'payment_intent_incompatible_payment_method'
883
884
  | 'payment_intent_invalid_parameter'
884
885
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -1458,6 +1458,262 @@ declare module 'stripe' {
1458
1458
 
1459
1459
  interface InvoiceDeleteParams {}
1460
1460
 
1461
+ interface InvoiceAddLinesParams {
1462
+ /**
1463
+ * The line items to add.
1464
+ */
1465
+ lines: Array<InvoiceAddLinesParams.Line>;
1466
+
1467
+ /**
1468
+ * Specifies which fields in the response should be expanded.
1469
+ */
1470
+ expand?: Array<string>;
1471
+
1472
+ /**
1473
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1474
+ */
1475
+ invoice_metadata?: Stripe.Emptyable<{
1476
+ [key: string]: string;
1477
+ }>;
1478
+ }
1479
+
1480
+ namespace InvoiceAddLinesParams {
1481
+ interface Line {
1482
+ /**
1483
+ * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
1484
+ */
1485
+ amount?: number;
1486
+
1487
+ /**
1488
+ * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
1489
+ */
1490
+ description?: string;
1491
+
1492
+ /**
1493
+ * Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
1494
+ */
1495
+ discountable?: boolean;
1496
+
1497
+ /**
1498
+ * The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
1499
+ */
1500
+ discounts?: Stripe.Emptyable<Array<Line.Discount>>;
1501
+
1502
+ /**
1503
+ * ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1504
+ */
1505
+ invoice_item?: string;
1506
+
1507
+ /**
1508
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1509
+ */
1510
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
1511
+
1512
+ /**
1513
+ * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
1514
+ */
1515
+ period?: Line.Period;
1516
+
1517
+ /**
1518
+ * The ID of the price object. One of `price` or `price_data` is required.
1519
+ */
1520
+ price?: string;
1521
+
1522
+ /**
1523
+ * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1524
+ */
1525
+ price_data?: Line.PriceData;
1526
+
1527
+ /**
1528
+ * Non-negative integer. The quantity of units for the line item.
1529
+ */
1530
+ quantity?: number;
1531
+
1532
+ /**
1533
+ * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
1534
+ */
1535
+ tax_amounts?: Stripe.Emptyable<Array<Line.TaxAmount>>;
1536
+
1537
+ /**
1538
+ * The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
1539
+ */
1540
+ tax_rates?: Stripe.Emptyable<Array<string>>;
1541
+ }
1542
+
1543
+ namespace Line {
1544
+ interface Discount {
1545
+ /**
1546
+ * ID of the coupon to create a new discount for.
1547
+ */
1548
+ coupon?: string;
1549
+
1550
+ /**
1551
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
1552
+ */
1553
+ discount?: string;
1554
+
1555
+ /**
1556
+ * ID of the promotion code to create a new discount for.
1557
+ */
1558
+ promotion_code?: string;
1559
+ }
1560
+
1561
+ interface Period {
1562
+ /**
1563
+ * The end of the period, which must be greater than or equal to the start. This value is inclusive.
1564
+ */
1565
+ end: number;
1566
+
1567
+ /**
1568
+ * The start of the period. This value is inclusive.
1569
+ */
1570
+ start: number;
1571
+ }
1572
+
1573
+ interface PriceData {
1574
+ /**
1575
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
1576
+ */
1577
+ currency: string;
1578
+
1579
+ /**
1580
+ * The ID of the product that this price will belong to. One of `product` or `product_data` is required.
1581
+ */
1582
+ product?: string;
1583
+
1584
+ /**
1585
+ * Data used to generate a new product object inline. One of `product` or `product_data` is required.
1586
+ */
1587
+ product_data?: PriceData.ProductData;
1588
+
1589
+ /**
1590
+ * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
1591
+ */
1592
+ tax_behavior?: PriceData.TaxBehavior;
1593
+
1594
+ /**
1595
+ * A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
1596
+ */
1597
+ unit_amount?: number;
1598
+
1599
+ /**
1600
+ * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
1601
+ */
1602
+ unit_amount_decimal?: string;
1603
+ }
1604
+
1605
+ namespace PriceData {
1606
+ interface ProductData {
1607
+ /**
1608
+ * The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
1609
+ */
1610
+ description?: string;
1611
+
1612
+ /**
1613
+ * A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
1614
+ */
1615
+ images?: Array<string>;
1616
+
1617
+ /**
1618
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1619
+ */
1620
+ metadata?: Stripe.MetadataParam;
1621
+
1622
+ /**
1623
+ * The product's name, meant to be displayable to the customer.
1624
+ */
1625
+ name: string;
1626
+
1627
+ /**
1628
+ * A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
1629
+ */
1630
+ tax_code?: string;
1631
+ }
1632
+
1633
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
1634
+ }
1635
+
1636
+ interface TaxAmount {
1637
+ /**
1638
+ * The amount, in cents (or local equivalent), of the tax.
1639
+ */
1640
+ amount: number;
1641
+
1642
+ /**
1643
+ * Data to find or create a TaxRate object.
1644
+ *
1645
+ * Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items.
1646
+ */
1647
+ tax_rate_data: TaxAmount.TaxRateData;
1648
+
1649
+ /**
1650
+ * The amount on which tax is calculated, in cents (or local equivalent).
1651
+ */
1652
+ taxable_amount: number;
1653
+ }
1654
+
1655
+ namespace TaxAmount {
1656
+ interface TaxRateData {
1657
+ /**
1658
+ * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1659
+ */
1660
+ country?: string;
1661
+
1662
+ /**
1663
+ * An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
1664
+ */
1665
+ description?: string;
1666
+
1667
+ /**
1668
+ * The display name of the tax rate, which will be shown to users.
1669
+ */
1670
+ display_name: string;
1671
+
1672
+ /**
1673
+ * This specifies if the tax rate is inclusive or exclusive.
1674
+ */
1675
+ inclusive: boolean;
1676
+
1677
+ /**
1678
+ * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice.
1679
+ */
1680
+ jurisdiction?: string;
1681
+
1682
+ /**
1683
+ * The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
1684
+ */
1685
+ percentage: number;
1686
+
1687
+ /**
1688
+ * [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
1689
+ */
1690
+ state?: string;
1691
+
1692
+ /**
1693
+ * The high-level tax type, such as `vat` or `sales_tax`.
1694
+ */
1695
+ tax_type?: TaxRateData.TaxType;
1696
+ }
1697
+
1698
+ namespace TaxRateData {
1699
+ type TaxType =
1700
+ | 'amusement_tax'
1701
+ | 'communications_tax'
1702
+ | 'gst'
1703
+ | 'hst'
1704
+ | 'igst'
1705
+ | 'jct'
1706
+ | 'lease_tax'
1707
+ | 'pst'
1708
+ | 'qst'
1709
+ | 'rst'
1710
+ | 'sales_tax'
1711
+ | 'vat';
1712
+ }
1713
+ }
1714
+ }
1715
+ }
1716
+
1461
1717
  interface InvoiceCreatePreviewParams {
1462
1718
  /**
1463
1719
  * Settings for automatic tax lookup for this invoice preview.
@@ -3917,6 +4173,43 @@ declare module 'stripe' {
3917
4173
  source?: string;
3918
4174
  }
3919
4175
 
4176
+ interface InvoiceRemoveLinesParams {
4177
+ /**
4178
+ * The line items to remove.
4179
+ */
4180
+ lines: Array<InvoiceRemoveLinesParams.Line>;
4181
+
4182
+ /**
4183
+ * Specifies which fields in the response should be expanded.
4184
+ */
4185
+ expand?: Array<string>;
4186
+
4187
+ /**
4188
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
4189
+ */
4190
+ invoice_metadata?: Stripe.Emptyable<{
4191
+ [key: string]: string;
4192
+ }>;
4193
+ }
4194
+
4195
+ namespace InvoiceRemoveLinesParams {
4196
+ interface Line {
4197
+ /**
4198
+ * Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice.
4199
+ */
4200
+ behavior: Line.Behavior;
4201
+
4202
+ /**
4203
+ * ID of an existing line item to remove from this invoice.
4204
+ */
4205
+ id: string;
4206
+ }
4207
+
4208
+ namespace Line {
4209
+ type Behavior = 'delete' | 'unassign';
4210
+ }
4211
+ }
4212
+
3920
4213
  interface InvoiceRetrieveUpcomingParams {
3921
4214
  /**
3922
4215
  * Settings for automatic tax lookup for this invoice preview.
@@ -5248,6 +5541,262 @@ declare module 'stripe' {
5248
5541
  expand?: Array<string>;
5249
5542
  }
5250
5543
 
5544
+ interface InvoiceUpdateLinesParams {
5545
+ /**
5546
+ * The line items to update.
5547
+ */
5548
+ lines: Array<InvoiceUpdateLinesParams.Line>;
5549
+
5550
+ /**
5551
+ * Specifies which fields in the response should be expanded.
5552
+ */
5553
+ expand?: Array<string>;
5554
+
5555
+ /**
5556
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
5557
+ */
5558
+ invoice_metadata?: Stripe.Emptyable<{
5559
+ [key: string]: string;
5560
+ }>;
5561
+ }
5562
+
5563
+ namespace InvoiceUpdateLinesParams {
5564
+ interface Line {
5565
+ /**
5566
+ * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
5567
+ */
5568
+ amount?: number;
5569
+
5570
+ /**
5571
+ * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
5572
+ */
5573
+ description?: string;
5574
+
5575
+ /**
5576
+ * Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
5577
+ */
5578
+ discountable?: boolean;
5579
+
5580
+ /**
5581
+ * The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
5582
+ */
5583
+ discounts?: Stripe.Emptyable<Array<Line.Discount>>;
5584
+
5585
+ /**
5586
+ * ID of an existing line item on the invoice.
5587
+ */
5588
+ id: string;
5589
+
5590
+ /**
5591
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
5592
+ */
5593
+ metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
5594
+
5595
+ /**
5596
+ * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
5597
+ */
5598
+ period?: Line.Period;
5599
+
5600
+ /**
5601
+ * The ID of the price object. One of `price` or `price_data` is required.
5602
+ */
5603
+ price?: string;
5604
+
5605
+ /**
5606
+ * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
5607
+ */
5608
+ price_data?: Line.PriceData;
5609
+
5610
+ /**
5611
+ * Non-negative integer. The quantity of units for the line item.
5612
+ */
5613
+ quantity?: number;
5614
+
5615
+ /**
5616
+ * A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
5617
+ */
5618
+ tax_amounts?: Stripe.Emptyable<Array<Line.TaxAmount>>;
5619
+
5620
+ /**
5621
+ * The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
5622
+ */
5623
+ tax_rates?: Stripe.Emptyable<Array<string>>;
5624
+ }
5625
+
5626
+ namespace Line {
5627
+ interface Discount {
5628
+ /**
5629
+ * ID of the coupon to create a new discount for.
5630
+ */
5631
+ coupon?: string;
5632
+
5633
+ /**
5634
+ * ID of an existing discount on the object (or one of its ancestors) to reuse.
5635
+ */
5636
+ discount?: string;
5637
+
5638
+ /**
5639
+ * ID of the promotion code to create a new discount for.
5640
+ */
5641
+ promotion_code?: string;
5642
+ }
5643
+
5644
+ interface Period {
5645
+ /**
5646
+ * The end of the period, which must be greater than or equal to the start. This value is inclusive.
5647
+ */
5648
+ end: number;
5649
+
5650
+ /**
5651
+ * The start of the period. This value is inclusive.
5652
+ */
5653
+ start: number;
5654
+ }
5655
+
5656
+ interface PriceData {
5657
+ /**
5658
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
5659
+ */
5660
+ currency: string;
5661
+
5662
+ /**
5663
+ * The ID of the product that this price will belong to. One of `product` or `product_data` is required.
5664
+ */
5665
+ product?: string;
5666
+
5667
+ /**
5668
+ * Data used to generate a new product object inline. One of `product` or `product_data` is required.
5669
+ */
5670
+ product_data?: PriceData.ProductData;
5671
+
5672
+ /**
5673
+ * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
5674
+ */
5675
+ tax_behavior?: PriceData.TaxBehavior;
5676
+
5677
+ /**
5678
+ * A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
5679
+ */
5680
+ unit_amount?: number;
5681
+
5682
+ /**
5683
+ * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
5684
+ */
5685
+ unit_amount_decimal?: string;
5686
+ }
5687
+
5688
+ namespace PriceData {
5689
+ interface ProductData {
5690
+ /**
5691
+ * The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
5692
+ */
5693
+ description?: string;
5694
+
5695
+ /**
5696
+ * A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
5697
+ */
5698
+ images?: Array<string>;
5699
+
5700
+ /**
5701
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
5702
+ */
5703
+ metadata?: Stripe.MetadataParam;
5704
+
5705
+ /**
5706
+ * The product's name, meant to be displayable to the customer.
5707
+ */
5708
+ name: string;
5709
+
5710
+ /**
5711
+ * A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
5712
+ */
5713
+ tax_code?: string;
5714
+ }
5715
+
5716
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
5717
+ }
5718
+
5719
+ interface TaxAmount {
5720
+ /**
5721
+ * The amount, in cents (or local equivalent), of the tax.
5722
+ */
5723
+ amount: number;
5724
+
5725
+ /**
5726
+ * Data to find or create a TaxRate object.
5727
+ *
5728
+ * Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items.
5729
+ */
5730
+ tax_rate_data: TaxAmount.TaxRateData;
5731
+
5732
+ /**
5733
+ * The amount on which tax is calculated, in cents (or local equivalent).
5734
+ */
5735
+ taxable_amount: number;
5736
+ }
5737
+
5738
+ namespace TaxAmount {
5739
+ interface TaxRateData {
5740
+ /**
5741
+ * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
5742
+ */
5743
+ country?: string;
5744
+
5745
+ /**
5746
+ * An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
5747
+ */
5748
+ description?: string;
5749
+
5750
+ /**
5751
+ * The display name of the tax rate, which will be shown to users.
5752
+ */
5753
+ display_name: string;
5754
+
5755
+ /**
5756
+ * This specifies if the tax rate is inclusive or exclusive.
5757
+ */
5758
+ inclusive: boolean;
5759
+
5760
+ /**
5761
+ * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice.
5762
+ */
5763
+ jurisdiction?: string;
5764
+
5765
+ /**
5766
+ * The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
5767
+ */
5768
+ percentage: number;
5769
+
5770
+ /**
5771
+ * [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
5772
+ */
5773
+ state?: string;
5774
+
5775
+ /**
5776
+ * The high-level tax type, such as `vat` or `sales_tax`.
5777
+ */
5778
+ tax_type?: TaxRateData.TaxType;
5779
+ }
5780
+
5781
+ namespace TaxRateData {
5782
+ type TaxType =
5783
+ | 'amusement_tax'
5784
+ | 'communications_tax'
5785
+ | 'gst'
5786
+ | 'hst'
5787
+ | 'igst'
5788
+ | 'jct'
5789
+ | 'lease_tax'
5790
+ | 'pst'
5791
+ | 'qst'
5792
+ | 'rst'
5793
+ | 'sales_tax'
5794
+ | 'vat';
5795
+ }
5796
+ }
5797
+ }
5798
+ }
5799
+
5251
5800
  interface InvoiceUpdateLineItemParams {
5252
5801
  /**
5253
5802
  * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
@@ -5275,7 +5824,7 @@ declare module 'stripe' {
5275
5824
  expand?: Array<string>;
5276
5825
 
5277
5826
  /**
5278
- * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For `type=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data.
5827
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
5279
5828
  */
5280
5829
  metadata?: Stripe.Emptyable<Stripe.MetadataParam>;
5281
5830
 
@@ -5553,6 +6102,15 @@ declare module 'stripe' {
5553
6102
  options?: RequestOptions
5554
6103
  ): Promise<Stripe.Response<Stripe.DeletedInvoice>>;
5555
6104
 
6105
+ /**
6106
+ * Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
6107
+ */
6108
+ addLines(
6109
+ id: string,
6110
+ params: InvoiceAddLinesParams,
6111
+ options?: RequestOptions
6112
+ ): Promise<Stripe.Response<Stripe.Invoice>>;
6113
+
5556
6114
  /**
5557
6115
  * At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
5558
6116
  *
@@ -5633,6 +6191,15 @@ declare module 'stripe' {
5633
6191
  options?: RequestOptions
5634
6192
  ): Promise<Stripe.Response<Stripe.Invoice>>;
5635
6193
 
6194
+ /**
6195
+ * Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
6196
+ */
6197
+ removeLines(
6198
+ id: string,
6199
+ params: InvoiceRemoveLinesParams,
6200
+ options?: RequestOptions
6201
+ ): Promise<Stripe.Response<Stripe.Invoice>>;
6202
+
5636
6203
  /**
5637
6204
  * At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
5638
6205
  *
@@ -5676,6 +6243,15 @@ declare module 'stripe' {
5676
6243
  options?: RequestOptions
5677
6244
  ): Promise<Stripe.Response<Stripe.Invoice>>;
5678
6245
 
6246
+ /**
6247
+ * Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
6248
+ */
6249
+ updateLines(
6250
+ id: string,
6251
+ params: InvoiceUpdateLinesParams,
6252
+ options?: RequestOptions
6253
+ ): Promise<Stripe.Response<Stripe.Invoice>>;
6254
+
5679
6255
  /**
5680
6256
  * Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item,
5681
6257
  * so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice
@@ -475,6 +475,7 @@ declare module 'stripe' {
475
475
  | 'parameters_exclusive'
476
476
  | 'payment_intent_action_required'
477
477
  | 'payment_intent_authentication_failure'
478
+ | 'payment_intent_fx_quote_invalid'
478
479
  | 'payment_intent_incompatible_payment_method'
479
480
  | 'payment_intent_invalid_parameter'
480
481
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -718,6 +718,7 @@ declare module 'stripe' {
718
718
  | 'parameters_exclusive'
719
719
  | 'payment_intent_action_required'
720
720
  | 'payment_intent_authentication_failure'
721
+ | 'payment_intent_fx_quote_invalid'
721
722
  | 'payment_intent_incompatible_payment_method'
722
723
  | 'payment_intent_invalid_parameter'
723
724
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -388,6 +388,7 @@ declare module 'stripe' {
388
388
  | 'parameters_exclusive'
389
389
  | 'payment_intent_action_required'
390
390
  | 'payment_intent_authentication_failure'
391
+ | 'payment_intent_fx_quote_invalid'
391
392
  | 'payment_intent_incompatible_payment_method'
392
393
  | 'payment_intent_invalid_parameter'
393
394
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -51,6 +51,11 @@ declare module 'stripe' {
51
51
  */
52
52
  metadata: Stripe.Metadata | null;
53
53
 
54
+ /**
55
+ * The Unix timestamp representing when the tax liability is assumed or reduced.
56
+ */
57
+ posted_at: number;
58
+
54
59
  /**
55
60
  * A custom unique identifier, such as 'myOrder_123'.
56
61
  */
@@ -30,6 +30,11 @@ declare module 'stripe' {
30
30
  * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
31
31
  */
32
32
  metadata?: Stripe.MetadataParam;
33
+
34
+ /**
35
+ * The Unix timestamp representing when the tax liability is assumed or reduced, which determines the liability posting period and handling in tax liability reports. The timestamp must fall within the `tax_date` and the current time, unless the `tax_date` is scheduled in advance. Defaults to the current time.
36
+ */
37
+ posted_at?: number;
33
38
  }
34
39
 
35
40
  interface TransactionCreateReversalParams {