autumn-js 1.2.45 → 1.2.46
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/dist/backend/adapters/express.js +109 -23
- package/dist/backend/adapters/express.mjs +9 -9
- package/dist/backend/adapters/fetch.js +109 -23
- package/dist/backend/adapters/fetch.mjs +9 -9
- package/dist/backend/adapters/hono.js +109 -23
- package/dist/backend/adapters/hono.mjs +9 -9
- package/dist/backend/adapters/index.js +109 -23
- package/dist/backend/adapters/index.mjs +12 -12
- package/dist/backend/adapters/next.js +109 -23
- package/dist/backend/adapters/next.mjs +9 -9
- package/dist/backend/{chunk-L7N6FVEE.mjs → chunk-564D2O3W.mjs} +1 -1
- package/dist/backend/{chunk-DY6WMOCT.mjs → chunk-KW47VZ73.mjs} +5 -5
- package/dist/backend/{chunk-PVDDMLWT.mjs → chunk-RPUV2OZA.mjs} +91 -19
- package/dist/backend/{chunk-5DLBV5WP.mjs → chunk-SBZEXVB4.mjs} +7 -7
- package/dist/backend/{chunk-67LHAREL.mjs → chunk-TEDQUFQV.mjs} +1 -1
- package/dist/backend/{chunk-YKRFY5TK.mjs → chunk-UJS4Q7J4.mjs} +18 -4
- package/dist/backend/{chunk-P2TFPTAM.mjs → chunk-WR6ZPCQG.mjs} +1 -1
- package/dist/backend/{chunk-J2VZ3UZS.mjs → chunk-XOAX5KAL.mjs} +1 -1
- package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
- package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
- package/dist/backend/core/handlers/coreHandler.js +109 -23
- package/dist/backend/core/handlers/coreHandler.mjs +7 -7
- package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
- package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
- package/dist/backend/core/handlers/executeRoute.mjs +4 -4
- package/dist/backend/core/handlers/handleRouteByName.js +109 -23
- package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
- package/dist/backend/core/handlers/index.d.mts +1 -1
- package/dist/backend/core/handlers/index.d.ts +1 -1
- package/dist/backend/core/handlers/index.js +109 -23
- package/dist/backend/core/handlers/index.mjs +10 -10
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +109 -23
- package/dist/backend/core/index.mjs +10 -10
- package/dist/backend/core/routes/index.d.mts +1 -1
- package/dist/backend/core/routes/index.d.ts +1 -1
- package/dist/backend/core/routes/index.js +18 -4
- package/dist/backend/core/routes/index.mjs +2 -2
- package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
- package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.js +18 -4
- package/dist/backend/core/routes/routeConfigs.mjs +2 -2
- package/dist/backend/core/types/handlerTypes.d.mts +1 -1
- package/dist/backend/core/types/handlerTypes.d.ts +1 -1
- package/dist/backend/core/types/index.d.mts +1 -1
- package/dist/backend/core/types/index.d.ts +1 -1
- package/dist/backend/core/types/routeTypes.d.mts +1 -1
- package/dist/backend/core/types/routeTypes.d.ts +1 -1
- package/dist/backend/core/utils/index.mjs +3 -3
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +109 -23
- package/dist/backend/index.mjs +10 -10
- package/dist/backend/{routeTypes-UN48tvoc.d.mts → routeTypes-DnUY8ksp.d.mts} +121 -8
- package/dist/backend/{routeTypes-COLvwrcx.d.ts → routeTypes-TbN5QHEp.d.ts} +121 -8
- package/dist/better-auth/{chunk-MOCG3CBD.mjs → chunk-SABPXZTZ.mjs} +92 -20
- package/dist/better-auth/{chunk-3LKXO3EE.mjs → chunk-TOQRV6D7.mjs} +1 -1
- package/dist/better-auth/{chunk-J3W4EO5H.mjs → chunk-YRHQ4VL7.mjs} +18 -4
- package/dist/better-auth/index.js +109 -23
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +18 -4
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +109 -23
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +109 -23
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +1 -1
- package/dist/react/AutumnContext.d.ts +1 -1
- package/dist/react/AutumnProvider.js +1 -1
- package/dist/react/AutumnProvider.mjs +2 -2
- package/dist/react/{chunk-EE3XPYSL.mjs → chunk-2C6RX3EW.mjs} +1 -1
- package/dist/react/{chunk-SBCI4L22.mjs → chunk-2X7HXG2W.mjs} +1 -1
- package/dist/react/{chunk-7SRCZYRC.mjs → chunk-3WU4ZFXU.mjs} +1 -1
- package/dist/react/{chunk-LUBYNTYC.mjs → chunk-4HU5BGSM.mjs} +1 -1
- package/dist/react/{chunk-RTZAB46K.mjs → chunk-7RF3IGDO.mjs} +1 -1
- package/dist/react/{chunk-KCOHZSS3.mjs → chunk-C6I2RW56.mjs} +8 -8
- package/dist/react/{chunk-CQF3ER2L.mjs → chunk-NWF7OFFQ.mjs} +2 -2
- package/dist/react/{chunk-CSJHU3F2.mjs → chunk-SRSYG5ZV.mjs} +1 -1
- package/dist/react/{chunk-QUGX6XRQ.mjs → chunk-UNQZV3K5.mjs} +1 -1
- package/dist/react/client/AutumnClient.d.mts +1 -1
- package/dist/react/client/AutumnClient.d.ts +1 -1
- package/dist/react/client/IAutumnClient.d.mts +1 -1
- package/dist/react/client/IAutumnClient.d.ts +1 -1
- package/dist/react/client/index.d.mts +1 -1
- package/dist/react/client/index.d.ts +1 -1
- package/dist/react/hooks/index.d.mts +1 -1
- package/dist/react/hooks/index.d.ts +1 -1
- package/dist/react/hooks/index.js +7 -7
- package/dist/react/hooks/index.mjs +8 -8
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.js +1 -1
- package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
- package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
- package/dist/react/hooks/useAggregateEvents.js +7 -7
- package/dist/react/hooks/useAggregateEvents.mjs +2 -2
- package/dist/react/hooks/useCustomer.d.mts +1 -1
- package/dist/react/hooks/useCustomer.d.ts +1 -1
- package/dist/react/hooks/useCustomer.js +7 -7
- package/dist/react/hooks/useCustomer.mjs +3 -3
- package/dist/react/hooks/useEntity.d.mts +1 -1
- package/dist/react/hooks/useEntity.d.ts +1 -1
- package/dist/react/hooks/useEntity.js +7 -7
- package/dist/react/hooks/useEntity.mjs +2 -2
- package/dist/react/hooks/useListEvents.d.mts +1 -1
- package/dist/react/hooks/useListEvents.d.ts +1 -1
- package/dist/react/hooks/useListEvents.js +7 -7
- package/dist/react/hooks/useListEvents.mjs +2 -2
- package/dist/react/hooks/useListPlans.d.mts +1 -1
- package/dist/react/hooks/useListPlans.d.ts +1 -1
- package/dist/react/hooks/useListPlans.js +7 -7
- package/dist/react/hooks/useListPlans.mjs +2 -2
- package/dist/react/hooks/useReferrals.d.mts +1 -1
- package/dist/react/hooks/useReferrals.d.ts +1 -1
- package/dist/react/hooks/useReferrals.js +7 -7
- package/dist/react/hooks/useReferrals.mjs +2 -2
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/index.mjs +9 -9
- package/dist/react/{params-DlzWLPN2.d.mts → params-BrFcJdeO.d.mts} +50 -4
- package/dist/react/{params-ChMwkOJA.d.ts → params-BwHZca3H.d.ts} +50 -4
- package/dist/sdk/index.d.mts +151 -10
- package/dist/sdk/index.d.ts +151 -10
- package/dist/sdk/index.js +110 -21
- package/dist/sdk/index.mjs +99 -20
- package/package.json +1 -1
- package/dist/backend/{chunk-IXUCY7AU.mjs → chunk-MOHYGUMA.mjs} +3 -3
package/dist/backend/index.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./chunk-WYDGEDEU.mjs";
|
|
2
2
|
import "./chunk-VXND2UDT.mjs";
|
|
3
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-KW47VZ73.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createCoreHandler
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SBZEXVB4.mjs";
|
|
7
|
+
import "./chunk-RPUV2OZA.mjs";
|
|
8
|
+
import "./chunk-MOHYGUMA.mjs";
|
|
9
|
+
import "./chunk-TBQ27LIK.mjs";
|
|
10
|
+
import "./chunk-J44WR3QZ.mjs";
|
|
7
11
|
import "./chunk-TSF4YCUO.mjs";
|
|
8
12
|
import {
|
|
9
13
|
buildRouter
|
|
10
14
|
} from "./chunk-UAR3TMWI.mjs";
|
|
11
|
-
import "./chunk-PVDDMLWT.mjs";
|
|
12
15
|
import {
|
|
13
16
|
routeConfigs
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-IXUCY7AU.mjs";
|
|
17
|
+
} from "./chunk-UJS4Q7J4.mjs";
|
|
16
18
|
import "./chunk-OTXV5FY7.mjs";
|
|
17
|
-
import {
|
|
18
|
-
sanitizeBody
|
|
19
|
-
} from "./chunk-I7CD6EB6.mjs";
|
|
20
19
|
import {
|
|
21
20
|
secretKeyCheck
|
|
22
21
|
} from "./chunk-VZIMT7AO.mjs";
|
|
23
|
-
import
|
|
24
|
-
|
|
22
|
+
import {
|
|
23
|
+
sanitizeBody
|
|
24
|
+
} from "./chunk-I7CD6EB6.mjs";
|
|
25
25
|
import {
|
|
26
26
|
backendError,
|
|
27
27
|
backendSuccess,
|
|
@@ -10012,6 +10012,50 @@ type CreateReferralCodeResponse = {
|
|
|
10012
10012
|
createdAt: number;
|
|
10013
10013
|
};
|
|
10014
10014
|
|
|
10015
|
+
/**
|
|
10016
|
+
* Unit of time for the trial ('day', 'month', 'year').
|
|
10017
|
+
*/
|
|
10018
|
+
declare const CreateScheduleFreeTrialDurationType: {
|
|
10019
|
+
readonly Day: "day";
|
|
10020
|
+
readonly Month: "month";
|
|
10021
|
+
readonly Year: "year";
|
|
10022
|
+
};
|
|
10023
|
+
/**
|
|
10024
|
+
* Unit of time for the trial ('day', 'month', 'year').
|
|
10025
|
+
*/
|
|
10026
|
+
type CreateScheduleFreeTrialDurationType = ClosedEnum<typeof CreateScheduleFreeTrialDurationType>;
|
|
10027
|
+
/**
|
|
10028
|
+
* Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
|
|
10029
|
+
*/
|
|
10030
|
+
declare const CreateScheduleOnEnd: {
|
|
10031
|
+
readonly Bill: "bill";
|
|
10032
|
+
readonly Revert: "revert";
|
|
10033
|
+
};
|
|
10034
|
+
/**
|
|
10035
|
+
* Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
|
|
10036
|
+
*/
|
|
10037
|
+
type CreateScheduleOnEnd = ClosedEnum<typeof CreateScheduleOnEnd>;
|
|
10038
|
+
/**
|
|
10039
|
+
* Free trial configuration for a plan.
|
|
10040
|
+
*/
|
|
10041
|
+
type CreateScheduleFreeTrialParams = {
|
|
10042
|
+
/**
|
|
10043
|
+
* Number of duration_type periods the trial lasts.
|
|
10044
|
+
*/
|
|
10045
|
+
durationLength: number;
|
|
10046
|
+
/**
|
|
10047
|
+
* Unit of time for the trial ('day', 'month', 'year').
|
|
10048
|
+
*/
|
|
10049
|
+
durationType?: CreateScheduleFreeTrialDurationType | undefined;
|
|
10050
|
+
/**
|
|
10051
|
+
* If true, payment method required to start trial. Customer is charged after trial ends.
|
|
10052
|
+
*/
|
|
10053
|
+
cardRequired?: boolean | undefined;
|
|
10054
|
+
/**
|
|
10055
|
+
* Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
|
|
10056
|
+
*/
|
|
10057
|
+
onEnd?: CreateScheduleOnEnd | undefined;
|
|
10058
|
+
};
|
|
10015
10059
|
/**
|
|
10016
10060
|
* Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
|
|
10017
10061
|
*/
|
|
@@ -10076,14 +10120,14 @@ type CreateScheduleBillingBehavior = ClosedEnum<typeof CreateScheduleBillingBeha
|
|
|
10076
10120
|
/**
|
|
10077
10121
|
* The duration unit to offset this phase from the prior phase.
|
|
10078
10122
|
*/
|
|
10079
|
-
declare const
|
|
10123
|
+
declare const PhaseStartDurationType: {
|
|
10080
10124
|
readonly Month: "month";
|
|
10081
10125
|
readonly Year: "year";
|
|
10082
10126
|
};
|
|
10083
10127
|
/**
|
|
10084
10128
|
* The duration unit to offset this phase from the prior phase.
|
|
10085
10129
|
*/
|
|
10086
|
-
type
|
|
10130
|
+
type PhaseStartDurationType = ClosedEnum<typeof PhaseStartDurationType>;
|
|
10087
10131
|
/**
|
|
10088
10132
|
* Relative start offset from the previous resolved schedule phase.
|
|
10089
10133
|
*/
|
|
@@ -10091,7 +10135,7 @@ type StartingAfter2 = {
|
|
|
10091
10135
|
/**
|
|
10092
10136
|
* The duration unit to offset this phase from the prior phase.
|
|
10093
10137
|
*/
|
|
10094
|
-
durationType:
|
|
10138
|
+
durationType: PhaseStartDurationType;
|
|
10095
10139
|
/**
|
|
10096
10140
|
* How many duration_type periods after the prior phase to start.
|
|
10097
10141
|
*/
|
|
@@ -10887,6 +10931,10 @@ type CreateSchedulePlan2 = {
|
|
|
10887
10931
|
* The ID of the plan to schedule in this phase.
|
|
10888
10932
|
*/
|
|
10889
10933
|
planId: string;
|
|
10934
|
+
/**
|
|
10935
|
+
* The immediate plan scope. Omit to inherit the request entity, pass null for customer-level, or pass an entity ID.
|
|
10936
|
+
*/
|
|
10937
|
+
entityId?: string | null | undefined;
|
|
10890
10938
|
/**
|
|
10891
10939
|
* Optional prepaid feature quantities for this phase's plan.
|
|
10892
10940
|
*/
|
|
@@ -10941,6 +10989,14 @@ type CreateScheduleParams = {
|
|
|
10941
10989
|
* Optional entity ID for an entity-scoped schedule.
|
|
10942
10990
|
*/
|
|
10943
10991
|
entityId?: string | undefined;
|
|
10992
|
+
/**
|
|
10993
|
+
* Free trial configuration applied to every plan in the immediate phase.
|
|
10994
|
+
*/
|
|
10995
|
+
freeTrial?: CreateScheduleFreeTrialParams | null | undefined;
|
|
10996
|
+
/**
|
|
10997
|
+
* Currency used to bill the immediate phase.
|
|
10998
|
+
*/
|
|
10999
|
+
currency?: string | undefined;
|
|
10944
11000
|
/**
|
|
10945
11001
|
* Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
|
|
10946
11002
|
*/
|
|
@@ -10975,6 +11031,10 @@ type CreateScheduleParams = {
|
|
|
10975
11031
|
* If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed.
|
|
10976
11032
|
*/
|
|
10977
11033
|
enablePlanImmediately?: boolean | undefined;
|
|
11034
|
+
/**
|
|
11035
|
+
* If true, active recurring add-ons in scopes represented by the phase plans are retained.
|
|
11036
|
+
*/
|
|
11037
|
+
preserveAddOns?: boolean | undefined;
|
|
10978
11038
|
/**
|
|
10979
11039
|
* Ordered phase definitions for the schedule.
|
|
10980
11040
|
*/
|
|
@@ -19217,7 +19277,7 @@ type MultiAttachPlanItem = {
|
|
|
19217
19277
|
rollover?: MultiAttachRollover | undefined;
|
|
19218
19278
|
};
|
|
19219
19279
|
/**
|
|
19220
|
-
* Customize the plan to attach. Can override
|
|
19280
|
+
* Customize the plan to attach. Can override its price or items.
|
|
19221
19281
|
*/
|
|
19222
19282
|
type MultiAttachCustomize = {
|
|
19223
19283
|
/**
|
|
@@ -19252,7 +19312,7 @@ type MultiAttachPlan = {
|
|
|
19252
19312
|
*/
|
|
19253
19313
|
planId: string;
|
|
19254
19314
|
/**
|
|
19255
|
-
* Customize the plan to attach. Can override
|
|
19315
|
+
* Customize the plan to attach. Can override its price or items.
|
|
19256
19316
|
*/
|
|
19257
19317
|
customize?: MultiAttachCustomize | undefined;
|
|
19258
19318
|
/**
|
|
@@ -19267,6 +19327,10 @@ type MultiAttachPlan = {
|
|
|
19267
19327
|
* A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
|
|
19268
19328
|
*/
|
|
19269
19329
|
subscriptionId?: string | undefined;
|
|
19330
|
+
/**
|
|
19331
|
+
* The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
|
|
19332
|
+
*/
|
|
19333
|
+
entityId?: string | null | undefined;
|
|
19270
19334
|
};
|
|
19271
19335
|
/**
|
|
19272
19336
|
* Unit of time for the trial ('day', 'month', 'year').
|
|
@@ -19350,6 +19414,17 @@ type MultiAttachAttachDiscount = {
|
|
|
19350
19414
|
*/
|
|
19351
19415
|
promotionCode?: string | undefined;
|
|
19352
19416
|
};
|
|
19417
|
+
/**
|
|
19418
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
19419
|
+
*/
|
|
19420
|
+
declare const MultiAttachBillingBehavior: {
|
|
19421
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
19422
|
+
readonly None: "none";
|
|
19423
|
+
};
|
|
19424
|
+
/**
|
|
19425
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
19426
|
+
*/
|
|
19427
|
+
type MultiAttachBillingBehavior = ClosedEnum<typeof MultiAttachBillingBehavior>;
|
|
19353
19428
|
/**
|
|
19354
19429
|
* 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.
|
|
19355
19430
|
*/
|
|
@@ -19535,6 +19610,10 @@ type MultiAttachParams = {
|
|
|
19535
19610
|
* Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
|
|
19536
19611
|
*/
|
|
19537
19612
|
freeTrial?: MultiAttachFreeTrialParams | null | undefined;
|
|
19613
|
+
/**
|
|
19614
|
+
* Unix timestamp in milliseconds for backdating every plan in this multi-attach.
|
|
19615
|
+
*/
|
|
19616
|
+
startsAt?: number | undefined;
|
|
19538
19617
|
/**
|
|
19539
19618
|
* Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
|
|
19540
19619
|
*/
|
|
@@ -19547,6 +19626,10 @@ type MultiAttachParams = {
|
|
|
19547
19626
|
* List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
|
|
19548
19627
|
*/
|
|
19549
19628
|
discounts?: Array<MultiAttachAttachDiscount> | undefined;
|
|
19629
|
+
/**
|
|
19630
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
19631
|
+
*/
|
|
19632
|
+
billingBehavior?: MultiAttachBillingBehavior | undefined;
|
|
19550
19633
|
/**
|
|
19551
19634
|
* URL to redirect to after successful checkout.
|
|
19552
19635
|
*/
|
|
@@ -21905,7 +21988,7 @@ type PreviewMultiAttachPlanItem = {
|
|
|
21905
21988
|
rollover?: PreviewMultiAttachRollover | undefined;
|
|
21906
21989
|
};
|
|
21907
21990
|
/**
|
|
21908
|
-
* Customize the plan to attach. Can override
|
|
21991
|
+
* Customize the plan to attach. Can override its price or items.
|
|
21909
21992
|
*/
|
|
21910
21993
|
type PreviewMultiAttachCustomize = {
|
|
21911
21994
|
/**
|
|
@@ -21940,7 +22023,7 @@ type PreviewMultiAttachPlan = {
|
|
|
21940
22023
|
*/
|
|
21941
22024
|
planId: string;
|
|
21942
22025
|
/**
|
|
21943
|
-
* Customize the plan to attach. Can override
|
|
22026
|
+
* Customize the plan to attach. Can override its price or items.
|
|
21944
22027
|
*/
|
|
21945
22028
|
customize?: PreviewMultiAttachCustomize | undefined;
|
|
21946
22029
|
/**
|
|
@@ -21955,6 +22038,10 @@ type PreviewMultiAttachPlan = {
|
|
|
21955
22038
|
* A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
|
|
21956
22039
|
*/
|
|
21957
22040
|
subscriptionId?: string | undefined;
|
|
22041
|
+
/**
|
|
22042
|
+
* The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
|
|
22043
|
+
*/
|
|
22044
|
+
entityId?: string | null | undefined;
|
|
21958
22045
|
};
|
|
21959
22046
|
/**
|
|
21960
22047
|
* Unit of time for the trial ('day', 'month', 'year').
|
|
@@ -22038,6 +22125,17 @@ type PreviewMultiAttachAttachDiscount = {
|
|
|
22038
22125
|
*/
|
|
22039
22126
|
promotionCode?: string | undefined;
|
|
22040
22127
|
};
|
|
22128
|
+
/**
|
|
22129
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
22130
|
+
*/
|
|
22131
|
+
declare const PreviewMultiAttachBillingBehavior: {
|
|
22132
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
22133
|
+
readonly None: "none";
|
|
22134
|
+
};
|
|
22135
|
+
/**
|
|
22136
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
22137
|
+
*/
|
|
22138
|
+
type PreviewMultiAttachBillingBehavior = ClosedEnum<typeof PreviewMultiAttachBillingBehavior>;
|
|
22041
22139
|
/**
|
|
22042
22140
|
* 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.
|
|
22043
22141
|
*/
|
|
@@ -22223,6 +22321,10 @@ type PreviewMultiAttachParams = {
|
|
|
22223
22321
|
* Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
|
|
22224
22322
|
*/
|
|
22225
22323
|
freeTrial?: PreviewMultiAttachFreeTrialParams | null | undefined;
|
|
22324
|
+
/**
|
|
22325
|
+
* Unix timestamp in milliseconds for backdating every plan in this multi-attach.
|
|
22326
|
+
*/
|
|
22327
|
+
startsAt?: number | undefined;
|
|
22226
22328
|
/**
|
|
22227
22329
|
* Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
|
|
22228
22330
|
*/
|
|
@@ -22235,6 +22337,10 @@ type PreviewMultiAttachParams = {
|
|
|
22235
22337
|
* List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
|
|
22236
22338
|
*/
|
|
22237
22339
|
discounts?: Array<PreviewMultiAttachAttachDiscount> | undefined;
|
|
22340
|
+
/**
|
|
22341
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
22342
|
+
*/
|
|
22343
|
+
billingBehavior?: PreviewMultiAttachBillingBehavior | undefined;
|
|
22238
22344
|
/**
|
|
22239
22345
|
* URL to redirect to after successful checkout.
|
|
22240
22346
|
*/
|
|
@@ -31969,11 +32075,13 @@ declare class Billing extends ClientSDK {
|
|
|
31969
32075
|
* @example
|
|
31970
32076
|
* ```typescript
|
|
31971
32077
|
* // Schedule a transition from a trial plan to a paid plan
|
|
31972
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
32078
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
|
|
31973
32079
|
* ```
|
|
31974
32080
|
*
|
|
31975
32081
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
31976
32082
|
* @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
|
|
32083
|
+
* @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
|
|
32084
|
+
* @param currency - Currency used to bill the immediate phase. (optional)
|
|
31977
32085
|
* @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
|
|
31978
32086
|
* @param discounts - List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
31979
32087
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
@@ -31982,6 +32090,7 @@ declare class Billing extends ClientSDK {
|
|
|
31982
32090
|
* @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
|
|
31983
32091
|
* @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
|
|
31984
32092
|
* @param enablePlanImmediately - If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed. (optional)
|
|
32093
|
+
* @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
|
|
31985
32094
|
* @param phases - Ordered phase definitions for the schedule.
|
|
31986
32095
|
*
|
|
31987
32096
|
* @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
|
|
@@ -32014,9 +32123,11 @@ declare class Billing extends ClientSDK {
|
|
|
32014
32123
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
32015
32124
|
* @param plans - The list of plans to attach to the customer.
|
|
32016
32125
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
32126
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
32017
32127
|
* @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
|
|
32018
32128
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
32019
32129
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
32130
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
32020
32131
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
32021
32132
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
32022
32133
|
* @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)
|
|
@@ -32085,9 +32196,11 @@ declare class Billing extends ClientSDK {
|
|
|
32085
32196
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
32086
32197
|
* @param plans - The list of plans to attach to the customer.
|
|
32087
32198
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
32199
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
32088
32200
|
* @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
|
|
32089
32201
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
32090
32202
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
32203
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
32091
32204
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
32092
32205
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
32093
32206
|
* @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)
|
|
@@ -10012,6 +10012,50 @@ type CreateReferralCodeResponse = {
|
|
|
10012
10012
|
createdAt: number;
|
|
10013
10013
|
};
|
|
10014
10014
|
|
|
10015
|
+
/**
|
|
10016
|
+
* Unit of time for the trial ('day', 'month', 'year').
|
|
10017
|
+
*/
|
|
10018
|
+
declare const CreateScheduleFreeTrialDurationType: {
|
|
10019
|
+
readonly Day: "day";
|
|
10020
|
+
readonly Month: "month";
|
|
10021
|
+
readonly Year: "year";
|
|
10022
|
+
};
|
|
10023
|
+
/**
|
|
10024
|
+
* Unit of time for the trial ('day', 'month', 'year').
|
|
10025
|
+
*/
|
|
10026
|
+
type CreateScheduleFreeTrialDurationType = ClosedEnum<typeof CreateScheduleFreeTrialDurationType>;
|
|
10027
|
+
/**
|
|
10028
|
+
* Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
|
|
10029
|
+
*/
|
|
10030
|
+
declare const CreateScheduleOnEnd: {
|
|
10031
|
+
readonly Bill: "bill";
|
|
10032
|
+
readonly Revert: "revert";
|
|
10033
|
+
};
|
|
10034
|
+
/**
|
|
10035
|
+
* Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
|
|
10036
|
+
*/
|
|
10037
|
+
type CreateScheduleOnEnd = ClosedEnum<typeof CreateScheduleOnEnd>;
|
|
10038
|
+
/**
|
|
10039
|
+
* Free trial configuration for a plan.
|
|
10040
|
+
*/
|
|
10041
|
+
type CreateScheduleFreeTrialParams = {
|
|
10042
|
+
/**
|
|
10043
|
+
* Number of duration_type periods the trial lasts.
|
|
10044
|
+
*/
|
|
10045
|
+
durationLength: number;
|
|
10046
|
+
/**
|
|
10047
|
+
* Unit of time for the trial ('day', 'month', 'year').
|
|
10048
|
+
*/
|
|
10049
|
+
durationType?: CreateScheduleFreeTrialDurationType | undefined;
|
|
10050
|
+
/**
|
|
10051
|
+
* If true, payment method required to start trial. Customer is charged after trial ends.
|
|
10052
|
+
*/
|
|
10053
|
+
cardRequired?: boolean | undefined;
|
|
10054
|
+
/**
|
|
10055
|
+
* Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
|
|
10056
|
+
*/
|
|
10057
|
+
onEnd?: CreateScheduleOnEnd | undefined;
|
|
10058
|
+
};
|
|
10015
10059
|
/**
|
|
10016
10060
|
* Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
|
|
10017
10061
|
*/
|
|
@@ -10076,14 +10120,14 @@ type CreateScheduleBillingBehavior = ClosedEnum<typeof CreateScheduleBillingBeha
|
|
|
10076
10120
|
/**
|
|
10077
10121
|
* The duration unit to offset this phase from the prior phase.
|
|
10078
10122
|
*/
|
|
10079
|
-
declare const
|
|
10123
|
+
declare const PhaseStartDurationType: {
|
|
10080
10124
|
readonly Month: "month";
|
|
10081
10125
|
readonly Year: "year";
|
|
10082
10126
|
};
|
|
10083
10127
|
/**
|
|
10084
10128
|
* The duration unit to offset this phase from the prior phase.
|
|
10085
10129
|
*/
|
|
10086
|
-
type
|
|
10130
|
+
type PhaseStartDurationType = ClosedEnum<typeof PhaseStartDurationType>;
|
|
10087
10131
|
/**
|
|
10088
10132
|
* Relative start offset from the previous resolved schedule phase.
|
|
10089
10133
|
*/
|
|
@@ -10091,7 +10135,7 @@ type StartingAfter2 = {
|
|
|
10091
10135
|
/**
|
|
10092
10136
|
* The duration unit to offset this phase from the prior phase.
|
|
10093
10137
|
*/
|
|
10094
|
-
durationType:
|
|
10138
|
+
durationType: PhaseStartDurationType;
|
|
10095
10139
|
/**
|
|
10096
10140
|
* How many duration_type periods after the prior phase to start.
|
|
10097
10141
|
*/
|
|
@@ -10887,6 +10931,10 @@ type CreateSchedulePlan2 = {
|
|
|
10887
10931
|
* The ID of the plan to schedule in this phase.
|
|
10888
10932
|
*/
|
|
10889
10933
|
planId: string;
|
|
10934
|
+
/**
|
|
10935
|
+
* The immediate plan scope. Omit to inherit the request entity, pass null for customer-level, or pass an entity ID.
|
|
10936
|
+
*/
|
|
10937
|
+
entityId?: string | null | undefined;
|
|
10890
10938
|
/**
|
|
10891
10939
|
* Optional prepaid feature quantities for this phase's plan.
|
|
10892
10940
|
*/
|
|
@@ -10941,6 +10989,14 @@ type CreateScheduleParams = {
|
|
|
10941
10989
|
* Optional entity ID for an entity-scoped schedule.
|
|
10942
10990
|
*/
|
|
10943
10991
|
entityId?: string | undefined;
|
|
10992
|
+
/**
|
|
10993
|
+
* Free trial configuration applied to every plan in the immediate phase.
|
|
10994
|
+
*/
|
|
10995
|
+
freeTrial?: CreateScheduleFreeTrialParams | null | undefined;
|
|
10996
|
+
/**
|
|
10997
|
+
* Currency used to bill the immediate phase.
|
|
10998
|
+
*/
|
|
10999
|
+
currency?: string | undefined;
|
|
10944
11000
|
/**
|
|
10945
11001
|
* Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
|
|
10946
11002
|
*/
|
|
@@ -10975,6 +11031,10 @@ type CreateScheduleParams = {
|
|
|
10975
11031
|
* If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed.
|
|
10976
11032
|
*/
|
|
10977
11033
|
enablePlanImmediately?: boolean | undefined;
|
|
11034
|
+
/**
|
|
11035
|
+
* If true, active recurring add-ons in scopes represented by the phase plans are retained.
|
|
11036
|
+
*/
|
|
11037
|
+
preserveAddOns?: boolean | undefined;
|
|
10978
11038
|
/**
|
|
10979
11039
|
* Ordered phase definitions for the schedule.
|
|
10980
11040
|
*/
|
|
@@ -19217,7 +19277,7 @@ type MultiAttachPlanItem = {
|
|
|
19217
19277
|
rollover?: MultiAttachRollover | undefined;
|
|
19218
19278
|
};
|
|
19219
19279
|
/**
|
|
19220
|
-
* Customize the plan to attach. Can override
|
|
19280
|
+
* Customize the plan to attach. Can override its price or items.
|
|
19221
19281
|
*/
|
|
19222
19282
|
type MultiAttachCustomize = {
|
|
19223
19283
|
/**
|
|
@@ -19252,7 +19312,7 @@ type MultiAttachPlan = {
|
|
|
19252
19312
|
*/
|
|
19253
19313
|
planId: string;
|
|
19254
19314
|
/**
|
|
19255
|
-
* Customize the plan to attach. Can override
|
|
19315
|
+
* Customize the plan to attach. Can override its price or items.
|
|
19256
19316
|
*/
|
|
19257
19317
|
customize?: MultiAttachCustomize | undefined;
|
|
19258
19318
|
/**
|
|
@@ -19267,6 +19327,10 @@ type MultiAttachPlan = {
|
|
|
19267
19327
|
* A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
|
|
19268
19328
|
*/
|
|
19269
19329
|
subscriptionId?: string | undefined;
|
|
19330
|
+
/**
|
|
19331
|
+
* The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
|
|
19332
|
+
*/
|
|
19333
|
+
entityId?: string | null | undefined;
|
|
19270
19334
|
};
|
|
19271
19335
|
/**
|
|
19272
19336
|
* Unit of time for the trial ('day', 'month', 'year').
|
|
@@ -19350,6 +19414,17 @@ type MultiAttachAttachDiscount = {
|
|
|
19350
19414
|
*/
|
|
19351
19415
|
promotionCode?: string | undefined;
|
|
19352
19416
|
};
|
|
19417
|
+
/**
|
|
19418
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
19419
|
+
*/
|
|
19420
|
+
declare const MultiAttachBillingBehavior: {
|
|
19421
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
19422
|
+
readonly None: "none";
|
|
19423
|
+
};
|
|
19424
|
+
/**
|
|
19425
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
19426
|
+
*/
|
|
19427
|
+
type MultiAttachBillingBehavior = ClosedEnum<typeof MultiAttachBillingBehavior>;
|
|
19353
19428
|
/**
|
|
19354
19429
|
* 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.
|
|
19355
19430
|
*/
|
|
@@ -19535,6 +19610,10 @@ type MultiAttachParams = {
|
|
|
19535
19610
|
* Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
|
|
19536
19611
|
*/
|
|
19537
19612
|
freeTrial?: MultiAttachFreeTrialParams | null | undefined;
|
|
19613
|
+
/**
|
|
19614
|
+
* Unix timestamp in milliseconds for backdating every plan in this multi-attach.
|
|
19615
|
+
*/
|
|
19616
|
+
startsAt?: number | undefined;
|
|
19538
19617
|
/**
|
|
19539
19618
|
* Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
|
|
19540
19619
|
*/
|
|
@@ -19547,6 +19626,10 @@ type MultiAttachParams = {
|
|
|
19547
19626
|
* List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
|
|
19548
19627
|
*/
|
|
19549
19628
|
discounts?: Array<MultiAttachAttachDiscount> | undefined;
|
|
19629
|
+
/**
|
|
19630
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
19631
|
+
*/
|
|
19632
|
+
billingBehavior?: MultiAttachBillingBehavior | undefined;
|
|
19550
19633
|
/**
|
|
19551
19634
|
* URL to redirect to after successful checkout.
|
|
19552
19635
|
*/
|
|
@@ -21905,7 +21988,7 @@ type PreviewMultiAttachPlanItem = {
|
|
|
21905
21988
|
rollover?: PreviewMultiAttachRollover | undefined;
|
|
21906
21989
|
};
|
|
21907
21990
|
/**
|
|
21908
|
-
* Customize the plan to attach. Can override
|
|
21991
|
+
* Customize the plan to attach. Can override its price or items.
|
|
21909
21992
|
*/
|
|
21910
21993
|
type PreviewMultiAttachCustomize = {
|
|
21911
21994
|
/**
|
|
@@ -21940,7 +22023,7 @@ type PreviewMultiAttachPlan = {
|
|
|
21940
22023
|
*/
|
|
21941
22024
|
planId: string;
|
|
21942
22025
|
/**
|
|
21943
|
-
* Customize the plan to attach. Can override
|
|
22026
|
+
* Customize the plan to attach. Can override its price or items.
|
|
21944
22027
|
*/
|
|
21945
22028
|
customize?: PreviewMultiAttachCustomize | undefined;
|
|
21946
22029
|
/**
|
|
@@ -21955,6 +22038,10 @@ type PreviewMultiAttachPlan = {
|
|
|
21955
22038
|
* A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
|
|
21956
22039
|
*/
|
|
21957
22040
|
subscriptionId?: string | undefined;
|
|
22041
|
+
/**
|
|
22042
|
+
* The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
|
|
22043
|
+
*/
|
|
22044
|
+
entityId?: string | null | undefined;
|
|
21958
22045
|
};
|
|
21959
22046
|
/**
|
|
21960
22047
|
* Unit of time for the trial ('day', 'month', 'year').
|
|
@@ -22038,6 +22125,17 @@ type PreviewMultiAttachAttachDiscount = {
|
|
|
22038
22125
|
*/
|
|
22039
22126
|
promotionCode?: string | undefined;
|
|
22040
22127
|
};
|
|
22128
|
+
/**
|
|
22129
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
22130
|
+
*/
|
|
22131
|
+
declare const PreviewMultiAttachBillingBehavior: {
|
|
22132
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
22133
|
+
readonly None: "none";
|
|
22134
|
+
};
|
|
22135
|
+
/**
|
|
22136
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
22137
|
+
*/
|
|
22138
|
+
type PreviewMultiAttachBillingBehavior = ClosedEnum<typeof PreviewMultiAttachBillingBehavior>;
|
|
22041
22139
|
/**
|
|
22042
22140
|
* 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.
|
|
22043
22141
|
*/
|
|
@@ -22223,6 +22321,10 @@ type PreviewMultiAttachParams = {
|
|
|
22223
22321
|
* Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial.
|
|
22224
22322
|
*/
|
|
22225
22323
|
freeTrial?: PreviewMultiAttachFreeTrialParams | null | undefined;
|
|
22324
|
+
/**
|
|
22325
|
+
* Unix timestamp in milliseconds for backdating every plan in this multi-attach.
|
|
22326
|
+
*/
|
|
22327
|
+
startsAt?: number | undefined;
|
|
22226
22328
|
/**
|
|
22227
22329
|
* Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
|
|
22228
22330
|
*/
|
|
@@ -22235,6 +22337,10 @@ type PreviewMultiAttachParams = {
|
|
|
22235
22337
|
* List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
|
|
22236
22338
|
*/
|
|
22237
22339
|
discounts?: Array<PreviewMultiAttachAttachDiscount> | undefined;
|
|
22340
|
+
/**
|
|
22341
|
+
* How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
|
|
22342
|
+
*/
|
|
22343
|
+
billingBehavior?: PreviewMultiAttachBillingBehavior | undefined;
|
|
22238
22344
|
/**
|
|
22239
22345
|
* URL to redirect to after successful checkout.
|
|
22240
22346
|
*/
|
|
@@ -31969,11 +32075,13 @@ declare class Billing extends ClientSDK {
|
|
|
31969
32075
|
* @example
|
|
31970
32076
|
* ```typescript
|
|
31971
32077
|
* // Schedule a transition from a trial plan to a paid plan
|
|
31972
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
32078
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
|
|
31973
32079
|
* ```
|
|
31974
32080
|
*
|
|
31975
32081
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
31976
32082
|
* @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
|
|
32083
|
+
* @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
|
|
32084
|
+
* @param currency - Currency used to bill the immediate phase. (optional)
|
|
31977
32085
|
* @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
|
|
31978
32086
|
* @param discounts - List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
31979
32087
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
@@ -31982,6 +32090,7 @@ declare class Billing extends ClientSDK {
|
|
|
31982
32090
|
* @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
|
|
31983
32091
|
* @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
|
|
31984
32092
|
* @param enablePlanImmediately - If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed. (optional)
|
|
32093
|
+
* @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
|
|
31985
32094
|
* @param phases - Ordered phase definitions for the schedule.
|
|
31986
32095
|
*
|
|
31987
32096
|
* @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
|
|
@@ -32014,9 +32123,11 @@ declare class Billing extends ClientSDK {
|
|
|
32014
32123
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
32015
32124
|
* @param plans - The list of plans to attach to the customer.
|
|
32016
32125
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
32126
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
32017
32127
|
* @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
|
|
32018
32128
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
32019
32129
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
32130
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
32020
32131
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
32021
32132
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
32022
32133
|
* @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)
|
|
@@ -32085,9 +32196,11 @@ declare class Billing extends ClientSDK {
|
|
|
32085
32196
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
32086
32197
|
* @param plans - The list of plans to attach to the customer.
|
|
32087
32198
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
32199
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
32088
32200
|
* @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
|
|
32089
32201
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
32090
32202
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
32203
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
32091
32204
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
32092
32205
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
32093
32206
|
* @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)
|