diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 83fd1e7d..a0c8c3e1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.15.0" + ".": "5.16.0" } diff --git a/.stats.yml b/.stats.yml index fd40002f..3407ffd1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-26020bd285825dac04bf642a414ea07c786fc6e42ee6bbcf795e11f8db426519.yml -openapi_spec_hash: 897fedec83f0960539b3aa4ec0e3308d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-b070c1d97a6e3b400f43d2bce36c22ed89d432345b26374728c55dd0a20f0afa.yml +openapi_spec_hash: dba4ff52c381cda6159fc56d8b77eb32 config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 332c31b9..fb24fe39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 5.16.0 (2025-10-07) + +Full Changelog: [v5.15.0...v5.16.0](https://github.com/orbcorp/orb-node/compare/v5.15.0...v5.16.0) + +### Features + +* **api:** api update ([9e9ba52](https://github.com/orbcorp/orb-node/commit/9e9ba528654c5b9ef47f9c1d8570a4556e59aadc)) +* **api:** api update ([bf101c9](https://github.com/orbcorp/orb-node/commit/bf101c9a8209099a5b473aba16fed43682b8c324)) + + +### Chores + +* **internal:** use npm pack for build uploads ([8c41138](https://github.com/orbcorp/orb-node/commit/8c41138e7293e46a6f8335a58b153965b9901053)) + ## 5.15.0 (2025-10-03) Full Changelog: [v5.14.0...v5.15.0](https://github.com/orbcorp/orb-node/compare/v5.14.0...v5.15.0) diff --git a/package.json b/package.json index 272bb410..03cae95d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "5.15.0", + "version": "5.16.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 56d2e44c..a99e82e4 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index d3011a61..25010120 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -208,6 +208,8 @@ export namespace BetaCreatePlanVersionParams { | Shared.NewPlanScalableMatrixWithTieredPricingPrice | Shared.NewPlanCumulativeGroupedBulkPrice | Shared.NewPlanMinimumCompositePrice + | AddPrice.NewPlanPercentCompositePrice + | AddPrice.NewPlanEventOutputPrice | null; } @@ -470,6 +472,238 @@ export namespace BetaCreatePlanVersionParams { per_unit_rate: string; } } + + export interface NewPlanPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } export interface RemoveAdjustment { @@ -565,6 +799,8 @@ export namespace BetaCreatePlanVersionParams { | Shared.NewPlanScalableMatrixWithTieredPricingPrice | Shared.NewPlanCumulativeGroupedBulkPrice | Shared.NewPlanMinimumCompositePrice + | ReplacePrice.NewPlanPercentCompositePrice + | ReplacePrice.NewPlanEventOutputPrice | null; } @@ -827,6 +1063,238 @@ export namespace BetaCreatePlanVersionParams { per_unit_rate: string; } } + + export interface NewPlanPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } } diff --git a/src/resources/beta/external-plan-id.ts b/src/resources/beta/external-plan-id.ts index 5fe9e4e3..3281106e 100644 --- a/src/resources/beta/external-plan-id.ts +++ b/src/resources/beta/external-plan-id.ts @@ -153,6 +153,8 @@ export namespace ExternalPlanIDCreatePlanVersionParams { | Shared.NewPlanScalableMatrixWithTieredPricingPrice | Shared.NewPlanCumulativeGroupedBulkPrice | Shared.NewPlanMinimumCompositePrice + | AddPrice.NewPlanPercentCompositePrice + | AddPrice.NewPlanEventOutputPrice | null; } @@ -415,6 +417,238 @@ export namespace ExternalPlanIDCreatePlanVersionParams { per_unit_rate: string; } } + + export interface NewPlanPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } export interface RemoveAdjustment { @@ -510,6 +744,8 @@ export namespace ExternalPlanIDCreatePlanVersionParams { | Shared.NewPlanScalableMatrixWithTieredPricingPrice | Shared.NewPlanCumulativeGroupedBulkPrice | Shared.NewPlanMinimumCompositePrice + | ReplacePrice.NewPlanPercentCompositePrice + | ReplacePrice.NewPlanEventOutputPrice | null; } @@ -772,6 +1008,238 @@ export namespace ExternalPlanIDCreatePlanVersionParams { per_unit_rate: string; } } + + export interface NewPlanPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } } diff --git a/src/resources/items.ts b/src/resources/items.ts index 295b8f69..65ea0ca3 100644 --- a/src/resources/items.ts +++ b/src/resources/items.ts @@ -59,10 +59,20 @@ export class ItemsPage extends Page {} * external sync behavior for invoices and tax calculation purposes. */ export interface Item { + /** + * The Orb-assigned unique identifier for the item. + */ id: string; + /** + * The time at which the item was created. + */ created_at: string; + /** + * A list of external connections for this item, used to sync with external + * invoicing and tax systems. + */ external_connections: Array; /** @@ -73,11 +83,26 @@ export interface Item { */ metadata: { [key: string]: string }; + /** + * The name of the item. + */ name: string; + + /** + * The time at which the item was archived. If null, the item is not archived. + */ + archived_at?: string | null; } export namespace Item { + /** + * Represents a connection between an Item and an external system for invoicing or + * tax calculation purposes. + */ export interface ExternalConnection { + /** + * The name of the external system this item is connected to. + */ external_connection_name: | 'stripe' | 'quickbooks' @@ -88,6 +113,9 @@ export namespace Item { | 'anrok' | 'numeral'; + /** + * The identifier of this item in the external system. + */ external_entity_id: string; } } @@ -120,7 +148,14 @@ export interface ItemUpdateParams { } export namespace ItemUpdateParams { + /** + * Represents a connection between an Item and an external system for invoicing or + * tax calculation purposes. + */ export interface ExternalConnection { + /** + * The name of the external system this item is connected to. + */ external_connection_name: | 'stripe' | 'quickbooks' @@ -131,6 +166,9 @@ export namespace ItemUpdateParams { | 'anrok' | 'numeral'; + /** + * The identifier of this item in the external system. + */ external_entity_id: string; } } diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index 187d0eb6..0f6ace63 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -350,6 +350,8 @@ export namespace PlanCreateParams { | Shared.NewPlanScalableMatrixWithTieredPricingPrice | Shared.NewPlanCumulativeGroupedBulkPrice | Shared.NewPlanMinimumCompositePrice + | Price.NewPlanPercentCompositePrice + | Price.NewPlanEventOutputPrice | null; } @@ -612,6 +614,238 @@ export namespace PlanCreateParams { per_unit_rate: string; } } + + export interface NewPlanPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } export interface Adjustment { diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index 37c06497..1025a547 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -280,7 +280,9 @@ export type PriceCreateParams = | PriceCreateParams.NewFloatingScalableMatrixWithUnitPricingPrice | PriceCreateParams.NewFloatingScalableMatrixWithTieredPricingPrice | PriceCreateParams.NewFloatingCumulativeGroupedBulkPrice - | PriceCreateParams.NewFloatingMinimumCompositePrice; + | PriceCreateParams.NewFloatingMinimumCompositePrice + | PriceCreateParams.NewFloatingPercentCompositePrice + | PriceCreateParams.NewFloatingEventOutputPrice; export declare namespace PriceCreateParams { export interface NewFloatingUnitPrice { @@ -3556,6 +3558,224 @@ export declare namespace PriceCreateParams { prorated?: boolean; } } + + export interface NewFloatingPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewFloatingPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewFloatingPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewFloatingEventOutputPrice { + /** + * 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 event_output pricing + */ + event_output_config: NewFloatingEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewFloatingEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } export interface PriceUpdateParams { @@ -3684,16 +3904,245 @@ export namespace PriceEvaluateMultipleParams { | Shared.NewFloatingScalableMatrixWithTieredPricingPrice | Shared.NewFloatingCumulativeGroupedBulkPrice | Shared.NewFloatingMinimumCompositePrice + | PriceEvaluation.NewFloatingPercentCompositePrice + | PriceEvaluation.NewFloatingEventOutputPrice | null; - /** - * The ID of a price to evaluate that exists in your Orb account. - */ - price_id?: string | null; - } + /** + * The ID of a price to evaluate that exists in your Orb account. + */ + price_id?: string | null; + } + + export namespace PriceEvaluation { + export interface NewFloatingGroupedWithMinMaxThresholdsPrice { + /** + * 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 grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * 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; + + /** + * 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 NewFloatingGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * 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 NewFloatingPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewFloatingPercentCompositePrice.PercentConfig; + + /** + * 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; - export namespace PriceEvaluation { - export interface NewFloatingGroupedWithMinMaxThresholdsPrice { + /** + * 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; + + /** + * 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 NewFloatingPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewFloatingEventOutputPrice { /** * The cadence to bill for this price on. */ @@ -3705,9 +4154,9 @@ export namespace PriceEvaluateMultipleParams { currency: string; /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for event_output pricing */ - grouped_with_min_max_thresholds_config: NewFloatingGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + event_output_config: NewFloatingEventOutputPrice.EventOutputConfig; /** * The id of the item the price will be associated with. @@ -3717,7 +4166,7 @@ export namespace PriceEvaluateMultipleParams { /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'event_output'; /** * The name of the price. @@ -3787,30 +4236,21 @@ export namespace PriceEvaluateMultipleParams { metadata?: { [key: string]: string | null } | null; } - export namespace NewFloatingGroupedWithMinMaxThresholdsPrice { + export namespace NewFloatingEventOutputPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for event_output pricing */ - export interface GroupedWithMinMaxThresholdsConfig { - /** - * The event property used to group before applying thresholds - */ - grouping_key: string; - - /** - * The maximum amount to charge each group - */ - maximum_charge: string; - + export interface EventOutputConfig { /** - * The minimum amount to charge each group, regardless of usage + * The key in the event data to extract the unit rate from. */ - minimum_charge: string; + unit_rating_key: string; /** - * The base price charged per group + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. */ - per_unit_rate: string; + grouping_key?: string | null; } } } @@ -3931,6 +4371,8 @@ export namespace PriceEvaluatePreviewEventsParams { | Shared.NewFloatingScalableMatrixWithTieredPricingPrice | Shared.NewFloatingCumulativeGroupedBulkPrice | Shared.NewFloatingMinimumCompositePrice + | PriceEvaluation.NewFloatingPercentCompositePrice + | PriceEvaluation.NewFloatingEventOutputPrice | null; /** @@ -4060,6 +4502,224 @@ export namespace PriceEvaluatePreviewEventsParams { per_unit_rate: string; } } + + export interface NewFloatingPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewFloatingPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewFloatingPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewFloatingEventOutputPrice { + /** + * 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 event_output pricing + */ + event_output_config: NewFloatingEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewFloatingEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 1871be3d..4d3a85a3 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -2097,9 +2097,19 @@ export interface InvoiceTiny { id: string; } +/** + * A minimal representation of an Item containing only the essential identifying + * information. + */ export interface ItemSlim { + /** + * The Orb-assigned unique identifier for the item. + */ id: string; + /** + * The name of the item. + */ name: string; } @@ -9533,7 +9543,9 @@ export type Price = | Price.ScalableMatrixWithUnitPricingPrice | Price.ScalableMatrixWithTieredPricingPrice | Price.CumulativeGroupedBulkPrice - | Price.MinimumCompositePrice; + | Price.MinimumCompositePrice + | Price.PercentCompositePrice + | Price.EventOutputPrice; export namespace Price { export interface UnitPrice { @@ -9570,6 +9582,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -9659,6 +9675,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -9753,6 +9773,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -9837,6 +9861,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -9926,6 +9954,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10015,6 +10047,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10139,6 +10175,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10265,6 +10305,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10404,6 +10448,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10523,6 +10571,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10652,6 +10704,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10763,6 +10819,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10869,6 +10929,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -10958,6 +11022,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11077,6 +11145,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11183,6 +11255,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11294,6 +11370,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11412,6 +11492,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11523,6 +11607,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11683,6 +11771,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11794,6 +11886,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -11927,6 +12023,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -12051,6 +12151,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -12179,6 +12283,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -12322,6 +12430,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -12480,6 +12592,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -12603,6 +12719,10 @@ export namespace Price { invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ item: Shared.ItemSlim; /** @@ -12674,6 +12794,222 @@ export namespace Price { prorated?: boolean; } } + + export interface PercentCompositePrice { + 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; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ + item: Shared.ItemSlim; + + /** + * @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: 'percent'; + + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: PercentCompositePrice.PercentConfig; + + 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; + } + + export namespace PercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface EventOutputPrice { + 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; + + /** + * Configuration for event_output pricing + */ + event_output_config: EventOutputPrice.EventOutputConfig; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + /** + * A minimal representation of an Item containing only the essential identifying + * information. + */ + item: Shared.ItemSlim; + + /** + * @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: 'event_output'; + + 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; + } + + export namespace EventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } /** diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 085823a5..0d387cc9 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -4869,6 +4869,8 @@ export namespace SubscriptionCreateParams { | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice + | AddPrice.NewSubscriptionPercentCompositePrice + | AddPrice.NewSubscriptionEventOutputPrice | null; /** @@ -5143,6 +5145,238 @@ export namespace SubscriptionCreateParams { per_unit_rate: string; } } + + export interface NewSubscriptionPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewSubscriptionPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewSubscriptionPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewSubscriptionEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewSubscriptionEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } export interface RemoveAdjustment { @@ -5251,6 +5485,8 @@ export namespace SubscriptionCreateParams { | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice + | ReplacePrice.NewSubscriptionPercentCompositePrice + | ReplacePrice.NewSubscriptionEventOutputPrice | null; /** @@ -5259,8 +5495,267 @@ export namespace SubscriptionCreateParams { price_id?: string | null; } - export namespace ReplacePrice { - export interface NewSubscriptionTieredWithProrationPrice { + export namespace ReplacePrice { + export interface NewSubscriptionTieredWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + 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. + */ + 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; + + /** + * 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 NewSubscriptionTieredWithProrationPrice { + /** + * Configuration for tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice { + /** + * 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. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * 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; + + /** + * 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 NewSubscriptionGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * 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 NewSubscriptionPercentCompositePrice { /** * The cadence to bill for this price on. */ @@ -5274,7 +5769,7 @@ export namespace SubscriptionCreateParams { /** * The pricing model type */ - model_type: 'tiered_with_proration'; + model_type: 'percent'; /** * The name of the price. @@ -5282,9 +5777,9 @@ export namespace SubscriptionCreateParams { name: string; /** - * Configuration for tiered_with_proration pricing + * Configuration for percent pricing */ - tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig; + percent_config: NewSubscriptionPercentCompositePrice.PercentConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -5361,46 +5856,28 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithProrationPrice { + export namespace NewSubscriptionPercentCompositePrice { /** - * Configuration for tiered_with_proration pricing + * Configuration for percent pricing */ - export interface TieredWithProrationConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier with - * proration - */ - tiers: Array; - } - - export namespace TieredWithProrationConfig { + export interface PercentConfig { /** - * Configuration for a single tiered with proration tier + * What percent of the component subtotals to charge */ - export interface Tier { - /** - * Inclusive tier starting value - */ - tier_lower_bound: string; - - /** - * Amount per unit - */ - unit_amount: string; - } + percent: number; } } - export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice { + export interface NewSubscriptionEventOutputPrice { /** * 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 + * Configuration for event_output pricing */ - grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig; /** * The id of the item the price will be associated with. @@ -5410,7 +5887,7 @@ export namespace SubscriptionCreateParams { /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'event_output'; /** * The name of the price. @@ -5492,30 +5969,21 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice { + export namespace NewSubscriptionEventOutputPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for event_output pricing */ - export interface GroupedWithMinMaxThresholdsConfig { - /** - * The event property used to group before applying thresholds - */ - grouping_key: string; - - /** - * The maximum amount to charge each group - */ - maximum_charge: string; - + export interface EventOutputConfig { /** - * The minimum amount to charge each group, regardless of usage + * The key in the event data to extract the unit rate from. */ - minimum_charge: string; + unit_rating_key: string; /** - * The base price charged per group + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. */ - per_unit_rate: string; + grouping_key?: string | null; } } } @@ -5796,6 +6264,8 @@ export namespace SubscriptionPriceIntervalsParams { | Shared.NewFloatingScalableMatrixWithTieredPricingPrice | Shared.NewFloatingCumulativeGroupedBulkPrice | Shared.NewFloatingMinimumCompositePrice + | Add.NewFloatingPercentCompositePrice + | Add.NewFloatingEventOutputPrice | null; /** @@ -5976,6 +6446,224 @@ export namespace SubscriptionPriceIntervalsParams { per_unit_rate: string; } } + + export interface NewFloatingPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewFloatingPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewFloatingPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewFloatingEventOutputPrice { + /** + * 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 event_output pricing + */ + event_output_config: NewFloatingEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewFloatingEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } export interface AddAdjustment { @@ -6389,6 +7077,8 @@ export namespace SubscriptionSchedulePlanChangeParams { | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice + | AddPrice.NewSubscriptionPercentCompositePrice + | AddPrice.NewSubscriptionEventOutputPrice | null; /** @@ -6429,7 +7119,266 @@ export namespace SubscriptionSchedulePlanChangeParams { /** * Configuration for tiered_with_proration pricing */ - tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig; + tiered_with_proration_config: NewSubscriptionTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * 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; + + /** + * 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 NewSubscriptionTieredWithProrationPrice { + /** + * Configuration for tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice { + /** + * 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. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * 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; + + /** + * 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 NewSubscriptionGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * 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 NewSubscriptionPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewSubscriptionPercentCompositePrice.PercentConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -6506,46 +7455,28 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithProrationPrice { + export namespace NewSubscriptionPercentCompositePrice { /** - * Configuration for tiered_with_proration pricing + * Configuration for percent pricing */ - export interface TieredWithProrationConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier with - * proration - */ - tiers: Array; - } - - export namespace TieredWithProrationConfig { + export interface PercentConfig { /** - * Configuration for a single tiered with proration tier + * What percent of the component subtotals to charge */ - export interface Tier { - /** - * Inclusive tier starting value - */ - tier_lower_bound: string; - - /** - * Amount per unit - */ - unit_amount: string; - } + percent: number; } } - export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice { + export interface NewSubscriptionEventOutputPrice { /** * 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 + * Configuration for event_output pricing */ - grouped_with_min_max_thresholds_config: NewSubscriptionGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig; /** * The id of the item the price will be associated with. @@ -6555,7 +7486,7 @@ export namespace SubscriptionSchedulePlanChangeParams { /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'event_output'; /** * The name of the price. @@ -6637,30 +7568,21 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithMinMaxThresholdsPrice { + export namespace NewSubscriptionEventOutputPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for event_output pricing */ - export interface GroupedWithMinMaxThresholdsConfig { - /** - * The event property used to group before applying thresholds - */ - grouping_key: string; - - /** - * The maximum amount to charge each group - */ - maximum_charge: string; - + export interface EventOutputConfig { /** - * The minimum amount to charge each group, regardless of usage + * The key in the event data to extract the unit rate from. */ - minimum_charge: string; + unit_rating_key: string; /** - * The base price charged per group + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. */ - per_unit_rate: string; + grouping_key?: string | null; } } } @@ -6771,6 +7693,8 @@ export namespace SubscriptionSchedulePlanChangeParams { | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice | SubscriptionsAPI.NewSubscriptionMinimumCompositePrice + | ReplacePrice.NewSubscriptionPercentCompositePrice + | ReplacePrice.NewSubscriptionEventOutputPrice | null; /** @@ -7038,6 +7962,238 @@ export namespace SubscriptionSchedulePlanChangeParams { per_unit_rate: string; } } + + export interface NewSubscriptionPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewSubscriptionPercentCompositePrice.PercentConfig; + + /** + * 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; + + /** + * 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 NewSubscriptionPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewSubscriptionEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewSubscriptionEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + + /** + * 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 NewSubscriptionEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } } } diff --git a/src/version.ts b/src/version.ts index 4bb6c39f..cf8aa541 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.15.0'; // x-release-please-version +export const VERSION = '5.16.0'; // x-release-please-version