@stripe/extensibility-sdk 0.25.0 → 0.27.1

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.
Files changed (43) hide show
  1. package/README.md +7 -9
  2. package/dist/config-values/generate.cjs +1 -1
  3. package/dist/config-values/generate.js +1 -1
  4. package/dist/extensibility-sdk-alpha.d.ts +85 -119
  5. package/dist/extensibility-sdk-beta.d.ts +85 -119
  6. package/dist/extensibility-sdk-extensions-alpha.d.ts +82 -54
  7. package/dist/extensibility-sdk-extensions-beta.d.ts +82 -54
  8. package/dist/extensibility-sdk-extensions-internal.d.ts +83 -55
  9. package/dist/extensibility-sdk-extensions-public.d.ts +82 -54
  10. package/dist/extensibility-sdk-internal.d.ts +89 -101
  11. package/dist/extensibility-sdk-public.d.ts +85 -119
  12. package/dist/extensions/billing/index.d.ts +1 -1
  13. package/dist/extensions/billing/invoice_collection_options.d.ts +111 -0
  14. package/dist/extensions/billing/invoice_collection_options.d.ts.map +1 -0
  15. package/dist/extensions/billing/recurring_billing_item_handling.d.ts +43 -0
  16. package/dist/extensions/billing/recurring_billing_item_handling.d.ts.map +1 -1
  17. package/dist/extensions/index.cjs +111 -52
  18. package/dist/extensions/index.js +111 -52
  19. package/dist/index.cjs +128 -97
  20. package/dist/index.js +126 -91
  21. package/dist/internal.cjs +7 -7
  22. package/dist/internal.js +7 -7
  23. package/dist/stdlib/decimal.d.ts +2 -2
  24. package/dist/stdlib/index.d.ts +4 -8
  25. package/dist/stdlib/index.d.ts.map +1 -1
  26. package/dist/stdlib/refs.d.ts +1 -31
  27. package/dist/stdlib/refs.d.ts.map +1 -1
  28. package/dist/stdlib/scalars.d.ts +0 -22
  29. package/dist/stdlib/scalars.d.ts.map +1 -1
  30. package/dist/stdlib/to-const.d.ts +1 -1
  31. package/dist/stdlib/transforms.d.ts +1 -1
  32. package/dist/stdlib/types.d.ts +5 -5
  33. package/dist/stdlib/types.d.ts.map +1 -1
  34. package/dist/tsconfig.build.tsbuildinfo +1 -1
  35. package/package.json +2 -10
  36. package/dist/extensibility-sdk-stdlib-alpha.d.ts +0 -638
  37. package/dist/extensibility-sdk-stdlib-beta.d.ts +0 -638
  38. package/dist/extensibility-sdk-stdlib-internal.d.ts +0 -1008
  39. package/dist/extensibility-sdk-stdlib-public.d.ts +0 -638
  40. package/dist/extensions/billing/invoice_collection_setting.d.ts +0 -117
  41. package/dist/extensions/billing/invoice_collection_setting.d.ts.map +0 -1
  42. package/dist/stdlib/index.cjs +0 -1770
  43. package/dist/stdlib/index.js +0 -1710
