autumn-js 1.2.11 → 1.2.13

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 (159) hide show
  1. package/dist/backend/adapters/express.js +143 -4
  2. package/dist/backend/adapters/express.mjs +8 -8
  3. package/dist/backend/adapters/fetch.js +143 -4
  4. package/dist/backend/adapters/fetch.mjs +8 -8
  5. package/dist/backend/adapters/hono.js +143 -4
  6. package/dist/backend/adapters/hono.mjs +8 -8
  7. package/dist/backend/adapters/index.js +143 -4
  8. package/dist/backend/adapters/index.mjs +11 -11
  9. package/dist/backend/adapters/next.js +143 -4
  10. package/dist/backend/adapters/next.mjs +8 -8
  11. package/dist/backend/{chunk-WMGBAAJK.mjs → chunk-7BVATYGA.mjs} +1 -1
  12. package/dist/backend/{chunk-4RBWBJIF.mjs → chunk-DNNJOZAT.mjs} +1 -1
  13. package/dist/backend/{chunk-SKWVW2EN.mjs → chunk-EJGHP7KT.mjs} +5 -5
  14. package/dist/backend/{chunk-FPZHAFCV.mjs → chunk-MANTLPDT.mjs} +24 -0
  15. package/dist/backend/{chunk-JEVAYQ65.mjs → chunk-OUDB34Y7.mjs} +1 -1
  16. package/dist/backend/{chunk-MBL56SEJ.mjs → chunk-RPH5L44S.mjs} +1 -1
  17. package/dist/backend/{chunk-AY6OV7CM.mjs → chunk-T42RZEUZ.mjs} +119 -4
  18. package/dist/backend/{chunk-JMDETKOQ.mjs → chunk-YSQQKZBU.mjs} +7 -7
  19. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  21. package/dist/backend/core/handlers/coreHandler.js +143 -4
  22. package/dist/backend/core/handlers/coreHandler.mjs +6 -6
  23. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  25. package/dist/backend/core/handlers/executeRoute.mjs +3 -3
  26. package/dist/backend/core/handlers/handleRouteByName.js +143 -4
  27. package/dist/backend/core/handlers/handleRouteByName.mjs +6 -6
  28. package/dist/backend/core/handlers/index.d.mts +1 -1
  29. package/dist/backend/core/handlers/index.d.ts +1 -1
  30. package/dist/backend/core/handlers/index.js +143 -4
  31. package/dist/backend/core/handlers/index.mjs +10 -10
  32. package/dist/backend/core/index.d.mts +1 -1
  33. package/dist/backend/core/index.d.ts +1 -1
  34. package/dist/backend/core/index.js +143 -4
  35. package/dist/backend/core/index.mjs +7 -7
  36. package/dist/backend/core/routes/index.d.mts +1 -1
  37. package/dist/backend/core/routes/index.d.ts +1 -1
  38. package/dist/backend/core/routes/index.js +24 -0
  39. package/dist/backend/core/routes/index.mjs +1 -1
  40. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  41. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  44. package/dist/backend/core/routes/routeConfigs.js +24 -0
  45. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  46. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  47. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  48. package/dist/backend/core/types/index.d.mts +1 -1
  49. package/dist/backend/core/types/index.d.ts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  51. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  52. package/dist/backend/index.d.mts +2 -2
  53. package/dist/backend/index.d.ts +2 -2
  54. package/dist/backend/index.js +143 -4
  55. package/dist/backend/index.mjs +7 -7
  56. package/dist/backend/{routeTypes-D7ANq7kY.d.ts → routeTypes-B94_Mq2J.d.ts} +129 -0
  57. package/dist/backend/{routeTypes-CQWFgZk4.d.mts → routeTypes-DVwngaBn.d.mts} +129 -0
  58. package/dist/better-auth/{chunk-3GVPOBXE.mjs → chunk-4OWECHZC.mjs} +1 -1
  59. package/dist/better-auth/{chunk-WEDJRTA3.mjs → chunk-JIFD4TSN.mjs} +24 -0
  60. package/dist/better-auth/{chunk-XH3WDFWS.mjs → chunk-ZZGFPTHO.mjs} +120 -5
  61. package/dist/better-auth/client.d.mts +3 -7
  62. package/dist/better-auth/client.d.ts +3 -7
  63. package/dist/better-auth/createAutumnEndpoint-CvXRCg-M.d.mts +43 -0
  64. package/dist/better-auth/createAutumnEndpoint-CvXRCg-M.d.ts +43 -0
  65. package/dist/better-auth/index.d.mts +3 -7
  66. package/dist/better-auth/index.d.ts +3 -7
  67. package/dist/better-auth/index.js +143 -4
  68. package/dist/better-auth/index.mjs +3 -3
  69. package/dist/better-auth/utils/createAutumnEndpoint.d.mts +3 -7
  70. package/dist/better-auth/utils/createAutumnEndpoint.d.ts +3 -7
  71. package/dist/better-auth/utils/createAutumnEndpoint.js +24 -0
  72. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  73. package/dist/better-auth/utils/handleBetterAuthRoute.d.mts +3 -7
  74. package/dist/better-auth/utils/handleBetterAuthRoute.d.ts +3 -7
  75. package/dist/better-auth/utils/handleBetterAuthRoute.js +143 -4
  76. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  77. package/dist/better-auth/utils/index.d.mts +3 -8
  78. package/dist/better-auth/utils/index.d.ts +3 -8
  79. package/dist/better-auth/utils/index.js +143 -4
  80. package/dist/better-auth/utils/index.mjs +3 -3
  81. package/dist/react/AutumnContext.d.mts +3 -3
  82. package/dist/react/AutumnContext.d.ts +3 -3
  83. package/dist/react/AutumnProvider.js +15 -15
  84. package/dist/react/AutumnProvider.mjs +2 -2
  85. package/dist/react/{chunk-26CKSAPZ.mjs → chunk-7IDH4OMG.mjs} +1 -1
  86. package/dist/react/{chunk-HSQUB3BZ.mjs → chunk-BDG6JHEW.mjs} +1 -1
  87. package/dist/react/{chunk-KB72KQKN.mjs → chunk-DEZBJQEG.mjs} +1 -1
  88. package/dist/react/{chunk-XJZH5NMZ.mjs → chunk-E5ZHOMZ4.mjs} +23 -23
  89. package/dist/react/{chunk-OXQG65ZT.mjs → chunk-FWWIAOPU.mjs} +1 -1
  90. package/dist/react/{chunk-ZGPE4R6H.mjs → chunk-HVBDZARN.mjs} +2 -2
  91. package/dist/react/{chunk-MC2YYATT.mjs → chunk-J6SLKTKE.mjs} +1 -1
  92. package/dist/react/{chunk-CHU7CIWP.mjs → chunk-NSFHAUTD.mjs} +1 -1
  93. package/dist/react/{chunk-G7FTQLT7.mjs → chunk-YQFYWH7J.mjs} +1 -1
  94. package/dist/react/client/AutumnClient.d.mts +3 -3
  95. package/dist/react/client/AutumnClient.d.ts +3 -3
  96. package/dist/react/client/IAutumnClient.d.mts +16 -3
  97. package/dist/react/client/IAutumnClient.d.ts +16 -3
  98. package/dist/react/client/index.d.mts +3 -3
  99. package/dist/react/client/index.d.ts +3 -3
  100. package/dist/react/{customer-CbcVyRCQ.d.ts → customer-CaGJEN5J.d.ts} +1 -1
  101. package/dist/react/{customer-BYYt9N1h.d.mts → customer-DB8vL_m7.d.mts} +1 -1
  102. package/dist/react/hooks/index.d.mts +3 -3
  103. package/dist/react/hooks/index.d.ts +3 -3
  104. package/dist/react/hooks/index.js +16 -16
  105. package/dist/react/hooks/index.mjs +8 -8
  106. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  107. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  108. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  109. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  110. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  111. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  112. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  113. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  114. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  115. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  116. package/dist/react/hooks/internal/useCustomerActions.d.mts +3 -3
  117. package/dist/react/hooks/internal/useCustomerActions.d.ts +3 -3
  118. package/dist/react/hooks/internal/useCustomerActions.js +1 -1
  119. package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
  120. package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
  121. package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
  122. package/dist/react/hooks/useAggregateEvents.js +16 -16
  123. package/dist/react/hooks/useAggregateEvents.mjs +2 -2
  124. package/dist/react/hooks/useCustomer.d.mts +3 -3
  125. package/dist/react/hooks/useCustomer.d.ts +3 -3
  126. package/dist/react/hooks/useCustomer.js +16 -16
  127. package/dist/react/hooks/useCustomer.mjs +3 -3
  128. package/dist/react/hooks/useEntity.d.mts +2 -2
  129. package/dist/react/hooks/useEntity.d.ts +2 -2
  130. package/dist/react/hooks/useEntity.js +16 -16
  131. package/dist/react/hooks/useEntity.mjs +2 -2
  132. package/dist/react/hooks/useListEvents.d.mts +2 -2
  133. package/dist/react/hooks/useListEvents.d.ts +2 -2
  134. package/dist/react/hooks/useListEvents.js +16 -16
  135. package/dist/react/hooks/useListEvents.mjs +2 -2
  136. package/dist/react/hooks/useListPlans.d.mts +2 -2
  137. package/dist/react/hooks/useListPlans.d.ts +2 -2
  138. package/dist/react/hooks/useListPlans.js +16 -16
  139. package/dist/react/hooks/useListPlans.mjs +2 -2
  140. package/dist/react/hooks/useReferrals.d.mts +2 -2
  141. package/dist/react/hooks/useReferrals.d.ts +2 -2
  142. package/dist/react/hooks/useReferrals.js +16 -16
  143. package/dist/react/hooks/useReferrals.mjs +2 -2
  144. package/dist/react/index.d.mts +3 -3
  145. package/dist/react/index.d.ts +3 -3
  146. package/dist/react/index.js +22 -22
  147. package/dist/react/index.mjs +9 -9
  148. package/dist/react/{params-5jUgYeHh.d.mts → params-B5l9vHfZ.d.ts} +35 -1
  149. package/dist/react/{params-g4jEwMY7.d.ts → params-BVglT8vT.d.mts} +35 -1
  150. package/dist/react/{plan-CqxFGNk2.d.mts → plan-DSTBzzTY.d.mts} +13 -0
  151. package/dist/react/{plan-CqxFGNk2.d.ts → plan-DSTBzzTY.d.ts} +13 -0
  152. package/dist/sdk/index.d.mts +179 -1
  153. package/dist/sdk/index.d.ts +179 -1
  154. package/dist/sdk/index.js +196 -4
  155. package/dist/sdk/index.mjs +179 -5
  156. package/package.json +1 -1
  157. package/dist/better-auth/createAutumnEndpoint-D9Plymvy.d.mts +0 -309
  158. package/dist/better-auth/createAutumnEndpoint-D9Plymvy.d.ts +0 -309
  159. package/dist/backend/{chunk-55C2WWXQ.mjs → chunk-S5HPMJ4U.mjs} +3 -3
