@@ -67,6 +67,7 @@ export interface PlanVersion {
6767 | Shared . PlanPhaseUsageDiscountAdjustment
6868 | Shared . PlanPhaseAmountDiscountAdjustment
6969 | Shared . PlanPhasePercentageDiscountAdjustment
70+ | PlanVersion . PlanPhaseTieredPercentageDiscountAdjustment
7071 | Shared . PlanPhaseMinimumAdjustment
7172 | Shared . PlanPhaseMaximumAdjustment
7273 > ;
@@ -84,6 +85,97 @@ export interface PlanVersion {
8485 version : number ;
8586}
8687
88+ export namespace PlanVersion {
89+ export interface PlanPhaseTieredPercentageDiscountAdjustment {
90+ id : string ;
91+
92+ adjustment_type : 'tiered_percentage_discount' ;
93+
94+ /**
95+ * @deprecated The price IDs that this adjustment applies to.
96+ */
97+ applies_to_price_ids : Array < string > ;
98+
99+ /**
100+ * The filters that determine which prices to apply this adjustment to.
101+ */
102+ filters : Array < PlanPhaseTieredPercentageDiscountAdjustment . Filter > ;
103+
104+ /**
105+ * True for adjustments that apply to an entire invoice, false for adjustments that
106+ * apply to only one price.
107+ */
108+ is_invoice_level : boolean ;
109+
110+ /**
111+ * The plan phase in which this adjustment is active.
112+ */
113+ plan_phase_order : number | null ;
114+
115+ /**
116+ * The reason for the adjustment.
117+ */
118+ reason : string | null ;
119+
120+ /**
121+ * The adjustment id this adjustment replaces. This adjustment will take the place
122+ * of the replaced adjustment in plan version migrations.
123+ */
124+ replaces_adjustment_id : string | null ;
125+
126+ /**
127+ * The ordered, contiguous bands of cumulative eligible spend, each discounted at
128+ * its own percentage (progressive fill-a-tier), applied to the prices this
129+ * adjustment covers in a given billing period.
130+ */
131+ tiers : Array < PlanPhaseTieredPercentageDiscountAdjustment . Tier > ;
132+ }
133+
134+ export namespace PlanPhaseTieredPercentageDiscountAdjustment {
135+ export interface Filter {
136+ /**
137+ * The property of the price to filter on.
138+ */
139+ field : 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id' ;
140+
141+ /**
142+ * Should prices that match the filter be included or excluded.
143+ */
144+ operator : 'includes' | 'excludes' ;
145+
146+ /**
147+ * The IDs or values that match this filter.
148+ */
149+ values : Array < string > ;
150+ }
151+
152+ /**
153+ * One band of a tiered percentage discount. Bounds are denominated in the
154+ * discount's currency. `lower_bound` is the exclusive start of the band and
155+ * `upper_bound` is the inclusive end; `upper_bound` is null only for the
156+ * open-ended final tier.
157+ */
158+ export interface Tier {
159+ /**
160+ * Exclusive lower bound of cumulative spend for this tier.
161+ */
162+ lower_bound : number ;
163+
164+ /**
165+ * The percentage (between 0 and 1) discounted from spend that falls within this
166+ * tier.
167+ */
168+ percentage : number ;
169+
170+ /**
171+ * Inclusive upper bound of cumulative spend for this tier; null for the final
172+ * open-ended tier.
173+ */
174+ upper_bound ?: number | null ;
175+ }
176+ }
177+ }
178+
87179export interface PlanVersionPhase {
88180 id : string ;
89181
@@ -157,14 +249,95 @@ export namespace BetaCreatePlanVersionParams {
157249 | Shared . NewUsageDiscount
158250 | Shared . NewAmountDiscount
159251 | Shared . NewMinimum
160- | Shared . NewMaximum ;
252+ | Shared . NewMaximum
253+ | AddAdjustment . NewTieredPercentageDiscount ;
161254
162255 /**
163256 * The phase to add this adjustment to.
164257 */
165258 plan_phase_order ?: number | null ;
166259 }
167260
261+ export namespace AddAdjustment {
262+ export interface NewTieredPercentageDiscount {
263+ adjustment_type : 'tiered_percentage_discount' ;
264+
265+ tiers : Array < NewTieredPercentageDiscount . Tier > ;
266+
267+ /**
268+ * If set, the adjustment will apply to every price on the subscription.
269+ */
270+ applies_to_all ?: true | null ;
271+
272+ /**
273+ * The set of item IDs to which this adjustment applies.
274+ */
275+ applies_to_item_ids ?: Array < string > | null ;
276+
277+ /**
278+ * The set of price IDs to which this adjustment applies.
279+ */
280+ applies_to_price_ids ?: Array < string > | null ;
281+
282+ /**
283+ * If set, only prices in the specified currency will have the adjustment applied.
284+ */
285+ currency ?: string | null ;
286+
287+ /**
288+ * A list of filters that determine which prices this adjustment will apply to.
289+ */
290+ filters ?: Array < NewTieredPercentageDiscount . Filter > | null ;
291+
292+ /**
293+ * When false, this adjustment will be applied to a single price. Otherwise, it
294+ * will be applied at the invoice level, possibly to multiple prices.
295+ */
296+ is_invoice_level ?: boolean ;
297+
298+ /**
299+ * If set, only prices of the specified type will have the adjustment applied.
300+ */
301+ price_type ?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null ;
302+ }
303+
304+ export namespace NewTieredPercentageDiscount {
305+ export interface Tier {
306+ /**
307+ * Exclusive lower bound of cumulative spend for this tier.
308+ */
309+ lower_bound : number ;
310+
311+ /**
312+ * The percentage (0-1) discounted from spend in this tier.
313+ */
314+ percentage : number ;
315+
316+ /**
317+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
318+ */
319+ upper_bound ?: number | null ;
320+ }
321+
322+ export interface Filter {
323+ /**
324+ * The property of the price to filter on.
325+ */
326+ field : 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id' ;
327+
328+ /**
329+ * Should prices that match the filter be included or excluded.
330+ */
331+ operator : 'includes' | 'excludes' ;
332+
333+ /**
334+ * The IDs or values that match this filter.
335+ */
336+ values : Array < string > ;
337+ }
338+ }
339+ }
340+
168341 export interface AddPrice {
169342 /**
170343 * The allocation price to add to the plan.
@@ -1691,7 +1864,8 @@ export namespace BetaCreatePlanVersionParams {
16911864 | Shared . NewUsageDiscount
16921865 | Shared . NewAmountDiscount
16931866 | Shared . NewMinimum
1694- | Shared . NewMaximum ;
1867+ | Shared . NewMaximum
1868+ | ReplaceAdjustment . NewTieredPercentageDiscount ;
16951869
16961870 /**
16971871 * The id of the adjustment on the plan to replace in the plan.
@@ -1704,6 +1878,86 @@ export namespace BetaCreatePlanVersionParams {
17041878 plan_phase_order ?: number | null ;
17051879 }
17061880
1881+ export namespace ReplaceAdjustment {
1882+ export interface NewTieredPercentageDiscount {
1883+ adjustment_type : 'tiered_percentage_discount' ;
1884+
1885+ tiers : Array < NewTieredPercentageDiscount . Tier > ;
1886+
1887+ /**
1888+ * If set, the adjustment will apply to every price on the subscription.
1889+ */
1890+ applies_to_all ?: true | null ;
1891+
1892+ /**
1893+ * The set of item IDs to which this adjustment applies.
1894+ */
1895+ applies_to_item_ids ?: Array < string > | null ;
1896+
1897+ /**
1898+ * The set of price IDs to which this adjustment applies.
1899+ */
1900+ applies_to_price_ids ?: Array < string > | null ;
1901+
1902+ /**
1903+ * If set, only prices in the specified currency will have the adjustment applied.
1904+ */
1905+ currency ?: string | null ;
1906+
1907+ /**
1908+ * A list of filters that determine which prices this adjustment will apply to.
1909+ */
1910+ filters ?: Array < NewTieredPercentageDiscount . Filter > | null ;
1911+
1912+ /**
1913+ * When false, this adjustment will be applied to a single price. Otherwise, it
1914+ * will be applied at the invoice level, possibly to multiple prices.
1915+ */
1916+ is_invoice_level ?: boolean ;
1917+
1918+ /**
1919+ * If set, only prices of the specified type will have the adjustment applied.
1920+ */
1921+ price_type ?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null ;
1922+ }
1923+
1924+ export namespace NewTieredPercentageDiscount {
1925+ export interface Tier {
1926+ /**
1927+ * Exclusive lower bound of cumulative spend for this tier.
1928+ */
1929+ lower_bound : number ;
1930+
1931+ /**
1932+ * The percentage (0-1) discounted from spend in this tier.
1933+ */
1934+ percentage : number ;
1935+
1936+ /**
1937+ * Inclusive upper bound of cumulative spend; null for the final open-ended tier.
1938+ */
1939+ upper_bound ?: number | null ;
1940+ }
1941+
1942+ export interface Filter {
1943+ /**
1944+ * The property of the price to filter on.
1945+ */
1946+ field : 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id' ;
1947+
1948+ /**
1949+ * Should prices that match the filter be included or excluded.
1950+ */
1951+ operator : 'includes' | 'excludes' ;
1952+
1953+ /**
1954+ * The IDs or values that match this filter.
1955+ */
1956+ values : Array < string > ;
1957+ }
1958+ }
1959+ }
1960+
17071961 export interface ReplacePrice {
17081962 /**
17091963 * The id of the price on the plan to replace in the plan.
0 commit comments