dodopayments 2.29.1 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/bin/cli +12 -5
- package/bin/migration-config.json +66 -0
- package/client.d.mts +11 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +11 -8
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/resources/checkout-sessions.d.mts +34 -0
- package/resources/checkout-sessions.d.mts.map +1 -1
- package/resources/checkout-sessions.d.ts +34 -0
- package/resources/checkout-sessions.d.ts.map +1 -1
- package/resources/credit-entitlements/balances.d.mts +1 -1
- package/resources/credit-entitlements/balances.d.mts.map +1 -1
- package/resources/credit-entitlements/balances.d.ts +1 -1
- package/resources/credit-entitlements/balances.d.ts.map +1 -1
- package/resources/customers/customers.d.mts +29 -1
- package/resources/customers/customers.d.mts.map +1 -1
- package/resources/customers/customers.d.ts +29 -1
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +6 -0
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +6 -0
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.mts +1 -1
- package/resources/customers/index.d.mts.map +1 -1
- package/resources/customers/index.d.ts +1 -1
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/entitlements/entitlements.d.mts +228 -0
- package/resources/entitlements/entitlements.d.mts.map +1 -0
- package/resources/entitlements/entitlements.d.ts +228 -0
- package/resources/entitlements/entitlements.d.ts.map +1 -0
- package/resources/entitlements/entitlements.js +60 -0
- package/resources/entitlements/entitlements.js.map +1 -0
- package/resources/entitlements/entitlements.mjs +55 -0
- package/resources/entitlements/entitlements.mjs.map +1 -0
- package/resources/entitlements/files.d.mts +37 -0
- package/resources/entitlements/files.d.mts.map +1 -0
- package/resources/entitlements/files.d.ts +37 -0
- package/resources/entitlements/files.d.ts.map +1 -0
- package/resources/entitlements/files.js +34 -0
- package/resources/entitlements/files.js.map +1 -0
- package/resources/entitlements/files.mjs +30 -0
- package/resources/entitlements/files.mjs.map +1 -0
- package/resources/entitlements/grants.d.mts +80 -0
- package/resources/entitlements/grants.d.mts.map +1 -0
- package/resources/entitlements/grants.d.ts +80 -0
- package/resources/entitlements/grants.d.ts.map +1 -0
- package/resources/entitlements/grants.js +27 -0
- package/resources/entitlements/grants.js.map +1 -0
- package/resources/entitlements/grants.mjs +23 -0
- package/resources/entitlements/grants.mjs.map +1 -0
- package/resources/entitlements/index.d.mts +4 -0
- package/resources/entitlements/index.d.mts.map +1 -0
- package/resources/entitlements/index.d.ts +4 -0
- package/resources/entitlements/index.d.ts.map +1 -0
- package/resources/entitlements/index.js +11 -0
- package/resources/entitlements/index.js.map +1 -0
- package/resources/entitlements/index.mjs +5 -0
- package/resources/entitlements/index.mjs.map +1 -0
- package/resources/entitlements.d.mts +2 -0
- package/resources/entitlements.d.mts.map +1 -0
- package/resources/entitlements.d.ts +2 -0
- package/resources/entitlements.d.ts.map +1 -0
- package/resources/entitlements.js +6 -0
- package/resources/entitlements.js.map +1 -0
- package/resources/entitlements.mjs +3 -0
- package/resources/entitlements.mjs.map +1 -0
- package/resources/index.d.mts +5 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/license-key-instances.d.mts +4 -0
- package/resources/license-key-instances.d.mts.map +1 -1
- package/resources/license-key-instances.d.ts +4 -0
- package/resources/license-key-instances.d.ts.map +1 -1
- package/resources/payments.d.mts +26 -27
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +26 -27
- package/resources/payments.d.ts.map +1 -1
- package/resources/products/index.d.mts +1 -1
- package/resources/products/index.d.mts.map +1 -1
- package/resources/products/index.d.ts +1 -1
- package/resources/products/index.d.ts.map +1 -1
- package/resources/products/index.js.map +1 -1
- package/resources/products/index.mjs.map +1 -1
- package/resources/products/products.d.mts +90 -121
- package/resources/products/products.d.mts.map +1 -1
- package/resources/products/products.d.ts +90 -121
- package/resources/products/products.d.ts.map +1 -1
- package/resources/products/products.js.map +1 -1
- package/resources/products/products.mjs.map +1 -1
- package/resources/subscriptions.d.mts +111 -128
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +111 -128
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/webhook-events.d.mts +3 -25
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +3 -25
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-events.js.map +1 -1
- package/resources/webhook-events.mjs.map +1 -1
- package/resources/webhooks/index.d.mts +1 -1
- package/resources/webhooks/index.d.mts.map +1 -1
- package/resources/webhooks/index.d.ts +1 -1
- package/resources/webhooks/index.d.ts.map +1 -1
- package/resources/webhooks/index.js.map +1 -1
- package/resources/webhooks/index.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts +160 -3
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +160 -3
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/src/client.ts +45 -0
- package/src/internal/types.ts +6 -8
- package/src/resources/checkout-sessions.ts +38 -0
- package/src/resources/credit-entitlements/balances.ts +1 -0
- package/src/resources/customers/customers.ts +46 -0
- package/src/resources/customers/index.ts +1 -0
- package/src/resources/entitlements/entitlements.ts +384 -0
- package/src/resources/entitlements/files.ts +53 -0
- package/src/resources/entitlements/grants.ts +136 -0
- package/src/resources/entitlements/index.ts +22 -0
- package/src/resources/entitlements.ts +3 -0
- package/src/resources/index.ts +21 -0
- package/src/resources/license-key-instances.ts +5 -0
- package/src/resources/payments.ts +31 -33
- package/src/resources/products/index.ts +2 -0
- package/src/resources/products/products.ts +97 -189
- package/src/resources/subscriptions.ts +143 -151
- package/src/resources/webhook-events.ts +3 -47
- package/src/resources/webhooks/index.ts +5 -0
- package/src/resources/webhooks/webhooks.ts +212 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -182,6 +182,16 @@ export interface AttachAddon {
|
|
|
182
182
|
quantity: number;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
export type CancellationFeedback =
|
|
186
|
+
| 'too_expensive'
|
|
187
|
+
| 'missing_features'
|
|
188
|
+
| 'switched_service'
|
|
189
|
+
| 'unused'
|
|
190
|
+
| 'customer_service'
|
|
191
|
+
| 'low_quality'
|
|
192
|
+
| 'too_complex'
|
|
193
|
+
| 'other';
|
|
194
|
+
|
|
185
195
|
/**
|
|
186
196
|
* Response struct representing credit entitlement cart details for a subscription
|
|
187
197
|
*/
|
|
@@ -309,6 +319,67 @@ export interface OnDemandSubscription {
|
|
|
309
319
|
product_price?: number | null;
|
|
310
320
|
}
|
|
311
321
|
|
|
322
|
+
export interface ScheduledPlanChange {
|
|
323
|
+
/**
|
|
324
|
+
* The scheduled plan change ID
|
|
325
|
+
*/
|
|
326
|
+
id: string;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Addons included in the scheduled change
|
|
330
|
+
*/
|
|
331
|
+
addons: Array<ScheduledPlanChange.Addon>;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* When this scheduled change was created
|
|
335
|
+
*/
|
|
336
|
+
created_at: string;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* When the change will be applied
|
|
340
|
+
*/
|
|
341
|
+
effective_at: string;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* The product ID the subscription will change to
|
|
345
|
+
*/
|
|
346
|
+
product_id: string;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Quantity for the new plan
|
|
350
|
+
*/
|
|
351
|
+
quantity: number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Description of the product being changed to
|
|
355
|
+
*/
|
|
356
|
+
product_description?: string | null;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Name of the product being changed to
|
|
360
|
+
*/
|
|
361
|
+
product_name?: string | null;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export namespace ScheduledPlanChange {
|
|
365
|
+
export interface Addon {
|
|
366
|
+
/**
|
|
367
|
+
* The addon ID
|
|
368
|
+
*/
|
|
369
|
+
addon_id: string;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Name of the addon
|
|
373
|
+
*/
|
|
374
|
+
name: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Quantity of the addon
|
|
378
|
+
*/
|
|
379
|
+
quantity: number;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
312
383
|
/**
|
|
313
384
|
* Response struct representing subscription details
|
|
314
385
|
*/
|
|
@@ -435,6 +506,16 @@ export interface Subscription {
|
|
|
435
506
|
*/
|
|
436
507
|
trial_period_days: number;
|
|
437
508
|
|
|
509
|
+
/**
|
|
510
|
+
* Free-text cancellation comment, if any
|
|
511
|
+
*/
|
|
512
|
+
cancellation_comment?: string | null;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Customer-supplied churn reason, if any
|
|
516
|
+
*/
|
|
517
|
+
cancellation_feedback?: CancellationFeedback | null;
|
|
518
|
+
|
|
438
519
|
/**
|
|
439
520
|
* Cancelled timestamp if the subscription is cancelled
|
|
440
521
|
*/
|
|
@@ -468,7 +549,7 @@ export interface Subscription {
|
|
|
468
549
|
/**
|
|
469
550
|
* Scheduled plan change details, if any
|
|
470
551
|
*/
|
|
471
|
-
scheduled_change?:
|
|
552
|
+
scheduled_change?: ScheduledPlanChange | null;
|
|
472
553
|
|
|
473
554
|
/**
|
|
474
555
|
* Tax identifier provided for this subscription (if applicable)
|
|
@@ -476,72 +557,6 @@ export interface Subscription {
|
|
|
476
557
|
tax_id?: string | null;
|
|
477
558
|
}
|
|
478
559
|
|
|
479
|
-
export namespace Subscription {
|
|
480
|
-
/**
|
|
481
|
-
* Scheduled plan change details, if any
|
|
482
|
-
*/
|
|
483
|
-
export interface ScheduledChange {
|
|
484
|
-
/**
|
|
485
|
-
* The scheduled plan change ID
|
|
486
|
-
*/
|
|
487
|
-
id: string;
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Addons included in the scheduled change
|
|
491
|
-
*/
|
|
492
|
-
addons: Array<ScheduledChange.Addon>;
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* When this scheduled change was created
|
|
496
|
-
*/
|
|
497
|
-
created_at: string;
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* When the change will be applied
|
|
501
|
-
*/
|
|
502
|
-
effective_at: string;
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* The product ID the subscription will change to
|
|
506
|
-
*/
|
|
507
|
-
product_id: string;
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Quantity for the new plan
|
|
511
|
-
*/
|
|
512
|
-
quantity: number;
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Description of the product being changed to
|
|
516
|
-
*/
|
|
517
|
-
product_description?: string | null;
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Name of the product being changed to
|
|
521
|
-
*/
|
|
522
|
-
product_name?: string | null;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
export namespace ScheduledChange {
|
|
526
|
-
export interface Addon {
|
|
527
|
-
/**
|
|
528
|
-
* The addon ID
|
|
529
|
-
*/
|
|
530
|
-
addon_id: string;
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* Name of the addon
|
|
534
|
-
*/
|
|
535
|
-
name: string;
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* Quantity of the addon
|
|
539
|
-
*/
|
|
540
|
-
quantity: number;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
560
|
export type SubscriptionStatus = 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired';
|
|
546
561
|
|
|
547
562
|
export type TimeInterval = 'Day' | 'Week' | 'Month' | 'Year';
|
|
@@ -566,6 +581,12 @@ export interface UpdateSubscriptionPlanReq {
|
|
|
566
581
|
*/
|
|
567
582
|
quantity: number;
|
|
568
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Whether adaptive currency fees should be included in the price (true) or added
|
|
586
|
+
* on top (false). If not specified, uses the subscription's stored setting.
|
|
587
|
+
*/
|
|
588
|
+
adaptive_currency_fees_inclusive?: boolean | null;
|
|
589
|
+
|
|
569
590
|
/**
|
|
570
591
|
* Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
571
592
|
* addons
|
|
@@ -657,7 +678,7 @@ export interface SubscriptionCreateResponse {
|
|
|
657
678
|
/**
|
|
658
679
|
* One time products associated with the purchase of subscription
|
|
659
680
|
*/
|
|
660
|
-
one_time_product_cart?: Array<
|
|
681
|
+
one_time_product_cart?: Array<SubscriptionCreateResponse.OneTimeProductCart> | null;
|
|
661
682
|
|
|
662
683
|
/**
|
|
663
684
|
* URL to checkout page
|
|
@@ -665,6 +686,14 @@ export interface SubscriptionCreateResponse {
|
|
|
665
686
|
payment_link?: string | null;
|
|
666
687
|
}
|
|
667
688
|
|
|
689
|
+
export namespace SubscriptionCreateResponse {
|
|
690
|
+
export interface OneTimeProductCart {
|
|
691
|
+
product_id: string;
|
|
692
|
+
|
|
693
|
+
quantity: number;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
668
697
|
/**
|
|
669
698
|
* Response struct representing subscription details
|
|
670
699
|
*/
|
|
@@ -799,7 +828,7 @@ export interface SubscriptionListResponse {
|
|
|
799
828
|
/**
|
|
800
829
|
* Scheduled plan change details, if any
|
|
801
830
|
*/
|
|
802
|
-
scheduled_change?:
|
|
831
|
+
scheduled_change?: ScheduledPlanChange | null;
|
|
803
832
|
|
|
804
833
|
/**
|
|
805
834
|
* Tax identifier provided for this subscription (if applicable)
|
|
@@ -807,72 +836,6 @@ export interface SubscriptionListResponse {
|
|
|
807
836
|
tax_id?: string | null;
|
|
808
837
|
}
|
|
809
838
|
|
|
810
|
-
export namespace SubscriptionListResponse {
|
|
811
|
-
/**
|
|
812
|
-
* Scheduled plan change details, if any
|
|
813
|
-
*/
|
|
814
|
-
export interface ScheduledChange {
|
|
815
|
-
/**
|
|
816
|
-
* The scheduled plan change ID
|
|
817
|
-
*/
|
|
818
|
-
id: string;
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* Addons included in the scheduled change
|
|
822
|
-
*/
|
|
823
|
-
addons: Array<ScheduledChange.Addon>;
|
|
824
|
-
|
|
825
|
-
/**
|
|
826
|
-
* When this scheduled change was created
|
|
827
|
-
*/
|
|
828
|
-
created_at: string;
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* When the change will be applied
|
|
832
|
-
*/
|
|
833
|
-
effective_at: string;
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* The product ID the subscription will change to
|
|
837
|
-
*/
|
|
838
|
-
product_id: string;
|
|
839
|
-
|
|
840
|
-
/**
|
|
841
|
-
* Quantity for the new plan
|
|
842
|
-
*/
|
|
843
|
-
quantity: number;
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* Description of the product being changed to
|
|
847
|
-
*/
|
|
848
|
-
product_description?: string | null;
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* Name of the product being changed to
|
|
852
|
-
*/
|
|
853
|
-
product_name?: string | null;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
export namespace ScheduledChange {
|
|
857
|
-
export interface Addon {
|
|
858
|
-
/**
|
|
859
|
-
* The addon ID
|
|
860
|
-
*/
|
|
861
|
-
addon_id: string;
|
|
862
|
-
|
|
863
|
-
/**
|
|
864
|
-
* Name of the addon
|
|
865
|
-
*/
|
|
866
|
-
name: string;
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* Quantity of the addon
|
|
870
|
-
*/
|
|
871
|
-
quantity: number;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
|
|
876
839
|
export interface SubscriptionChargeResponse {
|
|
877
840
|
payment_id: string;
|
|
878
841
|
}
|
|
@@ -1183,6 +1146,16 @@ export interface SubscriptionCreateParams {
|
|
|
1183
1146
|
*/
|
|
1184
1147
|
force_3ds?: boolean | null;
|
|
1185
1148
|
|
|
1149
|
+
/**
|
|
1150
|
+
* Override the merchant-level mandate floor (in INR paise) for INR e-mandates on
|
|
1151
|
+
* Indian-card recurring payments. The mandate amount sent to the processor is
|
|
1152
|
+
* `max(this_floor, actual_billing_amount)`, so this is effectively the
|
|
1153
|
+
* customer-facing authorization ceiling whenever billing is lower. When unset, the
|
|
1154
|
+
* merchant setting applies; when that's also unset, the system default of ₹15,000
|
|
1155
|
+
* applies.
|
|
1156
|
+
*/
|
|
1157
|
+
mandate_min_amount_inr_paise?: number | null;
|
|
1158
|
+
|
|
1186
1159
|
/**
|
|
1187
1160
|
* Additional metadata for the subscription Defaults to empty if not specified
|
|
1188
1161
|
*/
|
|
@@ -1194,7 +1167,7 @@ export interface SubscriptionCreateParams {
|
|
|
1194
1167
|
* List of one time products that will be bundled with the first payment for this
|
|
1195
1168
|
* subscription
|
|
1196
1169
|
*/
|
|
1197
|
-
one_time_product_cart?: Array<
|
|
1170
|
+
one_time_product_cart?: Array<PaymentsAPI.OneTimeProductCartItem> | null;
|
|
1198
1171
|
|
|
1199
1172
|
/**
|
|
1200
1173
|
* If true, generates a payment link. Defaults to false if not specified.
|
|
@@ -1214,6 +1187,13 @@ export interface SubscriptionCreateParams {
|
|
|
1214
1187
|
*/
|
|
1215
1188
|
redirect_immediately?: boolean;
|
|
1216
1189
|
|
|
1190
|
+
/**
|
|
1191
|
+
* If true, the customer's phone number is required to create this subscription.
|
|
1192
|
+
* Typically set alongside `payment_link=true` so merchants can enforce phone
|
|
1193
|
+
* collection on the hosted payment page. Defaults to false.
|
|
1194
|
+
*/
|
|
1195
|
+
require_phone_number?: boolean;
|
|
1196
|
+
|
|
1217
1197
|
/**
|
|
1218
1198
|
* Optional URL to redirect after successful subscription creation
|
|
1219
1199
|
*/
|
|
@@ -1242,21 +1222,6 @@ export interface SubscriptionCreateParams {
|
|
|
1242
1222
|
trial_period_days?: number | null;
|
|
1243
1223
|
}
|
|
1244
1224
|
|
|
1245
|
-
export namespace SubscriptionCreateParams {
|
|
1246
|
-
export interface OneTimeProductCart {
|
|
1247
|
-
product_id: string;
|
|
1248
|
-
|
|
1249
|
-
quantity: number;
|
|
1250
|
-
|
|
1251
|
-
/**
|
|
1252
|
-
* Amount the customer pays if pay_what_you_want is enabled. If disabled then
|
|
1253
|
-
* amount will be ignored Represented in the lowest denomination of the currency
|
|
1254
|
-
* (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
|
1255
|
-
*/
|
|
1256
|
-
amount?: number | null;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
1225
|
export interface SubscriptionUpdateParams {
|
|
1261
1226
|
billing?: PaymentsAPI.BillingAddress | null;
|
|
1262
1227
|
|
|
@@ -1269,8 +1234,21 @@ export interface SubscriptionUpdateParams {
|
|
|
1269
1234
|
| 'cancelled_by_customer'
|
|
1270
1235
|
| 'cancelled_by_merchant'
|
|
1271
1236
|
| 'cancelled_by_merchant_send_dunning'
|
|
1237
|
+
| 'dodo_team'
|
|
1272
1238
|
| null;
|
|
1273
1239
|
|
|
1240
|
+
/**
|
|
1241
|
+
* Free-text cancellation comment (only valid when cancelling or scheduling
|
|
1242
|
+
* cancellation).
|
|
1243
|
+
*/
|
|
1244
|
+
cancellation_comment?: string | null;
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* Customer-supplied churn reason (only valid when cancelling or scheduling
|
|
1248
|
+
* cancellation).
|
|
1249
|
+
*/
|
|
1250
|
+
cancellation_feedback?: CancellationFeedback | null;
|
|
1251
|
+
|
|
1274
1252
|
/**
|
|
1275
1253
|
* Update credit entitlement cart settings
|
|
1276
1254
|
*/
|
|
@@ -1371,6 +1349,12 @@ export interface SubscriptionChangePlanParams {
|
|
|
1371
1349
|
*/
|
|
1372
1350
|
quantity: number;
|
|
1373
1351
|
|
|
1352
|
+
/**
|
|
1353
|
+
* Whether adaptive currency fees should be included in the price (true) or added
|
|
1354
|
+
* on top (false). If not specified, uses the subscription's stored setting.
|
|
1355
|
+
*/
|
|
1356
|
+
adaptive_currency_fees_inclusive?: boolean | null;
|
|
1357
|
+
|
|
1374
1358
|
/**
|
|
1375
1359
|
* Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
1376
1360
|
* addons
|
|
@@ -1486,6 +1470,12 @@ export interface SubscriptionPreviewChangePlanParams {
|
|
|
1486
1470
|
*/
|
|
1487
1471
|
quantity: number;
|
|
1488
1472
|
|
|
1473
|
+
/**
|
|
1474
|
+
* Whether adaptive currency fees should be included in the price (true) or added
|
|
1475
|
+
* on top (false). If not specified, uses the subscription's stored setting.
|
|
1476
|
+
*/
|
|
1477
|
+
adaptive_currency_fees_inclusive?: boolean | null;
|
|
1478
|
+
|
|
1489
1479
|
/**
|
|
1490
1480
|
* Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
1491
1481
|
* addons
|
|
@@ -1565,10 +1555,12 @@ export declare namespace Subscriptions {
|
|
|
1565
1555
|
export {
|
|
1566
1556
|
type AddonCartResponseItem as AddonCartResponseItem,
|
|
1567
1557
|
type AttachAddon as AttachAddon,
|
|
1558
|
+
type CancellationFeedback as CancellationFeedback,
|
|
1568
1559
|
type CreditEntitlementCartResponse as CreditEntitlementCartResponse,
|
|
1569
1560
|
type MeterCartResponseItem as MeterCartResponseItem,
|
|
1570
1561
|
type MeterCreditEntitlementCartResponse as MeterCreditEntitlementCartResponse,
|
|
1571
1562
|
type OnDemandSubscription as OnDemandSubscription,
|
|
1563
|
+
type ScheduledPlanChange as ScheduledPlanChange,
|
|
1572
1564
|
type Subscription as Subscription,
|
|
1573
1565
|
type SubscriptionStatus as SubscriptionStatus,
|
|
1574
1566
|
type TimeInterval as TimeInterval,
|
|
@@ -7,6 +7,7 @@ import * as PaymentsAPI from './payments';
|
|
|
7
7
|
import * as RefundsAPI from './refunds';
|
|
8
8
|
import * as SubscriptionsAPI from './subscriptions';
|
|
9
9
|
import * as BalancesAPI from './credit-entitlements/balances';
|
|
10
|
+
import * as GrantsAPI from './entitlements/grants';
|
|
10
11
|
|
|
11
12
|
export class WebhookEvents extends APIResource {}
|
|
12
13
|
|
|
@@ -47,6 +48,7 @@ export type WebhookEventType =
|
|
|
47
48
|
| 'credit.rolled_over'
|
|
48
49
|
| 'credit.rollover_forfeited'
|
|
49
50
|
| 'credit.overage_charged'
|
|
51
|
+
| 'credit.overage_reset'
|
|
50
52
|
| 'credit.manual_adjustment'
|
|
51
53
|
| 'credit.balance_low'
|
|
52
54
|
| 'abandoned_checkout.detected'
|
|
@@ -173,54 +175,8 @@ export namespace WebhookPayload {
|
|
|
173
175
|
payment_id?: string | null;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
export interface EntitlementGrant {
|
|
177
|
-
id: string;
|
|
178
|
-
|
|
179
|
-
business_id: string;
|
|
180
|
-
|
|
181
|
-
created_at: string;
|
|
182
|
-
|
|
183
|
-
customer_id: string;
|
|
184
|
-
|
|
185
|
-
entitlement_id: string;
|
|
186
|
-
|
|
187
|
-
external_id: string;
|
|
188
|
-
|
|
178
|
+
export interface EntitlementGrant extends GrantsAPI.EntitlementGrant {
|
|
189
179
|
payload_type: 'EntitlementGrant';
|
|
190
|
-
|
|
191
|
-
status: 'Pending' | 'Delivered' | 'Failed' | 'Revoked';
|
|
192
|
-
|
|
193
|
-
updated_at: string;
|
|
194
|
-
|
|
195
|
-
delivered_at?: string | null;
|
|
196
|
-
|
|
197
|
-
error_code?: string | null;
|
|
198
|
-
|
|
199
|
-
error_message?: string | null;
|
|
200
|
-
|
|
201
|
-
license_key?: string | null;
|
|
202
|
-
|
|
203
|
-
license_key_activations_limit?: number | null;
|
|
204
|
-
|
|
205
|
-
license_key_activations_used?: number | null;
|
|
206
|
-
|
|
207
|
-
license_key_expires_at?: string | null;
|
|
208
|
-
|
|
209
|
-
license_key_status?: string | null;
|
|
210
|
-
|
|
211
|
-
metadata?: unknown;
|
|
212
|
-
|
|
213
|
-
oauth_expires_at?: string | null;
|
|
214
|
-
|
|
215
|
-
oauth_url?: string | null;
|
|
216
|
-
|
|
217
|
-
payment_id?: string | null;
|
|
218
|
-
|
|
219
|
-
revocation_reason?: string | null;
|
|
220
|
-
|
|
221
|
-
revoked_at?: string | null;
|
|
222
|
-
|
|
223
|
-
subscription_id?: string | null;
|
|
224
180
|
}
|
|
225
181
|
}
|
|
226
182
|
|
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
type CreditExpiredWebhookEvent,
|
|
14
14
|
type CreditManualAdjustmentWebhookEvent,
|
|
15
15
|
type CreditOverageChargedWebhookEvent,
|
|
16
|
+
type CreditOverageResetWebhookEvent,
|
|
16
17
|
type CreditRolledOverWebhookEvent,
|
|
17
18
|
type CreditRolloverForfeitedWebhookEvent,
|
|
18
19
|
type DisputeAcceptedWebhookEvent,
|
|
@@ -24,6 +25,10 @@ export {
|
|
|
24
25
|
type DisputeWonWebhookEvent,
|
|
25
26
|
type DunningRecoveredWebhookEvent,
|
|
26
27
|
type DunningStartedWebhookEvent,
|
|
28
|
+
type EntitlementGrantCreatedWebhookEvent,
|
|
29
|
+
type EntitlementGrantDeliveredWebhookEvent,
|
|
30
|
+
type EntitlementGrantFailedWebhookEvent,
|
|
31
|
+
type EntitlementGrantRevokedWebhookEvent,
|
|
27
32
|
type LicenseKeyCreatedWebhookEvent,
|
|
28
33
|
type PaymentCancelledWebhookEvent,
|
|
29
34
|
type PaymentFailedWebhookEvent,
|