@@ -1401,6 +1401,19 @@ declare const BillingUpdateRedirectMode: {
1401
1401
  * Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
1402
1402
  */
1403
1403
  type BillingUpdateRedirectMode = ClosedEnum<typeof BillingUpdateRedirectMode>;
1404
+ /**
1405
+ * A discount to apply. Can be either a reward ID or a promotion code.
1406
+ */
1407
+ type BillingUpdateAttachDiscount = {
1408
+ /**
1409
+ * The ID of the reward to apply as a discount.
1410
+ */
1411
+ rewardId?: string | undefined;
1412
+ /**
1413
+ * The promotion code to apply as a discount.
1414
+ */
1415
+ promotionCode?: string | undefined;
1416
+ };
1404
1417
  /**
1405
1418
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
1406
1419
  */
@@ -1463,6 +1476,10 @@ type UpdateSubscriptionParams = {
1463
1476
  * A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
1464
1477
  */
1465
1478
  subscriptionId?: string | undefined;
1479
+ /**
1480
+ * List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
1481
+ */
1482
+ discounts?: Array<BillingUpdateAttachDiscount> | undefined;
1466
1483
  /**
1467
1484
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
1468
1485
  */
@@ -2661,6 +2678,15 @@ declare const PlanEnv: {
2661
2678
  * Environment this plan belongs to ('sandbox' or 'live').
2662
2679
  */
2663
2680
  type PlanEnv = OpenEnum<typeof PlanEnv>;
2681
+ /**
2682
+ * Miscellaneous plan-level configuration flags.
2683
+ */
2684
+ type PlanConfig = {
2685
+ /**
2686
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
2687
+ */
2688
+ ignorePastDue: boolean;
2689
+ };
2664
2690
  /**
2665
2691
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
2666
2692
  */
@@ -2765,6 +2791,10 @@ type Plan = {
2765
2791
  * If this is a variant, the ID of the base plan it was created from.
2766
2792
  */
2767
2793
  baseVariantId: string | null;
2794
+ /**
2795
+ * Miscellaneous plan-level configuration flags.
2796
+ */
2797
+ config: PlanConfig;
2768
2798
  customerEligibility?: CustomerEligibility | undefined;
2769
2799
  };
2770
2800
 
@@ -3602,6 +3632,15 @@ type FreeTrialRequest = {
3602
3632
  */
3603
3633
  cardRequired?: boolean | undefined;
3604
3634
  };
3635
+ /**
3636
+ * Miscellaneous plan-level configuration flags.
3637
+ */
3638
+ type CreatePlanConfigRequest = {
3639
+ /**
3640
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
3641
+ */
3642
+ ignorePastDue?: boolean | undefined;
3643
+ };
3605
3644
  type CreatePlanParams = {
3606
3645
  /**
3607
3646
  * The ID of the plan to create.
@@ -3639,6 +3678,10 @@ type CreatePlanParams = {
3639
3678
  * Free trial configuration. Customers can try this plan before being charged.
3640
3679
  */
3641
3680
  freeTrial?: FreeTrialRequest | undefined;
3681
+ /**
3682
+ * Miscellaneous plan-level configuration flags.
3683
+ */
3684
+ config?: CreatePlanConfigRequest | undefined;
3642
3685
  };
3643
3686
  /**
3644
3687
  * Billing interval (e.g. 'month', 'year').
@@ -3958,6 +4001,15 @@ declare const CreatePlanEnv: {
3958
4001
  * Environment this plan belongs to ('sandbox' or 'live').
3959
4002
  */
3960
4003
  type CreatePlanEnv = OpenEnum<typeof CreatePlanEnv>;
4004
+ /**
4005
+ * Miscellaneous plan-level configuration flags.
4006
+ */
4007
+ type CreatePlanConfigResponse = {
4008
+ /**
4009
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
4010
+ */
4011
+ ignorePastDue: boolean;
4012
+ };
3961
4013
  /**
3962
4014
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
3963
4015
  */
@@ -4065,6 +4117,10 @@ type CreatePlanResponse = {
4065
4117
  * If this is a variant, the ID of the base plan it was created from.
4066
4118
  */
4067
4119
  baseVariantId: string | null;
4120
+ /**
4121
+ * Miscellaneous plan-level configuration flags.
4122
+ */
4123
+ config: CreatePlanConfigResponse;
4068
4124
  customerEligibility?: CreatePlanCustomerEligibility | undefined;
4069
4125
  };
4070
4126
 
@@ -5596,6 +5652,15 @@ declare const GetPlanEnv: {
5596
5652
  * Environment this plan belongs to ('sandbox' or 'live').
5597
5653
  */
5598
5654
  type GetPlanEnv = OpenEnum<typeof GetPlanEnv>;
5655
+ /**
5656
+ * Miscellaneous plan-level configuration flags.
5657
+ */
5658
+ type GetPlanConfig = {
5659
+ /**
5660
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
5661
+ */
5662
+ ignorePastDue: boolean;
5663
+ };
5599
5664
  /**
5600
5665
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
5601
5666
  */
@@ -5703,6 +5768,10 @@ type GetPlanResponse = {
5703
5768
  * If this is a variant, the ID of the base plan it was created from.
5704
5769
  */
5705
5770
  baseVariantId: string | null;
5771
+ /**
5772
+ * Miscellaneous plan-level configuration flags.
5773
+ */
5774
+ config: GetPlanConfig;
5706
5775
  customerEligibility?: GetPlanCustomerEligibility | undefined;
5707
5776
  };
5708
5777
 
@@ -6736,6 +6805,15 @@ declare const ListPlansEnv: {
6736
6805
  * Environment this plan belongs to ('sandbox' or 'live').
6737
6806
  */
6738
6807
  type ListPlansEnv = OpenEnum<typeof ListPlansEnv>;
6808
+ /**
6809
+ * Miscellaneous plan-level configuration flags.
6810
+ */
6811
+ type ListPlansConfig = {
6812
+ /**
6813
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
6814
+ */
6815
+ ignorePastDue: boolean;
6816
+ };
6739
6817
  /**
6740
6818
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
6741
6819
  */
@@ -6843,6 +6921,10 @@ type ListPlansList = {
6843
6921
  * If this is a variant, the ID of the base plan it was created from.
6844
6922
  */
6845
6923
  baseVariantId: string | null;
6924
+ /**
6925
+ * Miscellaneous plan-level configuration flags.
6926
+ */
6927
+ config: ListPlansConfig;
6846
6928
  customerEligibility?: ListPlansCustomerEligibility | undefined;
6847
6929
  };
6848
6930
  /**
@@ -9368,6 +9450,19 @@ declare const PreviewUpdateRedirectMode: {
9368
9450
  * Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
9369
9451
  */
9370
9452
  type PreviewUpdateRedirectMode = ClosedEnum<typeof PreviewUpdateRedirectMode>;
9453
+ /**
9454
+ * A discount to apply. Can be either a reward ID or a promotion code.
9455
+ */
9456
+ type PreviewUpdateAttachDiscount = {
9457
+ /**
9458
+ * The ID of the reward to apply as a discount.
9459
+ */
9460
+ rewardId?: string | undefined;
9461
+ /**
9462
+ * The promotion code to apply as a discount.
9463
+ */
9464
+ promotionCode?: string | undefined;
9465
+ };
9371
9466
  /**
9372
9467
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
9373
9468
  */
@@ -9430,6 +9525,10 @@ type PreviewUpdateParams = {
9430
9525
  * A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
9431
9526
  */
9432
9527
  subscriptionId?: string | undefined;
9528
+ /**
9529
+ * List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
9530
+ */
9531
+ discounts?: Array<PreviewUpdateAttachDiscount> | undefined;
9433
9532
  /**
9434
9533
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
9435
9534
  */
@@ -11788,6 +11887,15 @@ type UpdatePlanFreeTrialParams = {
11788
11887
  */
11789
11888
  cardRequired?: boolean | undefined;
11790
11889
  };
11890
+ /**
11891
+ * Miscellaneous plan-level configuration flags.
11892
+ */
11893
+ type UpdatePlanConfigRequest = {
11894
+ /**
11895
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
11896
+ */
11897
+ ignorePastDue?: boolean | undefined;
11898
+ };
11791
11899
  type UpdatePlanParams = {
11792
11900
  /**
11793
11901
  * The ID of the plan to update.
@@ -11822,6 +11930,10 @@ type UpdatePlanParams = {
11822
11930
  * The free trial of the plan. Set to null to remove the free trial.
11823
11931
  */
11824
11932
  freeTrial?: UpdatePlanFreeTrialParams | null | undefined;
11933
+ /**
11934
+ * Miscellaneous plan-level configuration flags.
11935
+ */
11936
+ config?: UpdatePlanConfigRequest | undefined;
11825
11937
  version?: number | undefined;
11826
11938
  archived?: boolean | undefined;
11827
11939
  /**
@@ -12147,6 +12259,15 @@ declare const UpdatePlanEnv: {
12147
12259
  * Environment this plan belongs to ('sandbox' or 'live').
12148
12260
  */
12149
12261
  type UpdatePlanEnv = OpenEnum<typeof UpdatePlanEnv>;
12262
+ /**
12263
+ * Miscellaneous plan-level configuration flags.
12264
+ */
12265
+ type UpdatePlanConfigResponse = {
12266
+ /**
12267
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
12268
+ */
12269
+ ignorePastDue: boolean;
12270
+ };
12150
12271
  /**
12151
12272
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
12152
12273
  */
@@ -12254,6 +12375,10 @@ type UpdatePlanResponse = {
12254
12375
  * If this is a variant, the ID of the base plan it was created from.
12255
12376
  */
12256
12377
  baseVariantId: string | null;
12378
+ /**
12379
+ * Miscellaneous plan-level configuration flags.
12380
+ */
12381
+ config: UpdatePlanConfigResponse;
12257
12382
  customerEligibility?: UpdatePlanCustomerEligibility | undefined;
12258
12383
  };
12259
12384
 
@@ -12628,6 +12753,7 @@ declare class Billing extends ClientSDK {
12628
12753
  * @param prorationBehavior - How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. (optional)
12629
12754
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
12630
12755
  * @param subscriptionId - A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan. (optional)
12756
+ * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
12631
12757
  * @param cancelAction - Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. (optional)
12632
12758
  * @param billingCycleAnchor - Reset the billing cycle anchor immediately with 'now' (optional)
12633
12759
  * @param noBillingChanges - If true, the subscription is updated internally without applying billing changes in Stripe. (optional)
@@ -12657,6 +12783,7 @@ declare class Billing extends ClientSDK {
12657
12783
  * @param prorationBehavior - How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. (optional)
12658
12784
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
12659
12785
  * @param subscriptionId - A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan. (optional)
12786
+ * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
12660
12787
  * @param cancelAction - Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. (optional)
12661
12788
  * @param billingCycleAnchor - Reset the billing cycle anchor immediately with 'now' (optional)
12662
12789
  * @param noBillingChanges - If true, the subscription is updated internally without applying billing changes in Stripe. (optional)
@@ -12998,6 +13125,7 @@ declare class Plans extends ClientSDK {
12998
13125
  * @param price - Base recurring price for the plan. Omit for free or usage-only plans. (optional)
12999
13126
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
13000
13127
  * @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
13128
+ * @param config - Miscellaneous plan-level configuration flags. (optional)
13001
13129
  *
13002
13130
  * @returns The created plan object.
13003
13131
  */
@@ -13085,6 +13213,7 @@ declare class Plans extends ClientSDK {
13085
13213
  * @param price - The price of the plan. Set to null to remove the base price. (optional)
13086
13214
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
13087
13215
  * @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
13216
+ * @param config - Miscellaneous plan-level configuration flags. (optional)
13088
13217
  * @param newPlanId - The new ID to use for the plan. Can only be updated if the plan has not been used by any customers. (optional)
13089
13218
  *
13090
13219
  * @returns The updated plan object.
@@ -1401,6 +1401,19 @@ declare const BillingUpdateRedirectMode: {
1401
1401
  * Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
1402
1402
  */
1403
1403
  type BillingUpdateRedirectMode = ClosedEnum<typeof BillingUpdateRedirectMode>;
1404
+ /**
1405
+ * A discount to apply. Can be either a reward ID or a promotion code.
1406
+ */
1407
+ type BillingUpdateAttachDiscount = {
1408
+ /**
1409
+ * The ID of the reward to apply as a discount.
1410
+ */
1411
+ rewardId?: string | undefined;
1412
+ /**
1413
+ * The promotion code to apply as a discount.
1414
+ */
1415
+ promotionCode?: string | undefined;
1416
+ };
1404
1417
  /**
1405
1418
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
1406
1419
  */
@@ -1463,6 +1476,10 @@ type UpdateSubscriptionParams = {
1463
1476
  * A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
1464
1477
  */
1465
1478
  subscriptionId?: string | undefined;
1479
+ /**
1480
+ * List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
1481
+ */
1482
+ discounts?: Array<BillingUpdateAttachDiscount> | undefined;
1466
1483
  /**
1467
1484
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
1468
1485
  */
@@ -2661,6 +2678,15 @@ declare const PlanEnv: {
2661
2678
  * Environment this plan belongs to ('sandbox' or 'live').
2662
2679
  */
2663
2680
  type PlanEnv = OpenEnum<typeof PlanEnv>;
2681
+ /**
2682
+ * Miscellaneous plan-level configuration flags.
2683
+ */
2684
+ type PlanConfig = {
2685
+ /**
2686
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
2687
+ */
2688
+ ignorePastDue: boolean;
2689
+ };
2664
2690
  /**
2665
2691
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
2666
2692
  */
@@ -2765,6 +2791,10 @@ type Plan = {
2765
2791
  * If this is a variant, the ID of the base plan it was created from.
2766
2792
  */
2767
2793
  baseVariantId: string | null;
2794
+ /**
2795
+ * Miscellaneous plan-level configuration flags.
2796
+ */
2797
+ config: PlanConfig;
2768
2798
  customerEligibility?: CustomerEligibility | undefined;
2769
2799
  };
2770
2800
 
@@ -3602,6 +3632,15 @@ type FreeTrialRequest = {
3602
3632
  */
3603
3633
  cardRequired?: boolean | undefined;
3604
3634
  };
3635
+ /**
3636
+ * Miscellaneous plan-level configuration flags.
3637
+ */
3638
+ type CreatePlanConfigRequest = {
3639
+ /**
3640
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
3641
+ */
3642
+ ignorePastDue?: boolean | undefined;
3643
+ };
3605
3644
  type CreatePlanParams = {
3606
3645
  /**
3607
3646
  * The ID of the plan to create.
@@ -3639,6 +3678,10 @@ type CreatePlanParams = {
3639
3678
  * Free trial configuration. Customers can try this plan before being charged.
3640
3679
  */
3641
3680
  freeTrial?: FreeTrialRequest | undefined;
3681
+ /**
3682
+ * Miscellaneous plan-level configuration flags.
3683
+ */
3684
+ config?: CreatePlanConfigRequest | undefined;
3642
3685
  };
3643
3686
  /**
3644
3687
  * Billing interval (e.g. 'month', 'year').
@@ -3958,6 +4001,15 @@ declare const CreatePlanEnv: {
3958
4001
  * Environment this plan belongs to ('sandbox' or 'live').
3959
4002
  */
3960
4003
  type CreatePlanEnv = OpenEnum<typeof CreatePlanEnv>;
4004
+ /**
4005
+ * Miscellaneous plan-level configuration flags.
4006
+ */
4007
+ type CreatePlanConfigResponse = {
4008
+ /**
4009
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
4010
+ */
4011
+ ignorePastDue: boolean;
4012
+ };
3961
4013
  /**
3962
4014
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
3963
4015
  */
@@ -4065,6 +4117,10 @@ type CreatePlanResponse = {
4065
4117
  * If this is a variant, the ID of the base plan it was created from.
4066
4118
  */
4067
4119
  baseVariantId: string | null;
4120
+ /**
4121
+ * Miscellaneous plan-level configuration flags.
4122
+ */
4123
+ config: CreatePlanConfigResponse;
4068
4124
  customerEligibility?: CreatePlanCustomerEligibility | undefined;
4069
4125
  };
4070
4126
 
@@ -5596,6 +5652,15 @@ declare const GetPlanEnv: {
5596
5652
  * Environment this plan belongs to ('sandbox' or 'live').
5597
5653
  */
5598
5654
  type GetPlanEnv = OpenEnum<typeof GetPlanEnv>;
5655
+ /**
5656
+ * Miscellaneous plan-level configuration flags.
5657
+ */
5658
+ type GetPlanConfig = {
5659
+ /**
5660
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
5661
+ */
5662
+ ignorePastDue: boolean;
5663
+ };
5599
5664
  /**
5600
5665
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
5601
5666
  */
@@ -5703,6 +5768,10 @@ type GetPlanResponse = {
5703
5768
  * If this is a variant, the ID of the base plan it was created from.
5704
5769
  */
5705
5770
  baseVariantId: string | null;
5771
+ /**
5772
+ * Miscellaneous plan-level configuration flags.
5773
+ */
5774
+ config: GetPlanConfig;
5706
5775
  customerEligibility?: GetPlanCustomerEligibility | undefined;
5707
5776
  };
5708
5777
 
@@ -6736,6 +6805,15 @@ declare const ListPlansEnv: {
6736
6805
  * Environment this plan belongs to ('sandbox' or 'live').
6737
6806
  */
6738
6807
  type ListPlansEnv = OpenEnum<typeof ListPlansEnv>;
6808
+ /**
6809
+ * Miscellaneous plan-level configuration flags.
6810
+ */
6811
+ type ListPlansConfig = {
6812
+ /**
6813
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
6814
+ */
6815
+ ignorePastDue: boolean;
6816
+ };
6739
6817
  /**
6740
6818
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
6741
6819
  */
@@ -6843,6 +6921,10 @@ type ListPlansList = {
6843
6921
  * If this is a variant, the ID of the base plan it was created from.
6844
6922
  */
6845
6923
  baseVariantId: string | null;
6924
+ /**
6925
+ * Miscellaneous plan-level configuration flags.
6926
+ */
6927
+ config: ListPlansConfig;
6846
6928
  customerEligibility?: ListPlansCustomerEligibility | undefined;
6847
6929
  };
6848
6930
  /**
@@ -9368,6 +9450,19 @@ declare const PreviewUpdateRedirectMode: {
9368
9450
  * Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects.
9369
9451
  */
9370
9452
  type PreviewUpdateRedirectMode = ClosedEnum<typeof PreviewUpdateRedirectMode>;
9453
+ /**
9454
+ * A discount to apply. Can be either a reward ID or a promotion code.
9455
+ */
9456
+ type PreviewUpdateAttachDiscount = {
9457
+ /**
9458
+ * The ID of the reward to apply as a discount.
9459
+ */
9460
+ rewardId?: string | undefined;
9461
+ /**
9462
+ * The promotion code to apply as a discount.
9463
+ */
9464
+ promotionCode?: string | undefined;
9465
+ };
9371
9466
  /**
9372
9467
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
9373
9468
  */
@@ -9430,6 +9525,10 @@ type PreviewUpdateParams = {
9430
9525
  * A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
9431
9526
  */
9432
9527
  subscriptionId?: string | undefined;
9528
+ /**
9529
+ * List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
9530
+ */
9531
+ discounts?: Array<PreviewUpdateAttachDiscount> | undefined;
9433
9532
  /**
9434
9533
  * Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
9435
9534
  */
@@ -11788,6 +11887,15 @@ type UpdatePlanFreeTrialParams = {
11788
11887
  */
11789
11888
  cardRequired?: boolean | undefined;
11790
11889
  };
11890
+ /**
11891
+ * Miscellaneous plan-level configuration flags.
11892
+ */
11893
+ type UpdatePlanConfigRequest = {
11894
+ /**
11895
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
11896
+ */
11897
+ ignorePastDue?: boolean | undefined;
11898
+ };
11791
11899
  type UpdatePlanParams = {
11792
11900
  /**
11793
11901
  * The ID of the plan to update.
@@ -11822,6 +11930,10 @@ type UpdatePlanParams = {
11822
11930
  * The free trial of the plan. Set to null to remove the free trial.
11823
11931
  */
11824
11932
  freeTrial?: UpdatePlanFreeTrialParams | null | undefined;
11933
+ /**
11934
+ * Miscellaneous plan-level configuration flags.
11935
+ */
11936
+ config?: UpdatePlanConfigRequest | undefined;
11825
11937
  version?: number | undefined;
11826
11938
  archived?: boolean | undefined;
11827
11939
  /**
@@ -12147,6 +12259,15 @@ declare const UpdatePlanEnv: {
12147
12259
  * Environment this plan belongs to ('sandbox' or 'live').
12148
12260
  */
12149
12261
  type UpdatePlanEnv = OpenEnum<typeof UpdatePlanEnv>;
12262
+ /**
12263
+ * Miscellaneous plan-level configuration flags.
12264
+ */
12265
+ type UpdatePlanConfigResponse = {
12266
+ /**
12267
+ * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
12268
+ */
12269
+ ignorePastDue: boolean;
12270
+ };
12150
12271
  /**
12151
12272
  * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
12152
12273
  */
@@ -12254,6 +12375,10 @@ type UpdatePlanResponse = {
12254
12375
  * If this is a variant, the ID of the base plan it was created from.
12255
12376
  */
12256
12377
  baseVariantId: string | null;
12378
+ /**
12379
+ * Miscellaneous plan-level configuration flags.
12380
+ */
12381
+ config: UpdatePlanConfigResponse;
12257
12382
  customerEligibility?: UpdatePlanCustomerEligibility | undefined;
12258
12383
  };
12259
12384
 
@@ -12628,6 +12753,7 @@ declare class Billing extends ClientSDK {
12628
12753
  * @param prorationBehavior - How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. (optional)
12629
12754
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
12630
12755
  * @param subscriptionId - A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan. (optional)
12756
+ * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
12631
12757
  * @param cancelAction - Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. (optional)
12632
12758
  * @param billingCycleAnchor - Reset the billing cycle anchor immediately with 'now' (optional)
12633
12759
  * @param noBillingChanges - If true, the subscription is updated internally without applying billing changes in Stripe. (optional)
@@ -12657,6 +12783,7 @@ declare class Billing extends ClientSDK {
12657
12783
  * @param prorationBehavior - How to handle proration when updating an existing subscription. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges. (optional)
12658
12784
  * @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
12659
12785
  * @param subscriptionId - A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan. (optional)
12786
+ * @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
12660
12787
  * @param cancelAction - Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation. (optional)
12661
12788
  * @param billingCycleAnchor - Reset the billing cycle anchor immediately with 'now' (optional)
12662
12789
  * @param noBillingChanges - If true, the subscription is updated internally without applying billing changes in Stripe. (optional)
@@ -12998,6 +13125,7 @@ declare class Plans extends ClientSDK {
12998
13125
  * @param price - Base recurring price for the plan. Omit for free or usage-only plans. (optional)
12999
13126
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
13000
13127
  * @param freeTrial - Free trial configuration. Customers can try this plan before being charged. (optional)
13128
+ * @param config - Miscellaneous plan-level configuration flags. (optional)
13001
13129
  *
13002
13130
  * @returns The created plan object.
13003
13131
  */
@@ -13085,6 +13213,7 @@ declare class Plans extends ClientSDK {
13085
13213
  * @param price - The price of the plan. Set to null to remove the base price. (optional)
13086
13214
  * @param items - Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. (optional)
13087
13215
  * @param freeTrial - The free trial of the plan. Set to null to remove the free trial. (optional)
13216
+ * @param config - Miscellaneous plan-level configuration flags. (optional)
13088
13217
  * @param newPlanId - The new ID to use for the plan. Can only be updated if the plan has not been used by any customers. (optional)
13089
13218
  *
13090
13219
  * @returns The updated plan object.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeConfigs
3
- } from "./chunk-WEDJRTA3.mjs";
3
+ } from "./chunk-JIFD4TSN.mjs";
4
4
  import {
5
5
  omitProtectedBodyFields
6
6
  } from "./chunk-GJAMWZNZ.mjs";
@@ -531,6 +531,9 @@ var listPlansItemDisplaySchema = z6.object({
531
531
  primaryText: z6.string(),
532
532
  secondaryText: z6.union([z6.string(), z6.undefined()]).optional()
533
533
  });
534
+ var listPlansConfigSchema = z6.object({
535
+ ignorePastDue: z6.boolean()
536
+ });
534
537
  var listPlansParamsOutboundSchema = z6.object({
535
538
  customer_id: z6.union([z6.string(), z6.undefined()]).optional(),
536
539
  entity_id: z6.union([z6.string(), z6.undefined()]).optional(),
@@ -619,6 +622,7 @@ var listPlansListSchema = z6.object({
619
622
  env: listPlansEnvSchema,
620
623
  archived: z6.boolean(),
621
624
  baseVariantId: z6.string().nullable(),
625
+ config: listPlansConfigSchema,
622
626
  customerEligibility: z6.union([listPlansCustomerEligibilitySchema, z6.undefined()]).optional()
623
627
  });
624
628
  var listPlansResponseSchema = z6.object({
@@ -1625,6 +1629,10 @@ var previewUpdateInvoiceModeSchema = z11.object({
1625
1629
  enablePlanImmediately: z11.union([z11.boolean(), z11.undefined()]).optional(),
1626
1630
  finalize: z11.union([z11.boolean(), z11.undefined()]).optional()
1627
1631
  });
1632
+ var previewUpdateAttachDiscountSchema = z11.object({
1633
+ rewardId: z11.union([z11.string(), z11.undefined()]).optional(),
1634
+ promotionCode: z11.union([z11.string(), z11.undefined()]).optional()
1635
+ });
1628
1636
  var previewUpdateRecalculateBalancesSchema = z11.object({
1629
1637
  enabled: z11.boolean()
1630
1638
  });
@@ -1759,6 +1767,10 @@ var previewUpdateInvoiceModeOutboundSchema = z11.object({
1759
1767
  enable_plan_immediately: z11.boolean(),
1760
1768
  finalize: z11.boolean()
1761
1769
  });
1770
+ var previewUpdateAttachDiscountOutboundSchema = z11.object({
1771
+ reward_id: z11.union([z11.string(), z11.undefined()]).optional(),
1772
+ promotion_code: z11.union([z11.string(), z11.undefined()]).optional()
1773
+ });
1762
1774
  var previewUpdateRecalculateBalancesOutboundSchema = z11.object({
1763
1775
  enabled: z11.boolean()
1764
1776
  });
@@ -1776,6 +1788,7 @@ var previewUpdateParamsOutboundSchema = z11.object({
1776
1788
  proration_behavior: z11.union([z11.string(), z11.undefined()]).optional(),
1777
1789
  redirect_mode: z11.string(),
1778
1790
  subscription_id: z11.union([z11.string(), z11.undefined()]).optional(),
1791
+ discounts: z11.union([z11.array(previewUpdateAttachDiscountOutboundSchema), z11.undefined()]).optional(),
1779
1792
  cancel_action: z11.union([z11.string(), z11.undefined()]).optional(),
1780
1793
  billing_cycle_anchor: z11.union([z11.literal("now"), z11.undefined()]).optional(),
1781
1794
  no_billing_changes: z11.union([z11.boolean(), z11.undefined()]).optional(),
@@ -1855,6 +1868,7 @@ var previewUpdateParamsSchema = z11.object({
1855
1868
  prorationBehavior: z11.union([previewUpdateProrationBehaviorSchema, z11.undefined()]).optional(),
1856
1869
  redirectMode: z11.union([previewUpdateRedirectModeSchema, z11.undefined()]).optional(),
1857
1870
  subscriptionId: z11.union([z11.string(), z11.undefined()]).optional(),
1871
+ discounts: z11.union([z11.array(previewUpdateAttachDiscountSchema), z11.undefined()]).optional(),
1858
1872
  cancelAction: z11.union([previewUpdateCancelActionSchema, z11.undefined()]).optional(),
1859
1873
  billingCycleAnchor: z11.union([z11.literal("now"), z11.undefined()]).optional(),
1860
1874
  noBillingChanges: z11.union([z11.boolean(), z11.undefined()]).optional(),
@@ -2142,6 +2156,10 @@ var billingUpdateInvoiceModeSchema = z14.object({
2142
2156
  enablePlanImmediately: z14.union([z14.boolean(), z14.undefined()]).optional(),
2143
2157
  finalize: z14.union([z14.boolean(), z14.undefined()]).optional()
2144
2158
  });
2159
+ var billingUpdateAttachDiscountSchema = z14.object({
2160
+ rewardId: z14.union([z14.string(), z14.undefined()]).optional(),
2161
+ promotionCode: z14.union([z14.string(), z14.undefined()]).optional()
2162
+ });
2145
2163
  var billingUpdateRecalculateBalancesSchema = z14.object({
2146
2164
  enabled: z14.boolean()
2147
2165
  });
@@ -2216,6 +2234,10 @@ var billingUpdateInvoiceModeOutboundSchema = z14.object({
2216
2234
  enable_plan_immediately: z14.boolean(),
2217
2235
  finalize: z14.boolean()
2218
2236
  });
2237
+ var billingUpdateAttachDiscountOutboundSchema = z14.object({
2238
+ reward_id: z14.union([z14.string(), z14.undefined()]).optional(),
2239
+ promotion_code: z14.union([z14.string(), z14.undefined()]).optional()
2240
+ });
2219
2241
  var billingUpdateRecalculateBalancesOutboundSchema = z14.object({
2220
2242
  enabled: z14.boolean()
2221
2243
  });
@@ -2230,6 +2252,7 @@ var updateSubscriptionParamsOutboundSchema = z14.object({
2230
2252
  proration_behavior: z14.union([z14.string(), z14.undefined()]).optional(),
2231
2253
  redirect_mode: z14.string(),
2232
2254
  subscription_id: z14.union([z14.string(), z14.undefined()]).optional(),
2255
+ discounts: z14.union([z14.array(billingUpdateAttachDiscountOutboundSchema), z14.undefined()]).optional(),
2233
2256
  cancel_action: z14.union([z14.string(), z14.undefined()]).optional(),
2234
2257
  billing_cycle_anchor: z14.union([z14.literal("now"), z14.undefined()]).optional(),
2235
2258
  no_billing_changes: z14.union([z14.boolean(), z14.undefined()]).optional(),
@@ -2308,6 +2331,7 @@ var updateSubscriptionParamsSchema = z14.object({
2308
2331
  prorationBehavior: z14.union([billingUpdateProrationBehaviorSchema, z14.undefined()]).optional(),
2309
2332
  redirectMode: z14.union([billingUpdateRedirectModeSchema, z14.undefined()]).optional(),
2310
2333
  subscriptionId: z14.union([z14.string(), z14.undefined()]).optional(),
2334
+ discounts: z14.union([z14.array(billingUpdateAttachDiscountSchema), z14.undefined()]).optional(),
2311
2335
  cancelAction: z14.union([billingUpdateCancelActionSchema, z14.undefined()]).optional(),
2312
2336
  billingCycleAnchor: z14.union([z14.literal("now"), z14.undefined()]).optional(),
2313
2337
  noBillingChanges: z14.union([z14.boolean(), z14.undefined()]).optional(),