@@ -91,7 +91,7 @@ declare namespace Bill {
91
91
  declare namespace Billing {
92
92
  export {
93
93
  CustomerBalanceApplication,
94
- InvoiceCollectionSetting,
94
+ InvoiceCollectionOptions,
95
95
  Prorations,
96
96
  RecurringBillingItemHandling,
97
97
  Bill,
@@ -495,7 +495,7 @@ declare interface CustomerBalanceApplication<Config> {
495
495
  *
496
496
  * @example
497
497
  * ```ts
498
- * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk/stdlib';
498
+ * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
499
499
  *
500
500
  * const price = Decimal.from('19.99');
501
501
  * const tax = price.mul(Decimal.from('0.0825'));
@@ -1034,58 +1034,65 @@ export declare interface IntegerCompanion {
1034
1034
  export declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
1035
1035
 
1036
1036
  /** @public */
1037
- declare namespace InvoiceCollectionSetting {
1037
+ declare namespace InvoiceCollectionOptions {
1038
1038
  /** @public */
1039
- type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
1040
- /** @public */
1041
- type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
1039
+ type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'blik' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
1042
1040
  /** @public */
1043
1041
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
1044
1042
  /**
1045
- * The result of the invoice collection settings override extension.
1043
+ * The result of the invoice collection options override extension.
1046
1044
  * @public
1047
1045
  */
1048
- interface InvoiceCollectionResponse {
1046
+ interface InvoiceCollectionOptionsResult {
1049
1047
  /** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
1050
1048
  autoAdvance?: boolean;
1051
1049
  }
1052
1050
  /** @public */
1053
- type InvoiceCollectionRequest = ({
1051
+ type InvoiceCollectionOptionsInput = ({
1054
1052
  customer: Customer;
1055
1053
  payer: 'customer';
1056
1054
  } | {
1057
1055
  otherPayer: string;
1058
1056
  payer: 'other';
1059
- }) & {
1060
- collectionSettings: CollectionSettings;
1061
- parent: Parent;
1062
- };
1057
+ }) & ({
1058
+ invoiceParentType: 'other';
1059
+ otherInvoiceParentType: string;
1060
+ } | {
1061
+ invoiceParentType: 'subscription';
1062
+ subscription: SubscriptionParent;
1063
+ } | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
1063
1064
  /** @public */
1064
1065
  interface Customer {
1065
1066
  id: string;
1066
1067
  metadata: Record<string, string>;
1067
1068
  }
1069
+ /** @public */
1070
+ type ContractParent = Record<string, never>;
1068
1071
  /**
1069
- * The parent resource that triggered the invoice creation.
1072
+ * The Subscription that triggered the invoice creation.
1070
1073
  * @public
1071
1074
  */
1072
- interface Parent {
1073
- /** The type of parent resource (for example, subscription or contract). */
1074
- type: ParentType;
1075
- /** Custom key-value pairs attached to the parent resource. */
1075
+ interface SubscriptionParent {
1076
+ /** The unique identifier for the subscription. */
1077
+ id: string;
1078
+ /** The metadata of the subscription. */
1076
1079
  metadata: Record<string, string>;
1077
1080
  }
1081
+ /** @public */
1082
+ type ScheduleParent = Record<string, never>;
1083
+ /** @public */
1084
+ type QuoteParent = Record<string, never>;
1085
+ /** @public */
1086
+ type CadenceParent = Record<string, never>;
1078
1087
  /**
1079
- * The collection settings for an invoice.
1088
+ * The collection options for an invoice.
1080
1089
  * @public
1081
1090
  */
1082
- interface CollectionSettings {
1091
+ interface CollectionOptions {
1083
1092
  /** Whether the invoice automatically advances through its lifecycle. */
1084
1093
  autoAdvance: boolean;
1085
1094
  /** The payment collection method: charge_automatically or send_invoice. */
1086
1095
  collectionMethod: CollectionMethod;
1087
- /** The delay before the invoice is finalized, in hours. */
1088
- finalizationGracePeriod: number;
1089
1096
  /** The payment methods configured for this invoice. */
1090
1097
  paymentMethods: PaymentMethodType[];
1091
1098
  }
@@ -1093,76 +1100,35 @@ declare namespace InvoiceCollectionSetting {
1093
1100
  * @public
1094
1101
  * @deprecated Platform dispatch handles wire/SDK conversion.
1095
1102
  */
1096
- function prepareArgsCollectionOverride(proto: unknown): InvoiceCollectionRequest;
1103
+ function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
1097
1104
  /**
1098
1105
  * @public
1099
1106
  * @deprecated Platform dispatch handles wire/SDK conversion.
1100
1107
  */
1101
- function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
1102
- /* Excluded from this release type: $platformWrapCollectionOverride */
1108
+ function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
1109
+ /* Excluded from this release type: $platformWrapOverrideOptions */
1103
1110
  /**
1104
1111
  * @public
1105
1112
  * @deprecated Platform dispatch handles wire/SDK conversion.
1106
1113
  */
1107
- const prepareArgs: typeof prepareArgsCollectionOverride;
1114
+ const prepareArgs: typeof prepareArgsOverrideOptions;
1108
1115
  /**
1109
1116
  * @public
1110
1117
  * @deprecated Platform dispatch handles wire/SDK conversion.
1111
1118
  */
1112
- const prepareResult: typeof prepareResultCollectionOverride;
1119
+ const prepareResult: typeof prepareResultOverrideOptions;
1113
1120
  /**
1114
- * Overrides invoice collection settings before a draft invoice is created.
1121
+ * Overrides invoice collection options before a draft invoice is created.
1115
1122
  * @public
1116
1123
  */
1117
- type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
1124
+ type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
1118
1125
  }
1119
1126
 
1120
- /**
1121
- * @example
1122
- * ```ts
1123
- * import type { Billing, Context } from '@stripe/extensibility-sdk';
1124
- *
1125
- * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1126
- * interface MyInvoiceCollectionSettingConfig {}
1127
- *
1128
- * export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
1129
- * collectionOverride(
1130
- * _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
1131
- * _config: MyInvoiceCollectionSettingConfig,
1132
- * _context: Context
1133
- * ) {
1134
- * // TODO: implement your collection setting logic here
1135
- *
1136
- * return {};
1137
- * }
1138
- * }
1139
- *
1140
- * ```
1141
- * @public
1142
- */
1143
- declare interface InvoiceCollectionSetting<Config> {
1144
- collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
1127
+ /** @public */
1128
+ declare interface InvoiceCollectionOptions<Config> {
1129
+ overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
1145
1130
  }
1146
1131
 
1147
- /**
1148
- * Check whether a value is a `Decimal` instance.
1149
- *
1150
- * @remarks
1151
- * Use this instead of `instanceof` — the underlying class is not
1152
- * publicly exported, so `instanceof` checks are not available to
1153
- * consumers.
1154
- *
1155
- * @example
1156
- * ```ts
1157
- * if (isDecimal(value)) {
1158
- * value.add(Decimal.from('1')); // value is Decimal
1159
- * }
1160
- * ```
1161
- *
1162
- * @public
1163
- */
1164
- export declare function isDecimal(value: unknown): value is Decimal;
1165
-
1166
1132
  /* Excluded from this release type: _isPromiseLike */
1167
1133
 
1168
1134
  /* Excluded from this release type: _JsonWireToType */
@@ -1506,6 +1472,15 @@ declare namespace RecurringBillingItemHandling {
1506
1472
  }
1507
1473
  /** @public */
1508
1474
  type Item = ({
1475
+ creditedItems: 'invoiceItem';
1476
+ invoiceItem: CreditedInvoiceItem;
1477
+ } | {
1478
+ creditedItems: 'invoiceLineItems';
1479
+ invoiceLineItems: InvoiceLineItems;
1480
+ } | {
1481
+ creditedItems: 'other';
1482
+ otherCreditedItems: string;
1483
+ }) & ({
1509
1484
  customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1510
1485
  priceKind: 'customPricingUnitOverageRate';
1511
1486
  } | {
@@ -1527,6 +1502,40 @@ declare namespace RecurringBillingItemHandling {
1527
1502
  servicePeriod: AnyTimeRange;
1528
1503
  type: ItemType;
1529
1504
  };
1505
+ /**
1506
+ * The invoice item corresponding to a credit item.
1507
+ * @public
1508
+ */
1509
+ interface CreditedInvoiceItem {
1510
+ /** The id of the invoice item. */
1511
+ id: string;
1512
+ }
1513
+ /**
1514
+ * Information about debit line items corresponding to a credit item.
1515
+ * @public
1516
+ */
1517
+ interface InvoiceLineItems {
1518
+ /** The invoice containing the line items. */
1519
+ invoice: CreditedInvoice;
1520
+ /** The line items corresponding to the credit. */
1521
+ invoiceLineItems: CreditedInvoiceLineItem[];
1522
+ }
1523
+ /**
1524
+ * The invoice line item corresponding to a credit item.
1525
+ * @public
1526
+ */
1527
+ interface CreditedInvoiceLineItem {
1528
+ /** The id of the invoice line item. */
1529
+ id: string;
1530
+ }
1531
+ /**
1532
+ * The invoice corresponding to a credit item.
1533
+ * @public
1534
+ */
1535
+ interface CreditedInvoice {
1536
+ /** The id of the invoice. */
1537
+ id: string;
1538
+ }
1530
1539
  /** @public */
1531
1540
  interface CustomPricingUnitOverageRate {
1532
1541
  id: string;
@@ -1787,9 +1796,6 @@ export declare type Ref<T extends {
1787
1796
  readonly [__stripeType]: 'string';
1788
1797
  };
1789
1798
 
1790
- /** Factory for creating {@link (Ref:type)} values from an object with `object` and `id` fields. @public */
1791
- export declare const Ref: { create: <T extends { readonly object: string }>(step: { readonly id: string } & T) => Ref<T> };
1792
-
1793
1799
  /* Excluded from this release type: _required */
1794
1800
 
1795
1801
  /**
@@ -1816,15 +1822,6 @@ export declare type RoundDirection = 'ceil' | 'floor' | 'half-down' | 'half-even
1816
1822
 
1817
1823
  /* Excluded from this release type: _ShapeDescriptor */
1818
1824
 
1819
- /** A branded string representing a street address. @public */
1820
- export declare type StreetAddress = {
1821
- readonly [__brand]: 'StreetAddress';
1822
- readonly [__stripeType]: 'string';
1823
- } & string;
1824
-
1825
- /** Factory for creating {@link (StreetAddress:type)} branded values. @public */
1826
- export declare const StreetAddress: { create: (address: string) => StreetAddress };
1827
-
1828
1825
  /** The type of the opaque Stripe type-tag key used in SDK scalar types. @public */
1829
1826
  export declare type StripeTypeSymbol = typeof __stripeType;
1830
1827
 
@@ -1839,15 +1836,6 @@ declare interface TimeRange {
1839
1836
  endDate: Date;
1840
1837
  }
1841
1838
 
1842
- /** A branded string representing an ISO 8601 datetime. @public */
1843
- export declare type Timestamp = {
1844
- readonly [__brand]: 'Timestamp';
1845
- readonly [__stripeType]: 'string';
1846
- } & string;
1847
-
1848
- /** Factory for creating {@link (Timestamp:type)} branded values. @public */
1849
- export declare const Timestamp: { create: (value: string) => Timestamp };
1850
-
1851
1839
  /**
1852
1840
  * Deep-freezes `value` and returns it typed as {@link DeepReadonly}`<T>`.
1853
1841
  *
@@ -1857,7 +1845,7 @@ export declare const Timestamp: { create: (value: string) => Timestamp };
1857
1845
  *
1858
1846
  * @example
1859
1847
  * ```typescript
1860
- * import { toConst } from '@stripe/extensibility-sdk/stdlib';
1848
+ * import { toConst } from '@stripe/extensibility-sdk';
1861
1849
  *
1862
1850
  * const DEFAULTS = toConst({ timeout: 30, retries: 3 });
1863
1851
  * // Type: { readonly timeout: 30; readonly retries: 3 }
@@ -1892,31 +1880,9 @@ export declare function toConst<T>(value: T): DeepReadonly<T>;
1892
1880
 
1893
1881
  /* Excluded from this release type: _UnionDescriptor */
1894
1882
 
1895
- /**
1896
- * Shared types and error classes for the transform pipeline.
1897
- * See transforms.ts for the module overview.
1898
- */
1899
- /**
1900
- * Thrown when incoming wire data (proto → SDK) cannot be parsed.
1901
- * Indicates malformed or unexpected data from the proto infrastructure —
1902
- * not a bug in the user's code.
1903
- *
1904
- * @public
1905
- */
1906
- export declare class WireReadError extends Error {
1907
- /* Excluded from this release type: name */
1908
- }
1883
+ /* Excluded from this release type: _WireReadError */
1909
1884
 
1910
- /**
1911
- * Thrown when outgoing SDK data (SDK → proto) cannot be serialized.
1912
- * Indicates that the user's code returned a value that cannot be translated
1913
- * back to wire format.
1914
- *
1915
- * @public
1916
- */
1917
- export declare class WireWriteError extends Error {
1918
- /* Excluded from this release type: name */
1919
- }
1885
+ /* Excluded from this release type: _WireWriteError */
1920
1886
 
1921
1887
  declare namespace Workflows {
1922
1888
  export {
@@ -75,7 +75,7 @@ declare namespace Bill {
75
75
  declare namespace Billing {
76
76
  export {
77
77
  CustomerBalanceApplication,
78
- InvoiceCollectionSetting,
78
+ InvoiceCollectionOptions,
79
79
  Prorations,
80
80
  RecurringBillingItemHandling,
81
81
  Bill,
@@ -472,7 +472,7 @@ declare interface CustomerBalanceApplication<Config> {
472
472
  *
473
473
  * @example
474
474
  * ```ts
475
- * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk/stdlib';
475
+ * import { Decimal, RoundDirection } from '@stripe/extensibility-sdk';
476
476
  *
477
477
  * const price = Decimal.from('19.99');
478
478
  * const tax = price.mul(Decimal.from('0.0825'));
@@ -965,58 +965,65 @@ declare interface IntegerCompanion {
965
965
  declare type IntegerRoundDirection = 'ceil' | 'floor' | 'half-up' | 'round-down' | 'round-up';
966
966
 
967
967
  /** @public */
968
- declare namespace InvoiceCollectionSetting {
968
+ declare namespace InvoiceCollectionOptions {
969
969
  /** @public */
970
- type ParentType = 'billing_cadence' | 'contract' | 'quote' | 'standalone' | 'subscription_schedule' | 'subscription';
971
- /** @public */
972
- type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
970
+ type PaymentMethodType = 'ach_credit_transfer' | 'ach_debit' | 'affirm' | 'afterpay_clearpay' | 'alipay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' | 'blik' | 'boleto' | 'card' | 'cashapp' | 'eps' | 'fpx' | 'giropay' | 'grabpay' | 'ideal' | 'klarna' | 'konbini' | 'link' | 'multibanco' | 'oxxo' | 'p24' | 'paynow' | 'paypal' | 'promptpay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' | 'us_bank_account' | 'wechat_pay';
973
971
  /** @public */
974
972
  type CollectionMethod = 'charge_automatically' | 'send_invoice';
975
973
  /**
976
- * The result of the invoice collection settings override extension.
974
+ * The result of the invoice collection options override extension.
977
975
  * @public
978
976
  */
979
- interface InvoiceCollectionResponse {
977
+ interface InvoiceCollectionOptionsResult {
980
978
  /** Override the auto-advancement setting. Set to false to keep the invoice in draft. Return null to use the default. */
981
979
  autoAdvance?: boolean;
982
980
  }
983
981
  /** @public */
984
- type InvoiceCollectionRequest = ({
982
+ type InvoiceCollectionOptionsInput = ({
985
983
  customer: Customer;
986
984
  payer: 'customer';
987
985
  } | {
988
986
  otherPayer: string;
989
987
  payer: 'other';
990
- }) & {
991
- collectionSettings: CollectionSettings;
992
- parent: Parent;
993
- };
988
+ }) & ({
989
+ invoiceParentType: 'other';
990
+ otherInvoiceParentType: string;
991
+ } | {
992
+ invoiceParentType: 'subscription';
993
+ subscription: SubscriptionParent;
994
+ } | { invoiceParentType: 'cadence' } | { invoiceParentType: 'contract' } | { invoiceParentType: 'quote' } | { invoiceParentType: 'schedule' }) & { collectionOptions: CollectionOptions };
994
995
  /** @public */
995
996
  interface Customer {
996
997
  id: string;
997
998
  metadata: Record<string, string>;
998
999
  }
1000
+ /** @public */
1001
+ type ContractParent = Record<string, never>;
999
1002
  /**
1000
- * The parent resource that triggered the invoice creation.
1003
+ * The Subscription that triggered the invoice creation.
1001
1004
  * @public
1002
1005
  */
1003
- interface Parent {
1004
- /** The type of parent resource (for example, subscription or contract). */
1005
- type: ParentType;
1006
- /** Custom key-value pairs attached to the parent resource. */
1006
+ interface SubscriptionParent {
1007
+ /** The unique identifier for the subscription. */
1008
+ id: string;
1009
+ /** The metadata of the subscription. */
1007
1010
  metadata: Record<string, string>;
1008
1011
  }
1012
+ /** @public */
1013
+ type ScheduleParent = Record<string, never>;
1014
+ /** @public */
1015
+ type QuoteParent = Record<string, never>;
1016
+ /** @public */
1017
+ type CadenceParent = Record<string, never>;
1009
1018
  /**
1010
- * The collection settings for an invoice.
1019
+ * The collection options for an invoice.
1011
1020
  * @public
1012
1021
  */
1013
- interface CollectionSettings {
1022
+ interface CollectionOptions {
1014
1023
  /** Whether the invoice automatically advances through its lifecycle. */
1015
1024
  autoAdvance: boolean;
1016
1025
  /** The payment collection method: charge_automatically or send_invoice. */
1017
1026
  collectionMethod: CollectionMethod;
1018
- /** The delay before the invoice is finalized, in hours. */
1019
- finalizationGracePeriod: number;
1020
1027
  /** The payment methods configured for this invoice. */
1021
1028
  paymentMethods: PaymentMethodType[];
1022
1029
  }
@@ -1024,55 +1031,33 @@ declare namespace InvoiceCollectionSetting {
1024
1031
  * @public
1025
1032
  * @deprecated Platform dispatch handles wire/SDK conversion.
1026
1033
  */
1027
- function prepareArgsCollectionOverride(proto: unknown): InvoiceCollectionRequest;
1034
+ function prepareArgsOverrideOptions(proto: unknown): InvoiceCollectionOptionsInput;
1028
1035
  /**
1029
1036
  * @public
1030
1037
  * @deprecated Platform dispatch handles wire/SDK conversion.
1031
1038
  */
1032
- function prepareResultCollectionOverride(result: InvoiceCollectionResponse): InvoiceCollectionResponse;
1033
- /* Excluded from this release type: $platformWrapCollectionOverride */
1039
+ function prepareResultOverrideOptions(result: InvoiceCollectionOptionsResult): InvoiceCollectionOptionsResult;
1040
+ /* Excluded from this release type: $platformWrapOverrideOptions */
1034
1041
  /**
1035
1042
  * @public
1036
1043
  * @deprecated Platform dispatch handles wire/SDK conversion.
1037
1044
  */
1038
- const prepareArgs: typeof prepareArgsCollectionOverride;
1045
+ const prepareArgs: typeof prepareArgsOverrideOptions;
1039
1046
  /**
1040
1047
  * @public
1041
1048
  * @deprecated Platform dispatch handles wire/SDK conversion.
1042
1049
  */
1043
- const prepareResult: typeof prepareResultCollectionOverride;
1050
+ const prepareResult: typeof prepareResultOverrideOptions;
1044
1051
  /**
1045
- * Overrides invoice collection settings before a draft invoice is created.
1052
+ * Overrides invoice collection options before a draft invoice is created.
1046
1053
  * @public
1047
1054
  */
1048
- type CollectionOverrideFunction<Config> = (request: InvoiceCollectionRequest, config: Config, context: Context) => InvoiceCollectionResponse;
1055
+ type OverrideOptionsFunction<Config> = (request: InvoiceCollectionOptionsInput, config: Config, context: Context) => InvoiceCollectionOptionsResult;
1049
1056
  }
1050
1057
 
1051
- /**
1052
- * @example
1053
- * ```ts
1054
- * import type { Billing, Context } from '@stripe/extensibility-sdk';
1055
- *
1056
- * // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1057
- * interface MyInvoiceCollectionSettingConfig {}
1058
- *
1059
- * export default class MyInvoiceCollectionSetting implements Billing.InvoiceCollectionSetting<MyInvoiceCollectionSettingConfig> {
1060
- * collectionOverride(
1061
- * _request: Billing.InvoiceCollectionSetting.InvoiceCollectionRequest,
1062
- * _config: MyInvoiceCollectionSettingConfig,
1063
- * _context: Context
1064
- * ) {
1065
- * // TODO: implement your collection setting logic here
1066
- *
1067
- * return {};
1068
- * }
1069
- * }
1070
- *
1071
- * ```
1072
- * @public
1073
- */
1074
- declare interface InvoiceCollectionSetting<Config> {
1075
- collectionOverride: InvoiceCollectionSetting.CollectionOverrideFunction<Config>;
1058
+ /** @public */
1059
+ declare interface InvoiceCollectionOptions<Config> {
1060
+ overrideOptions: InvoiceCollectionOptions.OverrideOptionsFunction<Config>;
1076
1061
  }
1077
1062
 
1078
1063
  /**
@@ -1402,6 +1387,15 @@ declare namespace RecurringBillingItemHandling {
1402
1387
  }
1403
1388
  /** @public */
1404
1389
  type Item = ({
1390
+ creditedItems: 'invoiceItem';
1391
+ invoiceItem: CreditedInvoiceItem;
1392
+ } | {
1393
+ creditedItems: 'invoiceLineItems';
1394
+ invoiceLineItems: InvoiceLineItems;
1395
+ } | {
1396
+ creditedItems: 'other';
1397
+ otherCreditedItems: string;
1398
+ }) & ({
1405
1399
  customPricingUnitOverageRate: CustomPricingUnitOverageRate;
1406
1400
  priceKind: 'customPricingUnitOverageRate';
1407
1401
  } | {
@@ -1423,6 +1417,40 @@ declare namespace RecurringBillingItemHandling {
1423
1417
  servicePeriod: AnyTimeRange;
1424
1418
  type: ItemType;
1425
1419
  };
1420
+ /**
1421
+ * The invoice item corresponding to a credit item.
1422
+ * @public
1423
+ */
1424
+ interface CreditedInvoiceItem {
1425
+ /** The id of the invoice item. */
1426
+ id: string;
1427
+ }
1428
+ /**
1429
+ * Information about debit line items corresponding to a credit item.
1430
+ * @public
1431
+ */
1432
+ interface InvoiceLineItems {
1433
+ /** The invoice containing the line items. */
1434
+ invoice: CreditedInvoice;
1435
+ /** The line items corresponding to the credit. */
1436
+ invoiceLineItems: CreditedInvoiceLineItem[];
1437
+ }
1438
+ /**
1439
+ * The invoice line item corresponding to a credit item.
1440
+ * @public
1441
+ */
1442
+ interface CreditedInvoiceLineItem {
1443
+ /** The id of the invoice line item. */
1444
+ id: string;
1445
+ }
1446
+ /**
1447
+ * The invoice corresponding to a credit item.
1448
+ * @public
1449
+ */
1450
+ interface CreditedInvoice {
1451
+ /** The id of the invoice. */
1452
+ id: string;
1453
+ }
1426
1454
  /** @public */
1427
1455
  interface CustomPricingUnitOverageRate {
1428
1456
  id: string;