orb-billing 4.21.0 → 4.24.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 +31 -0
- package/core.d.ts +3 -1
- package/core.d.ts.map +1 -1
- package/core.js +7 -5
- package/core.js.map +1 -1
- package/core.mjs +7 -5
- package/core.mjs.map +1 -1
- package/index.d.mts +4 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/coupons/coupons.d.ts +2 -30
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/customers/costs.d.ts +0 -34
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/customers.d.ts +31 -0
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/invoices.d.ts +10 -186
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs.map +1 -1
- package/resources/plans/plans.d.ts +95 -1
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/prices.d.ts +169 -2
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +46 -45
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscriptions.d.ts +11018 -3071
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/core.ts +12 -4
- package/src/index.ts +4 -0
- package/src/resources/coupons/coupons.ts +2 -38
- package/src/resources/customers/costs.ts +0 -34
- package/src/resources/customers/customers.ts +59 -0
- package/src/resources/invoices.ts +10 -246
- package/src/resources/plans/plans.ts +114 -0
- package/src/resources/prices/prices.ts +224 -0
- package/src/resources/shared.ts +57 -59
- package/src/resources/subscriptions.ts +13372 -3713
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -320,6 +320,7 @@ export interface PlanCreateParams {
|
|
|
320
320
|
| PlanCreateParams.NewPlanUnitWithProrationPrice
|
|
321
321
|
| PlanCreateParams.NewPlanGroupedAllocationPrice
|
|
322
322
|
| PlanCreateParams.NewPlanGroupedWithProratedMinimumPrice
|
|
323
|
+
| PlanCreateParams.NewPlanGroupedWithMeteredMinimumPrice
|
|
323
324
|
| PlanCreateParams.NewPlanBulkWithProrationPrice
|
|
324
325
|
>;
|
|
325
326
|
|
|
@@ -2444,6 +2445,119 @@ export namespace PlanCreateParams {
|
|
|
2444
2445
|
}
|
|
2445
2446
|
}
|
|
2446
2447
|
|
|
2448
|
+
export interface NewPlanGroupedWithMeteredMinimumPrice {
|
|
2449
|
+
/**
|
|
2450
|
+
* The cadence to bill for this price on.
|
|
2451
|
+
*/
|
|
2452
|
+
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
|
|
2453
|
+
|
|
2454
|
+
grouped_with_metered_minimum_config: Record<string, unknown>;
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* The id of the item the plan will be associated with.
|
|
2458
|
+
*/
|
|
2459
|
+
item_id: string;
|
|
2460
|
+
|
|
2461
|
+
model_type: 'grouped_with_metered_minimum';
|
|
2462
|
+
|
|
2463
|
+
/**
|
|
2464
|
+
* The name of the price.
|
|
2465
|
+
*/
|
|
2466
|
+
name: string;
|
|
2467
|
+
|
|
2468
|
+
/**
|
|
2469
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
2470
|
+
* usage-based.
|
|
2471
|
+
*/
|
|
2472
|
+
billable_metric_id?: string | null;
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
2476
|
+
* this is true, and in-arrears if this is false.
|
|
2477
|
+
*/
|
|
2478
|
+
billed_in_advance?: boolean | null;
|
|
2479
|
+
|
|
2480
|
+
/**
|
|
2481
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2482
|
+
* months.
|
|
2483
|
+
*/
|
|
2484
|
+
billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
|
|
2485
|
+
|
|
2486
|
+
/**
|
|
2487
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
2488
|
+
*/
|
|
2489
|
+
conversion_rate?: number | null;
|
|
2490
|
+
|
|
2491
|
+
/**
|
|
2492
|
+
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
2493
|
+
* price is billed.
|
|
2494
|
+
*/
|
|
2495
|
+
currency?: string | null;
|
|
2496
|
+
|
|
2497
|
+
/**
|
|
2498
|
+
* An alias for the price.
|
|
2499
|
+
*/
|
|
2500
|
+
external_price_id?: string | null;
|
|
2501
|
+
|
|
2502
|
+
/**
|
|
2503
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
2504
|
+
* applied.
|
|
2505
|
+
*/
|
|
2506
|
+
fixed_price_quantity?: number | null;
|
|
2507
|
+
|
|
2508
|
+
/**
|
|
2509
|
+
* The property used to group this price on an invoice
|
|
2510
|
+
*/
|
|
2511
|
+
invoice_grouping_key?: string | null;
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
2515
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
2516
|
+
*/
|
|
2517
|
+
invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
2521
|
+
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
2522
|
+
* by setting `metadata` to `null`.
|
|
2523
|
+
*/
|
|
2524
|
+
metadata?: Record<string, string | null> | null;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
export namespace NewPlanGroupedWithMeteredMinimumPrice {
|
|
2528
|
+
/**
|
|
2529
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
2530
|
+
* months.
|
|
2531
|
+
*/
|
|
2532
|
+
export interface BillingCycleConfiguration {
|
|
2533
|
+
/**
|
|
2534
|
+
* The duration of the billing period.
|
|
2535
|
+
*/
|
|
2536
|
+
duration: number;
|
|
2537
|
+
|
|
2538
|
+
/**
|
|
2539
|
+
* The unit of billing period duration.
|
|
2540
|
+
*/
|
|
2541
|
+
duration_unit: 'day' | 'month';
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
/**
|
|
2545
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
2546
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
2547
|
+
*/
|
|
2548
|
+
export interface InvoicingCycleConfiguration {
|
|
2549
|
+
/**
|
|
2550
|
+
* The duration of the billing period.
|
|
2551
|
+
*/
|
|
2552
|
+
duration: number;
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* The unit of billing period duration.
|
|
2556
|
+
*/
|
|
2557
|
+
duration_unit: 'day' | 'month';
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2447
2561
|
export interface NewPlanBulkWithProrationPrice {
|
|
2448
2562
|
bulk_with_proration_config: Record<string, unknown>;
|
|
2449
2563
|
|
|
@@ -373,6 +373,7 @@ export type Price =
|
|
|
373
373
|
| Price.UnitWithProrationPrice
|
|
374
374
|
| Price.GroupedAllocationPrice
|
|
375
375
|
| Price.GroupedWithProratedMinimumPrice
|
|
376
|
+
| Price.GroupedWithMeteredMinimumPrice
|
|
376
377
|
| Price.BulkWithProrationPrice;
|
|
377
378
|
|
|
378
379
|
export namespace Price {
|
|
@@ -2785,6 +2786,116 @@ export namespace Price {
|
|
|
2785
2786
|
}
|
|
2786
2787
|
}
|
|
2787
2788
|
|
|
2789
|
+
export interface GroupedWithMeteredMinimumPrice {
|
|
2790
|
+
id: string;
|
|
2791
|
+
|
|
2792
|
+
billable_metric: GroupedWithMeteredMinimumPrice.BillableMetric | null;
|
|
2793
|
+
|
|
2794
|
+
billing_cycle_configuration: GroupedWithMeteredMinimumPrice.BillingCycleConfiguration;
|
|
2795
|
+
|
|
2796
|
+
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
|
|
2797
|
+
|
|
2798
|
+
conversion_rate: number | null;
|
|
2799
|
+
|
|
2800
|
+
created_at: string;
|
|
2801
|
+
|
|
2802
|
+
credit_allocation: GroupedWithMeteredMinimumPrice.CreditAllocation | null;
|
|
2803
|
+
|
|
2804
|
+
currency: string;
|
|
2805
|
+
|
|
2806
|
+
discount: Shared.Discount | null;
|
|
2807
|
+
|
|
2808
|
+
external_price_id: string | null;
|
|
2809
|
+
|
|
2810
|
+
fixed_price_quantity: number | null;
|
|
2811
|
+
|
|
2812
|
+
grouped_with_metered_minimum_config: Record<string, unknown>;
|
|
2813
|
+
|
|
2814
|
+
invoicing_cycle_configuration: GroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
|
|
2815
|
+
|
|
2816
|
+
item: GroupedWithMeteredMinimumPrice.Item;
|
|
2817
|
+
|
|
2818
|
+
maximum: GroupedWithMeteredMinimumPrice.Maximum | null;
|
|
2819
|
+
|
|
2820
|
+
maximum_amount: string | null;
|
|
2821
|
+
|
|
2822
|
+
/**
|
|
2823
|
+
* User specified key-value pairs for the resource. If not present, this defaults
|
|
2824
|
+
* to an empty dictionary. Individual keys can be removed by setting the value to
|
|
2825
|
+
* `null`, and the entire metadata mapping can be cleared by setting `metadata` to
|
|
2826
|
+
* `null`.
|
|
2827
|
+
*/
|
|
2828
|
+
metadata: Record<string, string>;
|
|
2829
|
+
|
|
2830
|
+
minimum: GroupedWithMeteredMinimumPrice.Minimum | null;
|
|
2831
|
+
|
|
2832
|
+
minimum_amount: string | null;
|
|
2833
|
+
|
|
2834
|
+
model_type: 'grouped_with_metered_minimum';
|
|
2835
|
+
|
|
2836
|
+
name: string;
|
|
2837
|
+
|
|
2838
|
+
plan_phase_order: number | null;
|
|
2839
|
+
|
|
2840
|
+
price_type: 'usage_price' | 'fixed_price';
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
export namespace GroupedWithMeteredMinimumPrice {
|
|
2844
|
+
export interface BillableMetric {
|
|
2845
|
+
id: string;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
export interface BillingCycleConfiguration {
|
|
2849
|
+
duration: number;
|
|
2850
|
+
|
|
2851
|
+
duration_unit: 'day' | 'month';
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
export interface CreditAllocation {
|
|
2855
|
+
allows_rollover: boolean;
|
|
2856
|
+
|
|
2857
|
+
currency: string;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
export interface InvoicingCycleConfiguration {
|
|
2861
|
+
duration: number;
|
|
2862
|
+
|
|
2863
|
+
duration_unit: 'day' | 'month';
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
export interface Item {
|
|
2867
|
+
id: string;
|
|
2868
|
+
|
|
2869
|
+
name: string;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
export interface Maximum {
|
|
2873
|
+
/**
|
|
2874
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
2875
|
+
* maximums, this can be a subset of prices.
|
|
2876
|
+
*/
|
|
2877
|
+
applies_to_price_ids: Array<string>;
|
|
2878
|
+
|
|
2879
|
+
/**
|
|
2880
|
+
* Maximum amount applied
|
|
2881
|
+
*/
|
|
2882
|
+
maximum_amount: string;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
export interface Minimum {
|
|
2886
|
+
/**
|
|
2887
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
2888
|
+
* minimums, this can be a subset of prices.
|
|
2889
|
+
*/
|
|
2890
|
+
applies_to_price_ids: Array<string>;
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* Minimum amount applied
|
|
2894
|
+
*/
|
|
2895
|
+
minimum_amount: string;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2788
2899
|
export interface BulkWithProrationPrice {
|
|
2789
2900
|
id: string;
|
|
2790
2901
|
|
|
@@ -2921,6 +3032,7 @@ export type PriceCreateParams =
|
|
|
2921
3032
|
| PriceCreateParams.NewFloatingUnitWithProrationPrice
|
|
2922
3033
|
| PriceCreateParams.NewFloatingGroupedAllocationPrice
|
|
2923
3034
|
| PriceCreateParams.NewFloatingGroupedWithProratedMinimumPrice
|
|
3035
|
+
| PriceCreateParams.NewFloatingGroupedWithMeteredMinimumPrice
|
|
2924
3036
|
| PriceCreateParams.NewFloatingBulkWithProrationPrice;
|
|
2925
3037
|
|
|
2926
3038
|
export namespace PriceCreateParams {
|
|
@@ -5373,6 +5485,118 @@ export namespace PriceCreateParams {
|
|
|
5373
5485
|
}
|
|
5374
5486
|
}
|
|
5375
5487
|
|
|
5488
|
+
export interface NewFloatingGroupedWithMeteredMinimumPrice {
|
|
5489
|
+
/**
|
|
5490
|
+
* The cadence to bill for this price on.
|
|
5491
|
+
*/
|
|
5492
|
+
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
|
|
5493
|
+
|
|
5494
|
+
/**
|
|
5495
|
+
* An ISO 4217 currency string for which this price is billed in.
|
|
5496
|
+
*/
|
|
5497
|
+
currency: string;
|
|
5498
|
+
|
|
5499
|
+
grouped_with_metered_minimum_config: Record<string, unknown>;
|
|
5500
|
+
|
|
5501
|
+
/**
|
|
5502
|
+
* The id of the item the plan will be associated with.
|
|
5503
|
+
*/
|
|
5504
|
+
item_id: string;
|
|
5505
|
+
|
|
5506
|
+
model_type: 'grouped_with_metered_minimum';
|
|
5507
|
+
|
|
5508
|
+
/**
|
|
5509
|
+
* The name of the price.
|
|
5510
|
+
*/
|
|
5511
|
+
name: string;
|
|
5512
|
+
|
|
5513
|
+
/**
|
|
5514
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
5515
|
+
* usage-based.
|
|
5516
|
+
*/
|
|
5517
|
+
billable_metric_id?: string | null;
|
|
5518
|
+
|
|
5519
|
+
/**
|
|
5520
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
5521
|
+
* this is true, and in-arrears if this is false.
|
|
5522
|
+
*/
|
|
5523
|
+
billed_in_advance?: boolean | null;
|
|
5524
|
+
|
|
5525
|
+
/**
|
|
5526
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
5527
|
+
* months.
|
|
5528
|
+
*/
|
|
5529
|
+
billing_cycle_configuration?: PriceCreateParams.NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
|
|
5530
|
+
|
|
5531
|
+
/**
|
|
5532
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
5533
|
+
*/
|
|
5534
|
+
conversion_rate?: number | null;
|
|
5535
|
+
|
|
5536
|
+
/**
|
|
5537
|
+
* An alias for the price.
|
|
5538
|
+
*/
|
|
5539
|
+
external_price_id?: string | null;
|
|
5540
|
+
|
|
5541
|
+
/**
|
|
5542
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
5543
|
+
* applied.
|
|
5544
|
+
*/
|
|
5545
|
+
fixed_price_quantity?: number | null;
|
|
5546
|
+
|
|
5547
|
+
/**
|
|
5548
|
+
* The property used to group this price on an invoice
|
|
5549
|
+
*/
|
|
5550
|
+
invoice_grouping_key?: string | null;
|
|
5551
|
+
|
|
5552
|
+
/**
|
|
5553
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
5554
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
5555
|
+
*/
|
|
5556
|
+
invoicing_cycle_configuration?: PriceCreateParams.NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
|
|
5557
|
+
|
|
5558
|
+
/**
|
|
5559
|
+
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
5560
|
+
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
5561
|
+
* by setting `metadata` to `null`.
|
|
5562
|
+
*/
|
|
5563
|
+
metadata?: Record<string, string | null> | null;
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
export namespace NewFloatingGroupedWithMeteredMinimumPrice {
|
|
5567
|
+
/**
|
|
5568
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
5569
|
+
* months.
|
|
5570
|
+
*/
|
|
5571
|
+
export interface BillingCycleConfiguration {
|
|
5572
|
+
/**
|
|
5573
|
+
* The duration of the billing period.
|
|
5574
|
+
*/
|
|
5575
|
+
duration: number;
|
|
5576
|
+
|
|
5577
|
+
/**
|
|
5578
|
+
* The unit of billing period duration.
|
|
5579
|
+
*/
|
|
5580
|
+
duration_unit: 'day' | 'month';
|
|
5581
|
+
}
|
|
5582
|
+
|
|
5583
|
+
/**
|
|
5584
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
5585
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
5586
|
+
*/
|
|
5587
|
+
export interface InvoicingCycleConfiguration {
|
|
5588
|
+
/**
|
|
5589
|
+
* The duration of the billing period.
|
|
5590
|
+
*/
|
|
5591
|
+
duration: number;
|
|
5592
|
+
|
|
5593
|
+
/**
|
|
5594
|
+
* The unit of billing period duration.
|
|
5595
|
+
*/
|
|
5596
|
+
duration_unit: 'day' | 'month';
|
|
5597
|
+
}
|
|
5598
|
+
}
|
|
5599
|
+
|
|
5376
5600
|
export interface NewFloatingBulkWithProrationPrice {
|
|
5377
5601
|
bulk_with_proration_config: Record<string, unknown>;
|
|
5378
5602
|
|
package/src/resources/shared.ts
CHANGED
|
@@ -1,54 +1,27 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
| Discount.UsageDiscount
|
|
9
|
-
| Discount.AmountDiscount;
|
|
10
|
-
|
|
11
|
-
export namespace Discount {
|
|
12
|
-
export interface PercentageDiscount {
|
|
13
|
-
/**
|
|
14
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
15
|
-
* this can be a subset of prices.
|
|
16
|
-
*/
|
|
17
|
-
applies_to_price_ids: Array<string>;
|
|
3
|
+
export interface AmountDiscount {
|
|
4
|
+
/**
|
|
5
|
+
* Only available if discount_type is `amount`.
|
|
6
|
+
*/
|
|
7
|
+
amount_discount: string;
|
|
18
8
|
|
|
19
|
-
|
|
9
|
+
/**
|
|
10
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
11
|
+
* this can be a subset of prices.
|
|
12
|
+
*/
|
|
13
|
+
applies_to_price_ids: Array<string>;
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
* Only available if discount_type is `percentage`. This is a number between 0
|
|
23
|
-
* and 1.
|
|
24
|
-
*/
|
|
25
|
-
percentage_discount: number;
|
|
26
|
-
|
|
27
|
-
reason?: string | null;
|
|
28
|
-
}
|
|
15
|
+
discount_type: 'amount';
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
33
|
-
* this can be a subset of prices.
|
|
34
|
-
*/
|
|
35
|
-
applies_to_price_ids: Array<string>;
|
|
36
|
-
|
|
37
|
-
discount_type: 'trial';
|
|
17
|
+
reason?: string | null;
|
|
18
|
+
}
|
|
38
19
|
|
|
39
|
-
|
|
20
|
+
export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
|
|
40
21
|
|
|
41
|
-
|
|
42
|
-
* Only available if discount_type is `trial`
|
|
43
|
-
*/
|
|
44
|
-
trial_amount_discount?: string | null;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Only available if discount_type is `trial`
|
|
48
|
-
*/
|
|
49
|
-
trial_percentage_discount?: number | null;
|
|
50
|
-
}
|
|
22
|
+
export type Discount = PercentageDiscount | TrialDiscount | Discount.UsageDiscount | AmountDiscount;
|
|
51
23
|
|
|
24
|
+
export namespace Discount {
|
|
52
25
|
export interface UsageDiscount {
|
|
53
26
|
/**
|
|
54
27
|
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
@@ -66,27 +39,52 @@ export namespace Discount {
|
|
|
66
39
|
|
|
67
40
|
reason?: string | null;
|
|
68
41
|
}
|
|
42
|
+
}
|
|
69
43
|
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Only available if discount_type is `amount`.
|
|
73
|
-
*/
|
|
74
|
-
amount_discount: string;
|
|
44
|
+
export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount;
|
|
75
45
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* this can be a subset of prices.
|
|
79
|
-
*/
|
|
80
|
-
applies_to_price_ids: Array<string>;
|
|
46
|
+
export interface PaginationMetadata {
|
|
47
|
+
has_more: boolean;
|
|
81
48
|
|
|
82
|
-
|
|
49
|
+
next_cursor: string | null;
|
|
50
|
+
}
|
|
83
51
|
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
export interface PercentageDiscount {
|
|
53
|
+
/**
|
|
54
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
55
|
+
* this can be a subset of prices.
|
|
56
|
+
*/
|
|
57
|
+
applies_to_price_ids: Array<string>;
|
|
58
|
+
|
|
59
|
+
discount_type: 'percentage';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Only available if discount_type is `percentage`. This is a number between 0
|
|
63
|
+
* and 1.
|
|
64
|
+
*/
|
|
65
|
+
percentage_discount: number;
|
|
66
|
+
|
|
67
|
+
reason?: string | null;
|
|
86
68
|
}
|
|
87
69
|
|
|
88
|
-
export interface
|
|
89
|
-
|
|
70
|
+
export interface TrialDiscount {
|
|
71
|
+
/**
|
|
72
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
73
|
+
* this can be a subset of prices.
|
|
74
|
+
*/
|
|
75
|
+
applies_to_price_ids: Array<string>;
|
|
90
76
|
|
|
91
|
-
|
|
77
|
+
discount_type: 'trial';
|
|
78
|
+
|
|
79
|
+
reason?: string | null;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Only available if discount_type is `trial`
|
|
83
|
+
*/
|
|
84
|
+
trial_amount_discount?: string | null;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Only available if discount_type is `trial`
|
|
88
|
+
*/
|
|
89
|
+
trial_percentage_discount?: number | null;
|
|
92
90
|
}
|