stripe 19.4.0-alpha.1 → 19.4.0-alpha.2

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 (42) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/OPENAPI_VERSION +1 -1
  3. package/README.md +2 -0
  4. package/VERSION +1 -1
  5. package/cjs/RequestSender.js +1 -1
  6. package/cjs/apiVersion.js +1 -1
  7. package/cjs/resources/Issuing/Programs.js +22 -0
  8. package/cjs/resources.js +2 -2
  9. package/cjs/stripe.core.js +1 -1
  10. package/esm/RequestSender.js +1 -1
  11. package/esm/apiVersion.js +1 -1
  12. package/esm/resources/Issuing/Programs.js +19 -0
  13. package/esm/resources.js +2 -2
  14. package/esm/stripe.core.js +1 -1
  15. package/package.json +1 -1
  16. package/types/AccountsResource.d.ts +88 -0
  17. package/types/DelegatedCheckout/RequestedSessions.d.ts +24 -0
  18. package/types/DelegatedCheckout/RequestedSessionsResource.d.ts +6 -0
  19. package/types/Discounts.d.ts +10 -0
  20. package/types/InvoiceItems.d.ts +13 -0
  21. package/types/InvoiceLineItems.d.ts +13 -0
  22. package/types/Invoices.d.ts +13 -0
  23. package/types/InvoicesResource.d.ts +86 -1
  24. package/types/Issuing/Programs.d.ts +42 -0
  25. package/types/Issuing/ProgramsResource.d.ts +96 -0
  26. package/types/Persons.d.ts +28 -0
  27. package/types/QuotePreviewInvoices.d.ts +13 -0
  28. package/types/QuotePreviewSubscriptionSchedules.d.ts +200 -0
  29. package/types/Quotes.d.ts +388 -0
  30. package/types/QuotesResource.d.ts +642 -54
  31. package/types/SubscriptionSchedules.d.ts +198 -0
  32. package/types/SubscriptionSchedulesResource.d.ts +176 -0
  33. package/types/Subscriptions.d.ts +109 -1
  34. package/types/SubscriptionsResource.d.ts +14 -2
  35. package/types/TestHelpers/Capital/FinancingOffersResource.d.ts +30 -0
  36. package/types/TokensResource.d.ts +44 -0
  37. package/types/apiVersion.d.ts +1 -1
  38. package/types/index.d.ts +3 -5
  39. package/cjs/resources/V2/Tax/AutomaticRules.js +0 -22
  40. package/esm/resources/V2/Tax/AutomaticRules.js +0 -19
  41. package/types/V2/Tax/AutomaticRules.d.ts +0 -53
  42. package/types/V2/Tax/AutomaticRulesResource.d.ts +0 -102
package/types/Quotes.d.ts CHANGED
@@ -803,6 +803,16 @@ declare module 'stripe' {
803
803
  * Integer representing the number of trial period days before the customer is charged for the first time.
804
804
  */
805
805
  trial_period_days: number | null;
806
+
807
+ /**
808
+ * Billing schedules that will be applied to the subscription or subscription schedule created from this quote.
809
+ */
810
+ billing_schedules?: Array<SubscriptionData.BillingSchedule> | null;
811
+
812
+ /**
813
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
814
+ */
815
+ phase_effective_at?: SubscriptionData.PhaseEffectiveAt | null;
806
816
  }
807
817
 
