From 715040d77d726c501d629eab96413dc10264d526 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 23:14:18 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- src/resources/beta/beta.ts | 340 +++++++ src/resources/beta/external-plan-id.ts | 340 +++++++ src/resources/customers/credits/ledger.ts | 32 +- src/resources/plans/plans.ts | 170 ++++ src/resources/prices/prices.ts | 489 ++++++++++ src/resources/shared.ts | 206 ++++ src/resources/subscriptions.ts | 1083 ++++++++++++++++++--- 8 files changed, 2532 insertions(+), 132 deletions(-) diff --git a/.stats.yml b/.stats.yml index dfc5be99..f3bbb69b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 139 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb/orb-71d1ace393e7a2ded73e3c2ef9778c3dfefa88b0d4975f14f6c6d4cfd044e087.yml -openapi_spec_hash: a5c295712ca7eef32912a1ec1dfd4019 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb/orb-45297c0f1067cd444a30371110c69f876accf55f303a3dce9a4f74863b59f18f.yml +openapi_spec_hash: cd2f638b98c6e89342397fef860166b7 config_hash: c01c1191b1cd696c7ca855ff6d28a8df diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index 5ca22428..6d061c30 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -199,6 +199,7 @@ export namespace BetaCreatePlanVersionParams { | Shared.NewPlanPackageWithAllocationPrice | Shared.NewPlanUnitWithPercentPrice | Shared.NewPlanMatrixWithAllocationPrice + | AddPrice.NewPlanMatrixWithThresholdDiscountsPrice | AddPrice.NewPlanTieredWithProrationPrice | Shared.NewPlanUnitWithProrationPrice | Shared.NewPlanGroupedAllocationPrice @@ -512,6 +513,175 @@ export namespace BetaCreatePlanVersionParams { } } + export interface NewPlanMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewPlanMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewPlanMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewPlanTieredWithProrationPrice { /** * The cadence to bill for this price on. @@ -1556,6 +1726,7 @@ export namespace BetaCreatePlanVersionParams { | Shared.NewPlanPackageWithAllocationPrice | Shared.NewPlanUnitWithPercentPrice | Shared.NewPlanMatrixWithAllocationPrice + | ReplacePrice.NewPlanMatrixWithThresholdDiscountsPrice | ReplacePrice.NewPlanTieredWithProrationPrice | Shared.NewPlanUnitWithProrationPrice | Shared.NewPlanGroupedAllocationPrice @@ -1869,6 +2040,175 @@ export namespace BetaCreatePlanVersionParams { } } + export interface NewPlanMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewPlanMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewPlanMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewPlanTieredWithProrationPrice { /** * The cadence to bill for this price on. diff --git a/src/resources/beta/external-plan-id.ts b/src/resources/beta/external-plan-id.ts index 9687dd70..5ca00418 100644 --- a/src/resources/beta/external-plan-id.ts +++ b/src/resources/beta/external-plan-id.ts @@ -144,6 +144,7 @@ export namespace ExternalPlanIDCreatePlanVersionParams { | Shared.NewPlanPackageWithAllocationPrice | Shared.NewPlanUnitWithPercentPrice | Shared.NewPlanMatrixWithAllocationPrice + | AddPrice.NewPlanMatrixWithThresholdDiscountsPrice | AddPrice.NewPlanTieredWithProrationPrice | Shared.NewPlanUnitWithProrationPrice | Shared.NewPlanGroupedAllocationPrice @@ -457,6 +458,175 @@ export namespace ExternalPlanIDCreatePlanVersionParams { } } + export interface NewPlanMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewPlanMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewPlanMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewPlanTieredWithProrationPrice { /** * The cadence to bill for this price on. @@ -1501,6 +1671,7 @@ export namespace ExternalPlanIDCreatePlanVersionParams { | Shared.NewPlanPackageWithAllocationPrice | Shared.NewPlanUnitWithPercentPrice | Shared.NewPlanMatrixWithAllocationPrice + | ReplacePrice.NewPlanMatrixWithThresholdDiscountsPrice | ReplacePrice.NewPlanTieredWithProrationPrice | Shared.NewPlanUnitWithProrationPrice | Shared.NewPlanGroupedAllocationPrice @@ -1814,6 +1985,175 @@ export namespace ExternalPlanIDCreatePlanVersionParams { } } + export interface NewPlanMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewPlanMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewPlanMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewPlanTieredWithProrationPrice { /** * The cadence to bill for this price on. diff --git a/src/resources/customers/credits/ledger.ts b/src/resources/customers/credits/ledger.ts index 527c308a..5ccd652c 100644 --- a/src/resources/customers/credits/ledger.ts +++ b/src/resources/customers/credits/ledger.ts @@ -177,11 +177,17 @@ export class Ledger extends APIResource { * ## Deducting Credits * * Orb allows you to deduct credits from a customer by creating an entry of type - * `decrement`. Orb matches the algorithm for automatic deductions for determining - * which credit blocks to decrement from. In the case that the deduction leads to - * multiple ledger entries, the response from this endpoint will be the final - * deduction. Orb also optionally allows specifying a description to assist with - * auditing. + * `decrement`. A `decrement` entry records credits as usage and immediately + * recognizes revenue at the block's `per_unit_cost_basis`. + * + * For most credit removals, use `void` (no revenue impact) or `expiration_change` + * (revenue recognized on expiration) instead. Only use `decrement` when credits + * were genuinely consumed outside of normal event ingestion. + * + * Orb matches the algorithm for automatic deductions for determining which credit + * blocks to decrement from. In the case that the deduction leads to multiple + * ledger entries, the response from this endpoint will be the final deduction. Orb + * also optionally allows specifying a description to assist with auditing. * * The following snippet illustrates a sample request body to decrement credits. * @@ -304,11 +310,17 @@ export class Ledger extends APIResource { * ## Deducting Credits * * Orb allows you to deduct credits from a customer by creating an entry of type - * `decrement`. Orb matches the algorithm for automatic deductions for determining - * which credit blocks to decrement from. In the case that the deduction leads to - * multiple ledger entries, the response from this endpoint will be the final - * deduction. Orb also optionally allows specifying a description to assist with - * auditing. + * `decrement`. A `decrement` entry records credits as usage and immediately + * recognizes revenue at the block's `per_unit_cost_basis`. + * + * For most credit removals, use `void` (no revenue impact) or `expiration_change` + * (revenue recognized on expiration) instead. Only use `decrement` when credits + * were genuinely consumed outside of normal event ingestion. + * + * Orb matches the algorithm for automatic deductions for determining which credit + * blocks to decrement from. In the case that the deduction leads to multiple + * ledger entries, the response from this endpoint will be the final deduction. Orb + * also optionally allows specifying a description to assist with auditing. * * The following snippet illustrates a sample request body to decrement credits. * diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index fbe64af1..89219a35 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -370,6 +370,7 @@ export namespace PlanCreateParams { | Shared.NewPlanPackageWithAllocationPrice | Shared.NewPlanUnitWithPercentPrice | Shared.NewPlanMatrixWithAllocationPrice + | Price.NewPlanMatrixWithThresholdDiscountsPrice | Price.NewPlanTieredWithProrationPrice | Shared.NewPlanUnitWithProrationPrice | Shared.NewPlanGroupedAllocationPrice @@ -683,6 +684,175 @@ export namespace PlanCreateParams { } } + export interface NewPlanMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewPlanMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewPlanMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewPlanTieredWithProrationPrice { /** * The cadence to bill for this price on. diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index 008c4e11..4c9b4784 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -331,6 +331,7 @@ export type PriceCreateParams = | PriceCreateParams.NewFloatingPackageWithAllocationPrice | PriceCreateParams.NewFloatingUnitWithPercentPrice | PriceCreateParams.NewFloatingMatrixWithAllocationPrice + | PriceCreateParams.NewFloatingMatrixWithThresholdDiscountsPrice | PriceCreateParams.NewFloatingTieredWithProrationPrice | PriceCreateParams.NewFloatingUnitWithProrationPrice | PriceCreateParams.NewFloatingGroupedAllocationPrice @@ -1979,6 +1980,168 @@ export declare namespace PriceCreateParams { metadata?: { [key: string]: string | null } | null; } + export interface NewFloatingMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewFloatingMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + } + + export namespace NewFloatingMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewFloatingTieredWithProrationPrice { /** * The cadence to bill for this price on. @@ -4604,6 +4767,7 @@ export namespace PriceEvaluateMultipleParams { | Shared.NewFloatingPackageWithAllocationPrice | Shared.NewFloatingUnitWithPercentPrice | Shared.NewFloatingMatrixWithAllocationPrice + | PriceEvaluation.NewFloatingMatrixWithThresholdDiscountsPrice | Shared.NewFloatingTieredWithProrationPrice | Shared.NewFloatingUnitWithProrationPrice | Shared.NewFloatingGroupedAllocationPrice @@ -4780,6 +4944,168 @@ export namespace PriceEvaluateMultipleParams { } } + export interface NewFloatingMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewFloatingMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + } + + export namespace NewFloatingMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewFloatingGroupedWithMinMaxThresholdsPrice { /** * The cadence to bill for this price on. @@ -5670,6 +5996,7 @@ export namespace PriceEvaluatePreviewEventsParams { | Shared.NewFloatingPackageWithAllocationPrice | Shared.NewFloatingUnitWithPercentPrice | Shared.NewFloatingMatrixWithAllocationPrice + | PriceEvaluation.NewFloatingMatrixWithThresholdDiscountsPrice | Shared.NewFloatingTieredWithProrationPrice | Shared.NewFloatingUnitWithProrationPrice | Shared.NewFloatingGroupedAllocationPrice @@ -5846,6 +6173,168 @@ export namespace PriceEvaluatePreviewEventsParams { } } + export interface NewFloatingMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewFloatingMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + } + + export namespace NewFloatingMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewFloatingGroupedWithMinMaxThresholdsPrice { /** * The cadence to bill for this price on. diff --git a/src/resources/shared.ts b/src/resources/shared.ts index dc0485a9..943a4182 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -10107,6 +10107,7 @@ export type Price = | Price.PackageWithAllocationPrice | Price.UnitWithPercentPrice | Price.MatrixWithAllocationPrice + | Price.MatrixWithThresholdDiscountsPrice | Price.TieredWithProrationPrice | Price.UnitWithProrationPrice | Price.GroupedAllocationPrice @@ -12369,6 +12370,211 @@ export namespace Price { } } + export interface MatrixWithThresholdDiscountsPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + billing_mode: 'in_advance' | 'in_arrear'; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + composite_price_filters: Array | null; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoice_grouping_key: string | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ + item: Shared.ItemSlim; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: MatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: { [key: string]: string }; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price' | 'composite_price'; + + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: MatrixWithThresholdDiscountsPrice.LicenseType | null; + } + + export namespace MatrixWithThresholdDiscountsPrice { + export interface CompositePriceFilter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } + } + export interface TieredWithProrationPrice { id: string; diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 6d1abb20..2cdbadf6 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -5048,6 +5048,7 @@ export namespace SubscriptionCreateParams { | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | AddPrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | AddPrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice @@ -5238,6 +5239,175 @@ export namespace SubscriptionCreateParams { } } + export interface NewSubscriptionMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewSubscriptionMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewSubscriptionTieredWithProrationPrice { /** * The cadence to bill for this price on. @@ -6296,6 +6466,7 @@ export namespace SubscriptionCreateParams { | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | ReplacePrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | ReplacePrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice @@ -6479,7 +6650,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredWithProrationPrice { + export interface NewSubscriptionMatrixWithThresholdDiscountsPrice { /** * The cadence to bill for this price on. */ @@ -6491,19 +6662,19 @@ export namespace SubscriptionCreateParams { item_id: string; /** - * The pricing model type + * Configuration for matrix_with_threshold_discounts pricing */ - model_type: 'tiered_with_proration'; + matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; /** - * The name of the price. + * The pricing model type */ - name: string; + model_type: 'matrix_with_threshold_discounts'; /** - * Configuration for tiered_with_proration pricing + * The name of the price. */ - tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig; + name: string; /** * The id of the billable metric for the price. Only needed if the price is @@ -6585,47 +6756,75 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithProrationPrice { + export namespace NewSubscriptionMatrixWithThresholdDiscountsPrice { /** - * Configuration for tiered_with_proration pricing + * Configuration for matrix_with_threshold_discounts pricing */ - export interface TieredWithProrationConfig { + export interface MatrixWithThresholdDiscountsConfig { /** - * Tiers for rating based on total usage quantities into the specified tier with - * proration + * Unit price used for usage that does not match any defined matrix cell. */ - tiers: Array; - } + default_unit_amount: string; - export namespace TieredWithProrationConfig { /** - * Configuration for a single tiered with proration tier + * First matrix dimension key. */ - export interface Tier { + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { /** - * Inclusive tier starting value + * Discount rate applied to spend above the threshold. */ - tier_lower_bound: string; + above_threshold_discount_percentage: string; /** - * Amount per unit + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. */ - unit_amount: string; + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; } } } - export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice { + export interface NewSubscriptionTieredWithProrationPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * Configuration for grouped_with_min_max_thresholds pricing - */ - grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; - /** * The id of the item the price will be associated with. */ @@ -6634,13 +6833,18 @@ export namespace SubscriptionCreateParams { /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'tiered_with_proration'; /** * The name of the price. */ name: string; + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -6721,43 +6925,46 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice { + export namespace NewSubscriptionTieredWithProrationPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for tiered_with_proration pricing */ - export interface GroupedWithMinMaxThresholdsConfig { - /** - * The event property used to group before applying thresholds - */ - grouping_key: string; - + export interface TieredWithProrationConfig { /** - * The maximum amount to charge each group + * Tiers for rating based on total usage quantities into the specified tier with + * proration */ - maximum_charge: string; + tiers: Array; + } + export namespace TieredWithProrationConfig { /** - * The minimum amount to charge each group, regardless of usage + * Configuration for a single tiered with proration tier */ - minimum_charge: string; + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; - /** - * The base price charged per group - */ - per_unit_rate: string; + /** + * Amount per unit + */ + unit_amount: string; + } } } - export interface NewSubscriptionCumulativeGroupedAllocationPrice { + export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for cumulative_grouped_allocation pricing + * Configuration for grouped_with_min_max_thresholds pricing */ - cumulative_grouped_allocation_config: NewSubscriptionCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; /** * The id of the item the price will be associated with. @@ -6767,7 +6974,7 @@ export namespace SubscriptionCreateParams { /** * The pricing model type */ - model_type: 'cumulative_grouped_allocation'; + model_type: 'grouped_with_min_max_thresholds'; /** * The name of the price. @@ -6854,23 +7061,156 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionCumulativeGroupedAllocationPrice { + export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice { /** - * Configuration for cumulative_grouped_allocation pricing + * Configuration for grouped_with_min_max_thresholds pricing */ - export interface CumulativeGroupedAllocationConfig { + export interface GroupedWithMinMaxThresholdsConfig { /** - * The overall allocation across all groups + * The event property used to group before applying thresholds */ - cumulative_allocation: string; + grouping_key: string; /** - * The allocation per individual group + * The maximum amount to charge each group */ - group_allocation: string; + maximum_charge: string; /** - * The event property used to group usage before applying allocations + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + } + + export interface NewSubscriptionCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewSubscriptionCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'cumulative_grouped_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewSubscriptionCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations */ grouping_key: string; @@ -7720,6 +8060,7 @@ export namespace SubscriptionPriceIntervalsParams { | Shared.NewFloatingPackageWithAllocationPrice | Shared.NewFloatingUnitWithPercentPrice | Shared.NewFloatingMatrixWithAllocationPrice + | Add.NewFloatingMatrixWithThresholdDiscountsPrice | Shared.NewFloatingTieredWithProrationPrice | Shared.NewFloatingUnitWithProrationPrice | Shared.NewFloatingGroupedAllocationPrice @@ -7947,7 +8288,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedWithMinMaxThresholdsPrice { + export interface NewFloatingMatrixWithThresholdDiscountsPrice { /** * The cadence to bill for this price on. */ @@ -7959,19 +8300,19 @@ export namespace SubscriptionPriceIntervalsParams { currency: string; /** - * Configuration for grouped_with_min_max_thresholds pricing + * The id of the item the price will be associated with. */ - grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + item_id: string; /** - * The id of the item the price will be associated with. + * Configuration for matrix_with_threshold_discounts pricing */ - item_id: string; + matrix_with_threshold_discounts_config: NewFloatingMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'matrix_with_threshold_discounts'; /** * The name of the price. @@ -8046,48 +8387,84 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: { [key: string]: string | null } | null; } - export namespace NewFloatingGroupedWithMinMaxThresholdsPrice { + export namespace NewFloatingMatrixWithThresholdDiscountsPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for matrix_with_threshold_discounts pricing */ - export interface GroupedWithMinMaxThresholdsConfig { + export interface MatrixWithThresholdDiscountsConfig { /** - * The event property used to group before applying thresholds + * Unit price used for usage that does not match any defined matrix cell. */ - grouping_key: string; + default_unit_amount: string; /** - * The maximum amount to charge each group + * First matrix dimension key. */ - maximum_charge: string; + first_dimension: string; /** - * The minimum amount to charge each group, regardless of usage + * Per-cell unit prices. */ - minimum_charge: string; + matrix_values: Array; /** - * The base price charged per group + * Optional second matrix dimension key. */ - per_unit_rate: string; + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } } } - export interface NewFloatingCumulativeGroupedAllocationPrice { + export interface NewFloatingGroupedWithMinMaxThresholdsPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for cumulative_grouped_allocation pricing + * An ISO 4217 currency string for which this price is billed in. */ - cumulative_grouped_allocation_config: NewFloatingCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + currency: string; /** - * An ISO 4217 currency string for which this price is billed in. + * Configuration for grouped_with_min_max_thresholds pricing */ - currency: string; + grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; /** * The id of the item the price will be associated with. @@ -8097,7 +8474,7 @@ export namespace SubscriptionPriceIntervalsParams { /** * The pricing model type */ - model_type: 'cumulative_grouped_allocation'; + model_type: 'grouped_with_min_max_thresholds'; /** * The name of the price. @@ -8172,48 +8549,48 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: { [key: string]: string | null } | null; } - export namespace NewFloatingCumulativeGroupedAllocationPrice { + export namespace NewFloatingGroupedWithMinMaxThresholdsPrice { /** - * Configuration for cumulative_grouped_allocation pricing + * Configuration for grouped_with_min_max_thresholds pricing */ - export interface CumulativeGroupedAllocationConfig { + export interface GroupedWithMinMaxThresholdsConfig { /** - * The overall allocation across all groups + * The event property used to group before applying thresholds */ - cumulative_allocation: string; + grouping_key: string; /** - * The allocation per individual group + * The maximum amount to charge each group */ - group_allocation: string; + maximum_charge: string; /** - * The event property used to group usage before applying allocations + * The minimum amount to charge each group, regardless of usage */ - grouping_key: string; + minimum_charge: string; /** - * The amount to charge for each unit outside of the allocation + * The base price charged per group */ - unit_amount: string; + per_unit_rate: string; } } - export interface NewFloatingDailyCreditAllowancePrice { + export interface NewFloatingCumulativeGroupedAllocationPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * An ISO 4217 currency string for which this price is billed in. + * Configuration for cumulative_grouped_allocation pricing */ - currency: string; + cumulative_grouped_allocation_config: NewFloatingCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; /** - * Configuration for daily_credit_allowance pricing + * An ISO 4217 currency string for which this price is billed in. */ - daily_credit_allowance_config: NewFloatingDailyCreditAllowancePrice.DailyCreditAllowanceConfig; + currency: string; /** * The id of the item the price will be associated with. @@ -8223,7 +8600,7 @@ export namespace SubscriptionPriceIntervalsParams { /** * The pricing model type */ - model_type: 'daily_credit_allowance'; + model_type: 'cumulative_grouped_allocation'; /** * The name of the price. @@ -8298,45 +8675,171 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: { [key: string]: string | null } | null; } - export namespace NewFloatingDailyCreditAllowancePrice { + export namespace NewFloatingCumulativeGroupedAllocationPrice { /** - * Configuration for daily_credit_allowance pricing + * Configuration for cumulative_grouped_allocation pricing */ - export interface DailyCreditAllowanceConfig { - /** - * Credits granted per day. Lose-it-or-use-it; does not roll over. - */ - daily_allowance: string; - + export interface CumulativeGroupedAllocationConfig { /** - * Default per-unit credit rate for any usage not bucketed into a specified - * matrix_value + * The overall allocation across all groups */ - default_unit_amount: string; + cumulative_allocation: string; /** - * One or two event property values to evaluate matrix groups by + * The allocation per individual group */ - dimensions: Array; + group_allocation: string; /** - * Event property whose value identifies the day bucket the event belongs to (e.g. - * 'event_day' set to an ISO date string in the customer's timezone). The allowance - * resets per distinct value of this property. + * The event property used to group usage before applying allocations */ - event_day_property: string; + grouping_key: string; /** - * Per-dimension credit rates + * The amount to charge for each unit outside of the allocation */ - matrix_values: Array; + unit_amount: string; } + } - export namespace DailyCreditAllowanceConfig { - /** - * Per-dimension credit price for the daily credit allowance model. - */ - export interface MatrixValue { + export interface NewFloatingDailyCreditAllowancePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * Configuration for daily_credit_allowance pricing + */ + daily_credit_allowance_config: NewFloatingDailyCreditAllowancePrice.DailyCreditAllowanceConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'daily_credit_allowance'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + } + + export namespace NewFloatingDailyCreditAllowancePrice { + /** + * Configuration for daily_credit_allowance pricing + */ + export interface DailyCreditAllowanceConfig { + /** + * Credits granted per day. Lose-it-or-use-it; does not roll over. + */ + daily_allowance: string; + + /** + * Default per-unit credit rate for any usage not bucketed into a specified + * matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Event property whose value identifies the day bucket the event belongs to (e.g. + * 'event_day' set to an ISO date string in the customer's timezone). The allowance + * resets per distinct value of this property. + */ + event_day_property: string; + + /** + * Per-dimension credit rates + */ + matrix_values: Array; + } + + export namespace DailyCreditAllowanceConfig { + /** + * Per-dimension credit price for the daily credit allowance model. + */ + export interface MatrixValue { /** * One or two matrix keys to filter usage to this value by. For example, ["model"] * could be used to apply a different credit rate to each AI model. @@ -9145,6 +9648,7 @@ export namespace SubscriptionSchedulePlanChangeParams { | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | AddPrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | AddPrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice @@ -9335,6 +9839,175 @@ export namespace SubscriptionSchedulePlanChangeParams { } } + export interface NewSubscriptionMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewSubscriptionMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewSubscriptionTieredWithProrationPrice { /** * The cadence to bill for this price on. @@ -10393,6 +11066,7 @@ export namespace SubscriptionSchedulePlanChangeParams { | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | ReplacePrice.NewSubscriptionMatrixWithThresholdDiscountsPrice | ReplacePrice.NewSubscriptionTieredWithProrationPrice | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice @@ -10576,6 +11250,175 @@ export namespace SubscriptionSchedulePlanChangeParams { } } + export interface NewSubscriptionMatrixWithThresholdDiscountsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + matrix_with_threshold_discounts_config: NewSubscriptionMatrixWithThresholdDiscountsPrice.MatrixWithThresholdDiscountsConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_threshold_discounts'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The ID of the license type to associate with this price. + */ + license_type_id?: string | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } + + export namespace NewSubscriptionMatrixWithThresholdDiscountsPrice { + /** + * Configuration for matrix_with_threshold_discounts pricing + */ + export interface MatrixWithThresholdDiscountsConfig { + /** + * Unit price used for usage that does not match any defined matrix cell. + */ + default_unit_amount: string; + + /** + * First matrix dimension key. + */ + first_dimension: string; + + /** + * Per-cell unit prices. + */ + matrix_values: Array; + + /** + * Optional second matrix dimension key. + */ + second_dimension?: string | null; + + threshold_discount_groups?: Array; + } + + export namespace MatrixWithThresholdDiscountsConfig { + export interface MatrixValue { + first_dimension_value: string; + + unit_amount: string; + + second_dimension_value?: string | null; + } + + export interface ThresholdDiscountGroup { + /** + * Discount rate applied to spend above the threshold. + */ + above_threshold_discount_percentage: string; + + /** + * Discount rate applied to spend at or below the threshold. Set to 0 for no + * baseline discount. + */ + below_threshold_discount_percentage: string; + + /** + * Semicolon-separated list of matrix cell coordinates targeted by this group. Each + * coordinate is `first,second` when the matrix has two dimensions, or just `first` + * for a single-dimension matrix. Example: `blue,circle;green,triangle`. + */ + cell_coordinates: string; + + threshold_amount: string; + + description?: string | null; + } + } + } + export interface NewSubscriptionTieredWithProrationPrice { /** * The cadence to bill for this price on. From 4d3a855752594a372fdd9d7960298d3eccff54d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 23:14:51 +0000 Subject: [PATCH 2/2] release: 5.63.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 01429603..06a74c3c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.62.0" + ".": "5.63.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f400d42..9e3c5c53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 5.63.0 (2026-05-22) + +Full Changelog: [v5.62.0...v5.63.0](https://github.com/orbcorp/orb-node/compare/v5.62.0...v5.63.0) + +### Features + +* **api:** api update ([715040d](https://github.com/orbcorp/orb-node/commit/715040d77d726c501d629eab96413dc10264d526)) + ## 5.62.0 (2026-05-21) Full Changelog: [v5.61.0...v5.62.0](https://github.com/orbcorp/orb-node/compare/v5.61.0...v5.62.0) diff --git a/package.json b/package.json index bb0b861c..0daa35de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "5.62.0", + "version": "5.63.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 08476d69..e31619e0 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.62.0'; // x-release-please-version +export const VERSION = '5.63.0'; // x-release-please-version