808
818
  namespace SubscriptionData {
@@ -832,6 +842,187 @@ declare module 'stripe' {
832
842
  type Type = 'classic' | 'flexible';
833
843
  }
834
844
 
845
+ interface BillingSchedule {
846
+ /**
847
+ * Specifies which subscription items the billing schedule applies to.
848
+ */
849
+ applies_to: Array<BillingSchedule.AppliesTo> | null;
850
+
851
+ /**
852
+ * Specifies the billing period.
853
+ */
854
+ bill_until: BillingSchedule.BillUntil;
855
+
856
+ /**
857
+ * Unique identifier for the billing schedule.
858
+ */
859
+ key: string;
860
+
861
+ /**
862
+ * Specifies the start of the billing period.
863
+ */
864
+ bill_from?: BillingSchedule.BillFrom | null;
865
+ }
866
+
867
+ namespace BillingSchedule {
868
+ interface AppliesTo {
869
+ /**
870
+ * The billing schedule will apply to the subscription item with the given price ID.
871
+ */
872
+ price: string | Stripe.Price | null;
873
+
874
+ /**
875
+ * Controls which subscription items the billing schedule applies to.
876
+ */
877
+ type: 'price';
878
+ }
879
+
880
+ interface BillFrom {
881
+ /**
882
+ * Use an index to specify the position of an amendment to start prebilling with.
883
+ */
884
+ amendment_start: BillFrom.AmendmentStart | null;
885
+
886
+ /**
887
+ * The time the billing schedule applies from.
888
+ */
889
+ computed_timestamp: number | null;
890
+
891
+ /**
892
+ * Lets you bill the period starting from a particular Quote line.
893
+ */
894
+ line_starts_at: BillFrom.LineStartsAt | null;
895
+
896
+ /**
897
+ * Timestamp is calculated from the request time.
898
+ */
899
+ relative: BillFrom.Relative | null;
900
+
901
+ /**
902
+ * Use a precise Unix timestamp for prebilling to start. Must be earlier than `bill_until`.
903
+ */
904
+ timestamp: number | null;
905
+
906
+ /**
907
+ * Describes how the billing schedule determines the start date. Possible values are `timestamp`, `relative`, `amendment_start`, `now`, `quote_acceptance_date`, `line_starts_at`, or `pause_collection_start`.
908
+ */
909
+ type: BillFrom.Type;
910
+ }
911
+
912
+ namespace BillFrom {
913
+ interface AmendmentStart {
914
+ /**
915
+ * Use an index to specify the position of an amendment to start prebilling with.
916
+ */
917
+ index: number;
918
+ }
919
+
920
+ interface LineStartsAt {
921
+ /**
922
+ * Unique identifier for the object.
923
+ */
924
+ id: string;
925
+ }
926
+
927
+ interface Relative {
928
+ /**
929
+ * Specifies billing duration. Possible values are `day`, `week`, `month`, or `year`.
930
+ */
931
+ interval: Relative.Interval;
932
+
933
+ /**
934
+ * The multiplier applied to the interval.
935
+ */
936
+ interval_count: number | null;
937
+ }
938
+
939
+ namespace Relative {
940
+ type Interval = 'day' | 'month' | 'week' | 'year';
941
+ }
942
+
943
+ type Type =
944
+ | 'amendment_start'
945
+ | 'line_starts_at'
946
+ | 'now'
947
+ | 'pause_collection_start'
948
+ | 'quote_acceptance_date'
949
+ | 'relative'
950
+ | 'timestamp';
951
+ }
952
+
953
+ interface BillUntil {
954
+ /**
955
+ * The timestamp the billing schedule will apply until.
956
+ */
957
+ computed_timestamp: number;
958
+
959
+ /**
960
+ * Specifies the billing period.
961
+ */
962
+ duration: BillUntil.Duration | null;
963
+
964
+ /**
965
+ * If specified, the billing schedule will apply until the specified timestamp.
966
+ */
967
+ timestamp: number | null;
968
+
969
+ /**
970
+ * Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
971
+ */
972
+ type: BillUntil.Type;
973
+
974
+ /**
975
+ * Use an index to specify the position of an amendment to end prebilling with.
976
+ */
977
+ amendment_end?: BillUntil.AmendmentEnd | null;
978
+
979
+ /**
980
+ * Lets you bill the period ending at a particular Quote line.
981
+ */
982
+ line_ends_at?: BillUntil.LineEndsAt | null;
983
+ }
984
+
985
+ namespace BillUntil {
986
+ interface AmendmentEnd {
987
+ /**
988
+ * Use an index to specify the position of an amendment to end prebilling with.
989
+ */
990
+ index: number;
991
+ }
992
+
993
+ interface Duration {
994
+ /**
995
+ * Specifies billing duration. Either `day`, `week`, `month` or `year`.
996
+ */
997
+ interval: Duration.Interval;
998
+
999
+ /**
1000
+ * The multiplier applied to the interval.
1001
+ */
1002
+ interval_count: number | null;
1003
+ }
1004
+
1005
+ namespace Duration {
1006
+ type Interval = 'day' | 'month' | 'week' | 'year';
1007
+ }
1008
+
1009
+ interface LineEndsAt {
1010
+ /**
1011
+ * Unique identifier for the object.
1012
+ */
1013
+ id: string;
1014
+ }
1015
+
1016
+ type Type =
1017
+ | 'amendment_end'
1018
+ | 'duration'
1019
+ | 'line_ends_at'
1020
+ | 'schedule_end'
1021
+ | 'timestamp'
1022
+ | 'upcoming_invoice';
1023
+ }
1024
+ }
1025
+
835
1026
  interface BillOnAcceptance {
836
1027
  /**
837
1028
  * The start of the period to bill from when the Quote is accepted.
@@ -945,6 +1136,8 @@ declare module 'stripe' {
945
1136
 
946
1137
  type EndBehavior = 'cancel' | 'release';
947
1138
 
1139
+ type PhaseEffectiveAt = 'billing_period_start' | 'phase_start';
1140
+
948
1141
  interface Prebilling {
949
1142
  iterations: number;
950
1143
  }
@@ -987,6 +1180,18 @@ declare module 'stripe' {
987
1180
  * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
988
1181
  */
989
1182
  proration_behavior?: SubscriptionDataOverride.ProrationBehavior | null;
1183
+
1184
+ /**
1185
+ * Billing schedules that will be applied to the subscription or subscription schedule created from this quote.
1186
+ */
1187
+ billing_schedules?: Array<
1188
+ SubscriptionDataOverride.BillingSchedule
1189
+ > | null;
1190
+
1191
+ /**
1192
+ * Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
1193
+ */
1194
+ phase_effective_at?: SubscriptionDataOverride.PhaseEffectiveAt | null;
990
1195
  }
991
1196
 
992
1197
  namespace SubscriptionDataOverride {
@@ -1013,6 +1218,187 @@ declare module 'stripe' {
1013
1218
 
1014
1219
  type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front';
1015
1220
 
1221
+ interface BillingSchedule {
1222
+ /**
1223
+ * Specifies which subscription items the billing schedule applies to.
1224
+ */
1225
+ applies_to: Array<BillingSchedule.AppliesTo> | null;
1226
+
1227
+ /**
1228
+ * Specifies the billing period.
1229
+ */
1230
+ bill_until: BillingSchedule.BillUntil;
1231
+
1232
+ /**
1233
+ * Unique identifier for the billing schedule.
1234
+ */
1235
+ key: string;
1236
+
1237
+ /**
1238
+ * Specifies the start of the billing period.
1239
+ */
1240
+ bill_from?: BillingSchedule.BillFrom | null;
1241
+ }
1242
+
1243
+ namespace BillingSchedule {
1244
+ interface AppliesTo {
1245
+ /**
1246
+ * The billing schedule will apply to the subscription item with the given price ID.
1247
+ */
1248
+ price: string | Stripe.Price | null;
1249
+
1250
+ /**
1251
+ * Controls which subscription items the billing schedule applies to.
1252
+ */
1253
+ type: 'price';
1254
+ }
1255
+
1256
+ interface BillFrom {
1257
+ /**
1258
+ * Use an index to specify the position of an amendment to start prebilling with.
1259
+ */
1260
+ amendment_start: BillFrom.AmendmentStart | null;
1261
+
1262
+ /**
1263
+ * The time the billing schedule applies from.
1264
+ */
1265
+ computed_timestamp: number | null;
1266
+
1267
+ /**
1268
+ * Lets you bill the period starting from a particular Quote line.
1269
+ */
1270
+ line_starts_at: BillFrom.LineStartsAt | null;
1271
+
1272
+ /**
1273
+ * Timestamp is calculated from the request time.
1274
+ */
1275
+ relative: BillFrom.Relative | null;
1276
+
1277
+ /**
1278
+ * Use a precise Unix timestamp for prebilling to start. Must be earlier than `bill_until`.
1279
+ */
1280
+ timestamp: number | null;
1281
+
1282
+ /**
1283
+ * Describes how the billing schedule determines the start date. Possible values are `timestamp`, `relative`, `amendment_start`, `now`, `quote_acceptance_date`, `line_starts_at`, or `pause_collection_start`.
1284
+ */
1285
+ type: BillFrom.Type;
1286
+ }
1287
+
1288
+ namespace BillFrom {
1289
+ interface AmendmentStart {
1290
+ /**
1291
+ * Use an index to specify the position of an amendment to start prebilling with.
1292
+ */
1293
+ index: number;
1294
+ }
1295
+
1296
+ interface LineStartsAt {
1297
+ /**
1298
+ * Unique identifier for the object.
1299
+ */
1300
+ id: string;
1301
+ }
1302
+
1303
+ interface Relative {
1304
+ /**
1305
+ * Specifies billing duration. Possible values are `day`, `week`, `month`, or `year`.
1306
+ */
1307
+ interval: Relative.Interval;
1308
+
1309
+ /**
1310
+ * The multiplier applied to the interval.
1311
+ */
1312
+ interval_count: number | null;
1313
+ }
1314
+
1315
+ namespace Relative {
1316
+ type Interval = 'day' | 'month' | 'week' | 'year';
1317
+ }
1318
+
1319
+ type Type =
1320
+ | 'amendment_start'
1321
+ | 'line_starts_at'
1322
+ | 'now'
1323
+ | 'pause_collection_start'
1324
+ | 'quote_acceptance_date'
1325
+ | 'relative'
1326
+ | 'timestamp';
1327
+ }
1328
+
1329
+ interface BillUntil {
1330
+ /**
1331
+ * The timestamp the billing schedule will apply until.
1332
+ */
1333
+ computed_timestamp: number;
1334
+
1335
+ /**
1336
+ * Specifies the billing period.
1337
+ */
1338
+ duration: BillUntil.Duration | null;
1339
+
1340
+ /**
1341
+ * If specified, the billing schedule will apply until the specified timestamp.
1342
+ */
1343
+ timestamp: number | null;
1344
+
1345
+ /**
1346
+ * Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
1347
+ */
1348
+ type: BillUntil.Type;
1349
+
1350
+ /**
1351
+ * Use an index to specify the position of an amendment to end prebilling with.
1352
+ */
1353
+ amendment_end?: BillUntil.AmendmentEnd | null;
1354
+
1355
+ /**
1356
+ * Lets you bill the period ending at a particular Quote line.
1357
+ */
1358
+ line_ends_at?: BillUntil.LineEndsAt | null;
1359
+ }
1360
+
1361
+ namespace BillUntil {
1362
+ interface AmendmentEnd {
1363
+ /**
1364
+ * Use an index to specify the position of an amendment to end prebilling with.
1365
+ */
1366
+ index: number;
1367
+ }
1368
+
1369
+ interface Duration {
1370
+ /**
1371
+ * Specifies billing duration. Either `day`, `week`, `month` or `year`.
1372
+ */
1373
+ interval: Duration.Interval;
1374
+
1375
+ /**
1376
+ * The multiplier applied to the interval.
1377
+ */
1378
+ interval_count: number | null;
1379
+ }
1380
+
1381
+ namespace Duration {
1382
+ type Interval = 'day' | 'month' | 'week' | 'year';
1383
+ }
1384
+
1385
+ interface LineEndsAt {
1386
+ /**
1387
+ * Unique identifier for the object.
1388
+ */
1389
+ id: string;
1390
+ }
1391
+
1392
+ type Type =
1393
+ | 'amendment_end'
1394
+ | 'duration'
1395
+ | 'line_ends_at'
1396
+ | 'schedule_end'
1397
+ | 'timestamp'
1398
+ | 'upcoming_invoice';
1399
+ }
1400
+ }
1401
+
1016
1402
  interface BillOnAcceptance {
1017
1403
  /**
1018
1404
  * The start of the period to bill from when the Quote is accepted.
@@ -1126,6 +1512,8 @@ declare module 'stripe' {
1126
1512
 
1127
1513
  type EndBehavior = 'cancel' | 'release';
1128
1514
 
1515
+ type PhaseEffectiveAt = 'billing_period_start' | 'phase_start';
1516
+
1129
1517
  type ProrationBehavior =
1130
1518
  | 'always_invoice'
1131
1519
  | 'create_prorations'