diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index d49c9e28..68f9449d 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "5.6.0"
+ ".": "5.7.0"
}
diff --git a/.stats.yml b/.stats.yml
index 5c39bf21..f4571777 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-6b2550b95f82872b3825619c109352352b9c92281c8b2470fce158e971142881.yml
-openapi_spec_hash: 379df18de1af6a9d0b50d3653aab4d44
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d63c8075b48441663736b457f8ad859c58cc3e31dfbffb68db44c3f00562012c.yml
+openapi_spec_hash: c47dbff685a0a449bfc1ad729c13a72e
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c39f98c3..7ac97e9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,24 @@
# Changelog
+## 5.7.0 (2025-09-08)
+
+Full Changelog: [v5.6.0...v5.7.0](https://github.com/orbcorp/orb-node/compare/v5.6.0...v5.7.0)
+
+### Features
+
+* **api:** api update ([513da97](https://github.com/orbcorp/orb-node/commit/513da97a394b525f2acee167a1d4a175159f13ef))
+* **api:** api update ([54b6144](https://github.com/orbcorp/orb-node/commit/54b61445b4098187c1becfe55b2fd770384406a5))
+
+
+### Bug Fixes
+
+* coerce nullable values to undefined ([2cfbbe0](https://github.com/orbcorp/orb-node/commit/2cfbbe032b77b2108c1d76b5f0d2bb6b1a57e9c6))
+
+
+### Chores
+
+* ci build action ([8ecd057](https://github.com/orbcorp/orb-node/commit/8ecd05725660beac4c985e301085e675895eb20d))
+
## 5.6.0 (2025-09-03)
Full Changelog: [v5.5.1...v5.6.0](https://github.com/orbcorp/orb-node/compare/v5.5.1...v5.6.0)
diff --git a/api.md b/api.md
index 5afe4866..5c2bb7d3 100644
--- a/api.md
+++ b/api.md
@@ -96,7 +96,6 @@ Types:
- NewPlanScalableMatrixWithTieredPricingPrice
- NewPlanScalableMatrixWithUnitPricingPrice
- NewPlanThresholdTotalAmountPrice
-- NewPlanTierWithProrationPrice
- NewPlanTieredPackagePrice
- NewPlanTieredPackageWithMinimumPrice
- NewPlanTieredPrice
@@ -125,7 +124,6 @@ Types:
- SubscriptionTrialInfo
- TaxAmount
- Tier
-- TierConfig
- TierSubLineItem
- TieredConfig
- TieredConversionRateConfig
@@ -467,7 +465,6 @@ Types:
- NewSubscriptionScalableMatrixWithTieredPricingPrice
- NewSubscriptionScalableMatrixWithUnitPricingPrice
- NewSubscriptionThresholdTotalAmountPrice
-- NewSubscriptionTierWithProrationPrice
- NewSubscriptionTieredPackagePrice
- NewSubscriptionTieredPackageWithMinimumPrice
- NewSubscriptionTieredPrice
diff --git a/package.json b/package.json
index 19258a86..0e263b61 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
- "version": "5.6.0",
+ "version": "5.7.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 845232fa..56d2e44c 100755
--- a/scripts/utils/upload-artifact.sh
+++ b/scripts/utils/upload-artifact.sh
@@ -12,7 +12,7 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi
-UPLOAD_RESPONSE=$(tar -cz "${BUILD_PATH:-dist}" | curl -v -X PUT \
+UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
diff --git a/src/core.ts b/src/core.ts
index 7a4f4852..ad818e3a 100644
--- a/src/core.ts
+++ b/src/core.ts
@@ -1087,21 +1087,21 @@ export const coerceBoolean = (value: unknown): boolean => {
};
export const maybeCoerceInteger = (value: unknown): number | undefined => {
- if (value === undefined) {
+ if (value == null) {
return undefined;
}
return coerceInteger(value);
};
export const maybeCoerceFloat = (value: unknown): number | undefined => {
- if (value === undefined) {
+ if (value == null) {
return undefined;
}
return coerceFloat(value);
};
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
- if (value === undefined) {
+ if (value == null) {
return undefined;
}
return coerceBoolean(value);
diff --git a/src/index.ts b/src/index.ts
index a7dbb742..950ab25e 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -81,7 +81,6 @@ import {
NewSubscriptionScalableMatrixWithTieredPricingPrice,
NewSubscriptionScalableMatrixWithUnitPricingPrice,
NewSubscriptionThresholdTotalAmountPrice,
- NewSubscriptionTierWithProrationPrice,
NewSubscriptionTieredPackagePrice,
NewSubscriptionTieredPackageWithMinimumPrice,
NewSubscriptionTieredPrice,
@@ -549,7 +548,6 @@ export declare namespace Orb {
type NewSubscriptionScalableMatrixWithTieredPricingPrice as NewSubscriptionScalableMatrixWithTieredPricingPrice,
type NewSubscriptionScalableMatrixWithUnitPricingPrice as NewSubscriptionScalableMatrixWithUnitPricingPrice,
type NewSubscriptionThresholdTotalAmountPrice as NewSubscriptionThresholdTotalAmountPrice,
- type NewSubscriptionTierWithProrationPrice as NewSubscriptionTierWithProrationPrice,
type NewSubscriptionTieredPackagePrice as NewSubscriptionTieredPackagePrice,
type NewSubscriptionTieredPackageWithMinimumPrice as NewSubscriptionTieredPackageWithMinimumPrice,
type NewSubscriptionTieredPrice as NewSubscriptionTieredPrice,
@@ -707,7 +705,6 @@ export declare namespace Orb {
export type NewPlanScalableMatrixWithTieredPricingPrice = API.NewPlanScalableMatrixWithTieredPricingPrice;
export type NewPlanScalableMatrixWithUnitPricingPrice = API.NewPlanScalableMatrixWithUnitPricingPrice;
export type NewPlanThresholdTotalAmountPrice = API.NewPlanThresholdTotalAmountPrice;
- export type NewPlanTierWithProrationPrice = API.NewPlanTierWithProrationPrice;
export type NewPlanTieredPackagePrice = API.NewPlanTieredPackagePrice;
export type NewPlanTieredPackageWithMinimumPrice = API.NewPlanTieredPackageWithMinimumPrice;
export type NewPlanTieredPrice = API.NewPlanTieredPrice;
@@ -736,7 +733,6 @@ export declare namespace Orb {
export type SubscriptionTrialInfo = API.SubscriptionTrialInfo;
export type TaxAmount = API.TaxAmount;
export type Tier = API.Tier;
- export type TierConfig = API.TierConfig;
export type TierSubLineItem = API.TierSubLineItem;
export type TieredConfig = API.TieredConfig;
export type TieredConversionRateConfig = API.TieredConversionRateConfig;
diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts
index 33399963..a2f796b1 100644
--- a/src/resources/beta/beta.ts
+++ b/src/resources/beta/beta.ts
@@ -181,53 +181,190 @@ export namespace BetaCreatePlanVersionParams {
plan_phase_order?: number | null;
/**
- * The price to add to the plan
+ * New plan price request body params.
*/
price?:
| Shared.NewPlanUnitPrice
- | Shared.NewPlanPackagePrice
- | Shared.NewPlanMatrixPrice
| Shared.NewPlanTieredPrice
| Shared.NewPlanBulkPrice
+ | Shared.NewPlanPackagePrice
+ | Shared.NewPlanMatrixPrice
| Shared.NewPlanThresholdTotalAmountPrice
| Shared.NewPlanTieredPackagePrice
| Shared.NewPlanTieredWithMinimumPrice
- | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanGroupedTieredPrice
+ | Shared.NewPlanTieredPackageWithMinimumPrice
| Shared.NewPlanPackageWithAllocationPrice
- | Shared.NewPlanTierWithProrationPrice
+ | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanMatrixWithAllocationPrice
+ | AddPrice.NewPlanTieredWithProrationPrice
| Shared.NewPlanUnitWithProrationPrice
| Shared.NewPlanGroupedAllocationPrice
+ | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedWithProratedMinimumPrice
| Shared.NewPlanGroupedWithMeteredMinimumPrice
| AddPrice.NewPlanGroupedWithMinMaxThresholdsPrice
| Shared.NewPlanMatrixWithDisplayNamePrice
- | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedTieredPackagePrice
| Shared.NewPlanMaxGroupTieredPackagePrice
| Shared.NewPlanScalableMatrixWithUnitPricingPrice
| Shared.NewPlanScalableMatrixWithTieredPricingPrice
| Shared.NewPlanCumulativeGroupedBulkPrice
- | Shared.NewPlanTieredPackageWithMinimumPrice
- | Shared.NewPlanMatrixWithAllocationPrice
- | Shared.NewPlanGroupedTieredPrice
| Shared.NewPlanMinimumCompositePrice
| null;
}
export namespace AddPrice {
+ export interface NewPlanTieredWithProrationPrice {
+ /**
+ * 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: NewPlanTieredWithProrationPrice.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 NewPlanTieredWithProrationPrice {
+ /**
+ * 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 NewPlanGroupedWithMinMaxThresholdsPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_min_max_thresholds pricing
+ */
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.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';
/**
@@ -309,6 +446,33 @@ export namespace BetaCreatePlanVersionParams {
*/
reference_id?: string | null;
}
+
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
+ /**
+ * 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 RemoveAdjustment {
@@ -374,53 +538,190 @@ export namespace BetaCreatePlanVersionParams {
plan_phase_order?: number | null;
/**
- * The price to add to the plan
+ * New plan price request body params.
*/
price?:
| Shared.NewPlanUnitPrice
- | Shared.NewPlanPackagePrice
- | Shared.NewPlanMatrixPrice
| Shared.NewPlanTieredPrice
| Shared.NewPlanBulkPrice
+ | Shared.NewPlanPackagePrice
+ | Shared.NewPlanMatrixPrice
| Shared.NewPlanThresholdTotalAmountPrice
| Shared.NewPlanTieredPackagePrice
| Shared.NewPlanTieredWithMinimumPrice
- | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanGroupedTieredPrice
+ | Shared.NewPlanTieredPackageWithMinimumPrice
| Shared.NewPlanPackageWithAllocationPrice
- | Shared.NewPlanTierWithProrationPrice
+ | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanMatrixWithAllocationPrice
+ | ReplacePrice.NewPlanTieredWithProrationPrice
| Shared.NewPlanUnitWithProrationPrice
| Shared.NewPlanGroupedAllocationPrice
+ | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedWithProratedMinimumPrice
| Shared.NewPlanGroupedWithMeteredMinimumPrice
| ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice
| Shared.NewPlanMatrixWithDisplayNamePrice
- | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedTieredPackagePrice
| Shared.NewPlanMaxGroupTieredPackagePrice
| Shared.NewPlanScalableMatrixWithUnitPricingPrice
| Shared.NewPlanScalableMatrixWithTieredPricingPrice
| Shared.NewPlanCumulativeGroupedBulkPrice
- | Shared.NewPlanTieredPackageWithMinimumPrice
- | Shared.NewPlanMatrixWithAllocationPrice
- | Shared.NewPlanGroupedTieredPrice
| Shared.NewPlanMinimumCompositePrice
| null;
}
export namespace ReplacePrice {
+ export interface NewPlanTieredWithProrationPrice {
+ /**
+ * 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: NewPlanTieredWithProrationPrice.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 NewPlanTieredWithProrationPrice {
+ /**
+ * 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 NewPlanGroupedWithMinMaxThresholdsPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_min_max_thresholds pricing
+ */
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.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';
/**
@@ -502,6 +803,33 @@ export namespace BetaCreatePlanVersionParams {
*/
reference_id?: string | null;
}
+
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
+ /**
+ * 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;
+ }
+ }
}
}
diff --git a/src/resources/beta/external-plan-id.ts b/src/resources/beta/external-plan-id.ts
index 01fe0e33..704ced78 100644
--- a/src/resources/beta/external-plan-id.ts
+++ b/src/resources/beta/external-plan-id.ts
@@ -126,53 +126,190 @@ export namespace ExternalPlanIDCreatePlanVersionParams {
plan_phase_order?: number | null;
/**
- * The price to add to the plan
+ * New plan price request body params.
*/
price?:
| Shared.NewPlanUnitPrice
- | Shared.NewPlanPackagePrice
- | Shared.NewPlanMatrixPrice
| Shared.NewPlanTieredPrice
| Shared.NewPlanBulkPrice
+ | Shared.NewPlanPackagePrice
+ | Shared.NewPlanMatrixPrice
| Shared.NewPlanThresholdTotalAmountPrice
| Shared.NewPlanTieredPackagePrice
| Shared.NewPlanTieredWithMinimumPrice
- | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanGroupedTieredPrice
+ | Shared.NewPlanTieredPackageWithMinimumPrice
| Shared.NewPlanPackageWithAllocationPrice
- | Shared.NewPlanTierWithProrationPrice
+ | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanMatrixWithAllocationPrice
+ | AddPrice.NewPlanTieredWithProrationPrice
| Shared.NewPlanUnitWithProrationPrice
| Shared.NewPlanGroupedAllocationPrice
+ | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedWithProratedMinimumPrice
| Shared.NewPlanGroupedWithMeteredMinimumPrice
| AddPrice.NewPlanGroupedWithMinMaxThresholdsPrice
| Shared.NewPlanMatrixWithDisplayNamePrice
- | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedTieredPackagePrice
| Shared.NewPlanMaxGroupTieredPackagePrice
| Shared.NewPlanScalableMatrixWithUnitPricingPrice
| Shared.NewPlanScalableMatrixWithTieredPricingPrice
| Shared.NewPlanCumulativeGroupedBulkPrice
- | Shared.NewPlanTieredPackageWithMinimumPrice
- | Shared.NewPlanMatrixWithAllocationPrice
- | Shared.NewPlanGroupedTieredPrice
| Shared.NewPlanMinimumCompositePrice
| null;
}
export namespace AddPrice {
+ export interface NewPlanTieredWithProrationPrice {
+ /**
+ * 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: NewPlanTieredWithProrationPrice.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 NewPlanTieredWithProrationPrice {
+ /**
+ * 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 NewPlanGroupedWithMinMaxThresholdsPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_min_max_thresholds pricing
+ */
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.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';
/**
@@ -254,6 +391,33 @@ export namespace ExternalPlanIDCreatePlanVersionParams {
*/
reference_id?: string | null;
}
+
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
+ /**
+ * 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 RemoveAdjustment {
@@ -319,53 +483,190 @@ export namespace ExternalPlanIDCreatePlanVersionParams {
plan_phase_order?: number | null;
/**
- * The price to add to the plan
+ * New plan price request body params.
*/
price?:
| Shared.NewPlanUnitPrice
- | Shared.NewPlanPackagePrice
- | Shared.NewPlanMatrixPrice
| Shared.NewPlanTieredPrice
| Shared.NewPlanBulkPrice
+ | Shared.NewPlanPackagePrice
+ | Shared.NewPlanMatrixPrice
| Shared.NewPlanThresholdTotalAmountPrice
| Shared.NewPlanTieredPackagePrice
| Shared.NewPlanTieredWithMinimumPrice
- | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanGroupedTieredPrice
+ | Shared.NewPlanTieredPackageWithMinimumPrice
| Shared.NewPlanPackageWithAllocationPrice
- | Shared.NewPlanTierWithProrationPrice
+ | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanMatrixWithAllocationPrice
+ | ReplacePrice.NewPlanTieredWithProrationPrice
| Shared.NewPlanUnitWithProrationPrice
| Shared.NewPlanGroupedAllocationPrice
+ | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedWithProratedMinimumPrice
| Shared.NewPlanGroupedWithMeteredMinimumPrice
| ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice
| Shared.NewPlanMatrixWithDisplayNamePrice
- | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedTieredPackagePrice
| Shared.NewPlanMaxGroupTieredPackagePrice
| Shared.NewPlanScalableMatrixWithUnitPricingPrice
| Shared.NewPlanScalableMatrixWithTieredPricingPrice
| Shared.NewPlanCumulativeGroupedBulkPrice
- | Shared.NewPlanTieredPackageWithMinimumPrice
- | Shared.NewPlanMatrixWithAllocationPrice
- | Shared.NewPlanGroupedTieredPrice
| Shared.NewPlanMinimumCompositePrice
| null;
}
export namespace ReplacePrice {
+ export interface NewPlanTieredWithProrationPrice {
+ /**
+ * 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: NewPlanTieredWithProrationPrice.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 NewPlanTieredWithProrationPrice {
+ /**
+ * 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 NewPlanGroupedWithMinMaxThresholdsPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_min_max_thresholds pricing
+ */
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.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';
/**
@@ -447,6 +748,33 @@ export namespace ExternalPlanIDCreatePlanVersionParams {
*/
reference_id?: string | null;
}
+
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
+ /**
+ * 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;
+ }
+ }
}
}
diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts
index 4cb60c08..add61311 100644
--- a/src/resources/customers/customers.ts
+++ b/src/resources/customers/customers.ts
@@ -554,7 +554,8 @@ export interface CustomerCreateParams {
/**
* Additional email addresses for this customer. If populated, these email
- * addresses will be CC'd for customer communications.
+ * addresses will be CC'd for customer communications. The total number of email
+ * addresses (including the primary email) cannot exceed 50.
*/
additional_emails?: Array | null;
@@ -619,7 +620,12 @@ export interface CustomerCreateParams {
shipping_address?: AddressInput | null;
- tax_configuration?: NewAvalaraTaxConfiguration | NewTaxJarConfiguration | NewSphereConfiguration | null;
+ tax_configuration?:
+ | NewAvalaraTaxConfiguration
+ | NewTaxJarConfiguration
+ | NewSphereConfiguration
+ | CustomerCreateParams.NewNumeralConfiguration
+ | null;
/**
* Tax IDs are commonly required to be displayed on customer invoices, which are
@@ -777,12 +783,21 @@ export interface CustomerCreateParams {
timezone?: string | null;
}
+export namespace CustomerCreateParams {
+ export interface NewNumeralConfiguration {
+ tax_exempt: boolean;
+
+ tax_provider: 'numeral';
+ }
+}
+
export interface CustomerUpdateParams {
accounting_sync_configuration?: NewAccountingSyncConfiguration | null;
/**
* Additional email addresses for this customer. If populated, these email
- * addresses will be CC'd for customer communications.
+ * addresses will be CC'd for customer communications. The total number of email
+ * addresses (including the primary email) cannot exceed 50.
*/
additional_emails?: Array | null;
@@ -863,7 +878,12 @@ export interface CustomerUpdateParams {
shipping_address?: AddressInput | null;
- tax_configuration?: NewAvalaraTaxConfiguration | NewTaxJarConfiguration | NewSphereConfiguration | null;
+ tax_configuration?:
+ | NewAvalaraTaxConfiguration
+ | NewTaxJarConfiguration
+ | NewSphereConfiguration
+ | CustomerUpdateParams.NewNumeralConfiguration
+ | null;
/**
* Tax IDs are commonly required to be displayed on customer invoices, which are
@@ -1014,6 +1034,14 @@ export interface CustomerUpdateParams {
tax_id?: Shared.CustomerTaxID | null;
}
+export namespace CustomerUpdateParams {
+ export interface NewNumeralConfiguration {
+ tax_exempt: boolean;
+
+ tax_provider: 'numeral';
+ }
+}
+
export interface CustomerListParams extends PageParams {
'created_at[gt]'?: string | null;
@@ -1029,7 +1057,8 @@ export interface CustomerUpdateByExternalIDParams {
/**
* Additional email addresses for this customer. If populated, these email
- * addresses will be CC'd for customer communications.
+ * addresses will be CC'd for customer communications. The total number of email
+ * addresses (including the primary email) cannot exceed 50.
*/
additional_emails?: Array | null;
@@ -1110,7 +1139,12 @@ export interface CustomerUpdateByExternalIDParams {
shipping_address?: AddressInput | null;
- tax_configuration?: NewAvalaraTaxConfiguration | NewTaxJarConfiguration | NewSphereConfiguration | null;
+ tax_configuration?:
+ | NewAvalaraTaxConfiguration
+ | NewTaxJarConfiguration
+ | NewSphereConfiguration
+ | CustomerUpdateByExternalIDParams.NewNumeralConfiguration
+ | null;
/**
* Tax IDs are commonly required to be displayed on customer invoices, which are
@@ -1261,6 +1295,14 @@ export interface CustomerUpdateByExternalIDParams {
tax_id?: Shared.CustomerTaxID | null;
}
+export namespace CustomerUpdateByExternalIDParams {
+ export interface NewNumeralConfiguration {
+ tax_exempt: boolean;
+
+ tax_provider: 'numeral';
+ }
+}
+
Customers.CustomersPage = CustomersPage;
Customers.Costs = Costs;
Customers.Credits = Credits;
diff --git a/src/resources/index.ts b/src/resources/index.ts
index 3030e58d..6f7450dc 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -147,7 +147,6 @@ export {
type NewSubscriptionScalableMatrixWithTieredPricingPrice,
type NewSubscriptionScalableMatrixWithUnitPricingPrice,
type NewSubscriptionThresholdTotalAmountPrice,
- type NewSubscriptionTierWithProrationPrice,
type NewSubscriptionTieredPackagePrice,
type NewSubscriptionTieredPackageWithMinimumPrice,
type NewSubscriptionTieredPrice,
diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts
index 256482fe..fe795c1d 100644
--- a/src/resources/invoices.ts
+++ b/src/resources/invoices.ts
@@ -848,6 +848,9 @@ export namespace InvoiceCreateParams {
*/
start_date: string;
+ /**
+ * Configuration for unit pricing
+ */
unit_config: Shared.UnitConfig;
}
}
diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts
index 85112685..187d0eb6 100644
--- a/src/resources/plans/plans.ts
+++ b/src/resources/plans/plans.ts
@@ -320,53 +320,190 @@ export namespace PlanCreateParams {
plan_phase_order?: number | null;
/**
- * The price to add to the plan
+ * New plan price request body params.
*/
price?:
| Shared.NewPlanUnitPrice
- | Shared.NewPlanPackagePrice
- | Shared.NewPlanMatrixPrice
| Shared.NewPlanTieredPrice
| Shared.NewPlanBulkPrice
+ | Shared.NewPlanPackagePrice
+ | Shared.NewPlanMatrixPrice
| Shared.NewPlanThresholdTotalAmountPrice
| Shared.NewPlanTieredPackagePrice
| Shared.NewPlanTieredWithMinimumPrice
- | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanGroupedTieredPrice
+ | Shared.NewPlanTieredPackageWithMinimumPrice
| Shared.NewPlanPackageWithAllocationPrice
- | Shared.NewPlanTierWithProrationPrice
+ | Shared.NewPlanUnitWithPercentPrice
+ | Shared.NewPlanMatrixWithAllocationPrice
+ | Price.NewPlanTieredWithProrationPrice
| Shared.NewPlanUnitWithProrationPrice
| Shared.NewPlanGroupedAllocationPrice
+ | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedWithProratedMinimumPrice
| Shared.NewPlanGroupedWithMeteredMinimumPrice
| Price.NewPlanGroupedWithMinMaxThresholdsPrice
| Shared.NewPlanMatrixWithDisplayNamePrice
- | Shared.NewPlanBulkWithProrationPrice
| Shared.NewPlanGroupedTieredPackagePrice
| Shared.NewPlanMaxGroupTieredPackagePrice
| Shared.NewPlanScalableMatrixWithUnitPricingPrice
| Shared.NewPlanScalableMatrixWithTieredPricingPrice
| Shared.NewPlanCumulativeGroupedBulkPrice
- | Shared.NewPlanTieredPackageWithMinimumPrice
- | Shared.NewPlanMatrixWithAllocationPrice
- | Shared.NewPlanGroupedTieredPrice
| Shared.NewPlanMinimumCompositePrice
| null;
}
export namespace Price {
+ export interface NewPlanTieredWithProrationPrice {
+ /**
+ * 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: NewPlanTieredWithProrationPrice.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 NewPlanTieredWithProrationPrice {
+ /**
+ * 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 NewPlanGroupedWithMinMaxThresholdsPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_min_max_thresholds pricing
+ */
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.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';
/**
@@ -448,6 +585,33 @@ export namespace PlanCreateParams {
*/
reference_id?: string | null;
}
+
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
+ /**
+ * 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 Adjustment {
diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts
index 19f06c43..7d11b930 100644
--- a/src/resources/prices/prices.ts
+++ b/src/resources/prices/prices.ts
@@ -255,31 +255,31 @@ export namespace PriceEvaluatePreviewEventsResponse {
export type PriceCreateParams =
| PriceCreateParams.NewFloatingUnitPrice
- | PriceCreateParams.NewFloatingPackagePrice
- | PriceCreateParams.NewFloatingMatrixPrice
- | PriceCreateParams.NewFloatingMatrixWithAllocationPrice
| PriceCreateParams.NewFloatingTieredPrice
| PriceCreateParams.NewFloatingBulkPrice
+ | PriceCreateParams.NewFloatingPackagePrice
+ | PriceCreateParams.NewFloatingMatrixPrice
| PriceCreateParams.NewFloatingThresholdTotalAmountPrice
| PriceCreateParams.NewFloatingTieredPackagePrice
- | PriceCreateParams.NewFloatingGroupedTieredPrice
- | PriceCreateParams.NewFloatingMaxGroupTieredPackagePrice
| PriceCreateParams.NewFloatingTieredWithMinimumPrice
- | PriceCreateParams.NewFloatingPackageWithAllocationPrice
+ | PriceCreateParams.NewFloatingGroupedTieredPrice
| PriceCreateParams.NewFloatingTieredPackageWithMinimumPrice
+ | PriceCreateParams.NewFloatingPackageWithAllocationPrice
| PriceCreateParams.NewFloatingUnitWithPercentPrice
+ | PriceCreateParams.NewFloatingMatrixWithAllocationPrice
| PriceCreateParams.NewFloatingTieredWithProrationPrice
| PriceCreateParams.NewFloatingUnitWithProrationPrice
| PriceCreateParams.NewFloatingGroupedAllocationPrice
+ | PriceCreateParams.NewFloatingBulkWithProrationPrice
| PriceCreateParams.NewFloatingGroupedWithProratedMinimumPrice
| PriceCreateParams.NewFloatingGroupedWithMeteredMinimumPrice
+ | PriceCreateParams.NewFloatingGroupedWithMinMaxThresholdsPrice
| PriceCreateParams.NewFloatingMatrixWithDisplayNamePrice
- | PriceCreateParams.NewFloatingBulkWithProrationPrice
| PriceCreateParams.NewFloatingGroupedTieredPackagePrice
+ | PriceCreateParams.NewFloatingMaxGroupTieredPackagePrice
| PriceCreateParams.NewFloatingScalableMatrixWithUnitPricingPrice
| PriceCreateParams.NewFloatingScalableMatrixWithTieredPricingPrice
| PriceCreateParams.NewFloatingCumulativeGroupedBulkPrice
- | PriceCreateParams.NewFloatingGroupedWithMinMaxThresholdsPrice
| PriceCreateParams.NewFloatingMinimumCompositePrice;
export declare namespace PriceCreateParams {
@@ -299,6 +299,9 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit';
/**
@@ -306,6 +309,9 @@ export declare namespace PriceCreateParams {
*/
name: string;
+ /**
+ * Configuration for unit pricing
+ */
unit_config: Shared.UnitConfig;
/**
@@ -371,7 +377,7 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingPackagePrice {
+ export interface NewFloatingTieredPrice {
/**
* The cadence to bill for this price on.
*/
@@ -387,14 +393,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered';
/**
* The name of the price.
*/
name: string;
- package_config: Shared.PackageConfig;
+ /**
+ * Configuration for tiered pricing
+ */
+ tiered_config: Shared.TieredConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -459,7 +471,12 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingMatrixPrice {
+ export interface NewFloatingBulkPrice {
+ /**
+ * Configuration for bulk pricing
+ */
+ bulk_config: Shared.BulkConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -475,9 +492,10 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- matrix_config: Shared.MatrixConfig;
-
- model_type: 'matrix';
+ /**
+ * The pricing model type
+ */
+ model_type: 'bulk';
/**
* The name of the price.
@@ -547,7 +565,7 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingMatrixWithAllocationPrice {
+ export interface NewFloatingPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -563,15 +581,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- matrix_with_allocation_config: Shared.MatrixWithAllocationConfig;
-
- model_type: 'matrix_with_allocation';
+ /**
+ * The pricing model type
+ */
+ model_type: 'package';
/**
* The name of the price.
*/
name: string;
+ /**
+ * Configuration for package pricing
+ */
+ package_config: Shared.PackageConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -635,7 +659,7 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingTieredPrice {
+ export interface NewFloatingMatrixPrice {
/**
* The cadence to bill for this price on.
*/
@@ -651,15 +675,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'tiered';
+ /**
+ * Configuration for matrix pricing
+ */
+ matrix_config: Shared.MatrixConfig;
+
+ /**
+ * The pricing model type
+ */
+ model_type: 'matrix';
/**
* The name of the price.
*/
name: string;
- tiered_config: Shared.TieredConfig;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -723,9 +753,7 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingBulkPrice {
- bulk_config: Shared.BulkConfig;
-
+ export interface NewFloatingThresholdTotalAmountPrice {
/**
* The cadence to bill for this price on.
*/
@@ -741,13 +769,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'bulk';
+ /**
+ * The pricing model type
+ */
+ model_type: 'threshold_total_amount';
/**
* The name of the price.
*/
name: string;
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ threshold_total_amount_config: NewFloatingThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -811,7 +847,42 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingThresholdTotalAmountPrice {
+ export namespace NewFloatingThresholdTotalAmountPrice {
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ export interface ThresholdTotalAmountConfig {
+ /**
+ * When the quantity consumed passes a provided threshold, the configured total
+ * will be charged
+ */
+ consumption_table: Array;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+ }
+
+ export namespace ThresholdTotalAmountConfig {
+ /**
+ * Configuration for a single threshold
+ */
+ export interface ConsumptionTable {
+ /**
+ * Quantity threshold
+ */
+ threshold: string;
+
+ /**
+ * Total amount for this threshold
+ */
+ total_amount: string;
+ }
+ }
+ }
+
+ export interface NewFloatingTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -827,14 +898,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'threshold_total_amount';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_package';
/**
* The name of the price.
*/
name: string;
- threshold_total_amount_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package pricing
+ */
+ tiered_package_config: NewFloatingTieredPackagePrice.TieredPackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -899,7 +976,42 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingTieredPackagePrice {
+ export namespace NewFloatingTieredPackagePrice {
+ /**
+ * Configuration for tiered_package pricing
+ */
+ export interface TieredPackageConfig {
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageConfig {
+ /**
+ * Configuration for a single tier with business logic
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+ }
+
+ export interface NewFloatingTieredWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -915,14 +1027,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'tiered_package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_with_minimum';
/**
* The name of the price.
*/
name: string;
- tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ tiered_with_minimum_config: NewFloatingTieredWithMinimumPrice.TieredWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -987,6 +1105,51 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
+ export namespace NewFloatingTieredWithMinimumPrice {
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ export interface TieredWithMinimumConfig {
+ /**
+ * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are
+ * defined using exclusive lower bounds.
+ */
+ tiers: Array;
+
+ /**
+ * If true, tiers with an accrued amount of 0 will not be included in the rating.
+ */
+ hide_zero_amount_tiers?: boolean;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean;
+ }
+
+ export namespace TieredWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
export interface NewFloatingGroupedTieredPrice {
/**
* The cadence to bill for this price on.
@@ -998,13 +1161,19 @@ export declare namespace PriceCreateParams {
*/
currency: string;
- grouped_tiered_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ grouped_tiered_config: NewFloatingGroupedTieredPrice.GroupedTieredConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered';
/**
@@ -1075,7 +1244,42 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingMaxGroupTieredPackagePrice {
+ export namespace NewFloatingGroupedTieredPrice {
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ export interface GroupedTieredConfig {
+ /**
+ * The billable metric property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Apply tiered pricing to each segment generated after grouping with the provided
+ * key
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface NewFloatingTieredPackageWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1091,15 +1295,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- max_group_tiered_package_config: { [key: string]: unknown };
-
- model_type: 'max_group_tiered_package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_package_with_minimum';
/**
* The name of the price.
*/
name: string;
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ tiered_package_with_minimum_config: NewFloatingTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -1163,7 +1373,47 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingTieredWithMinimumPrice {
+ export namespace NewFloatingTieredPackageWithMinimumPrice {
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ export interface TieredPackageWithMinimumConfig {
+ /**
+ * Package size
+ */
+ package_size: number;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+ }
+
+ export interface NewFloatingPackageWithAllocationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1179,14 +1429,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'tiered_with_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'package_with_allocation';
/**
* The name of the price.
*/
name: string;
- tiered_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ package_with_allocation_config: NewFloatingPackageWithAllocationPrice.PackageWithAllocationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -1251,7 +1507,29 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingPackageWithAllocationPrice {
+ export namespace NewFloatingPackageWithAllocationPrice {
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ export interface PackageWithAllocationConfig {
+ /**
+ * Usage allocation
+ */
+ allocation: string;
+
+ /**
+ * Price per package
+ */
+ package_amount: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+ }
+ }
+
+ export interface NewFloatingUnitWithPercentPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1267,14 +1545,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'package_with_allocation';
+ /**
+ * The pricing model type
+ */
+ model_type: 'unit_with_percent';
/**
* The name of the price.
*/
name: string;
- package_with_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ unit_with_percent_config: NewFloatingUnitWithPercentPrice.UnitWithPercentConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -1339,7 +1623,24 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingTieredPackageWithMinimumPrice {
+ export namespace NewFloatingUnitWithPercentPrice {
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ export interface UnitWithPercentConfig {
+ /**
+ * What percent, out of 100, of the calculated total to charge
+ */
+ percent: string;
+
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+ }
+
+ export interface NewFloatingMatrixWithAllocationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1355,15 +1656,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'tiered_package_with_minimum';
+ /**
+ * Configuration for matrix_with_allocation pricing
+ */
+ matrix_with_allocation_config: Shared.MatrixWithAllocationConfig;
+
+ /**
+ * The pricing model type
+ */
+ model_type: 'matrix_with_allocation';
/**
* The name of the price.
*/
name: string;
- tiered_package_with_minimum_config: { [key: string]: unknown };
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -1427,7 +1734,7 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingUnitWithPercentPrice {
+ export interface NewFloatingTieredWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1443,14 +1750,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'unit_with_percent';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_with_proration';
/**
* The name of the price.
*/
name: string;
- unit_with_percent_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_with_proration pricing
+ */
+ tiered_with_proration_config: NewFloatingTieredWithProrationPrice.TieredWithProrationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -1515,7 +1828,37 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingTieredWithProrationPrice {
+ export namespace NewFloatingTieredWithProrationPrice {
+ /**
+ * 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 NewFloatingUnitWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1531,15 +1874,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'tiered_with_proration';
+ /**
+ * The pricing model type
+ */
+ model_type: 'unit_with_proration';
/**
* The name of the price.
*/
name: string;
- tiered_with_proration_config: { [key: string]: unknown };
-
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ unit_with_proration_config: NewFloatingUnitWithProrationPrice.UnitWithProrationConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -1603,7 +1952,19 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingUnitWithProrationPrice {
+ export namespace NewFloatingUnitWithProrationPrice {
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ export interface UnitWithProrationConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+ }
+
+ export interface NewFloatingGroupedAllocationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1614,20 +1975,26 @@ export declare namespace PriceCreateParams {
*/
currency: string;
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ grouped_allocation_config: NewFloatingGroupedAllocationPrice.GroupedAllocationConfig;
+
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'unit_with_proration';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_allocation';
/**
* The name of the price.
*/
name: string;
- unit_with_proration_config: { [key: string]: unknown };
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -1691,7 +2058,34 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingGroupedAllocationPrice {
+ export namespace NewFloatingGroupedAllocationPrice {
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ export interface GroupedAllocationConfig {
+ /**
+ * Usage allocation per group
+ */
+ allocation: string;
+
+ /**
+ * How to determine the groups that should each be allocated some quantity
+ */
+ grouping_key: string;
+
+ /**
+ * Unit rate for post-allocation
+ */
+ overage_unit_rate: string;
+ }
+ }
+
+ export interface NewFloatingBulkWithProrationPrice {
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ bulk_with_proration_config: NewFloatingBulkWithProrationPrice.BulkWithProrationConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -1702,14 +2096,15 @@ export declare namespace PriceCreateParams {
*/
currency: string;
- grouped_allocation_config: { [key: string]: unknown };
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_allocation';
+ /**
+ * The pricing model type
+ */
+ model_type: 'bulk_with_proration';
/**
* The name of the price.
@@ -1779,6 +2174,35 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
+ export namespace NewFloatingBulkWithProrationPrice {
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ export interface BulkWithProrationConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkWithProrationConfig {
+ /**
+ * Configuration for a single bulk pricing tier with proration
+ */
+ export interface Tier {
+ /**
+ * Cost per unit
+ */
+ unit_amount: string;
+
+ /**
+ * The lower bound for this tier
+ */
+ tier_lower_bound?: string | null;
+ }
+ }
+ }
+
export interface NewFloatingGroupedWithProratedMinimumPrice {
/**
* The cadence to bill for this price on.
@@ -1790,13 +2214,19 @@ export declare namespace PriceCreateParams {
*/
currency: string;
- grouped_with_prorated_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ grouped_with_prorated_minimum_config: NewFloatingGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_prorated_minimum';
/**
@@ -1867,6 +2297,28 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
+ export namespace NewFloatingGroupedWithProratedMinimumPrice {
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ export interface GroupedWithProratedMinimumConfig {
+ /**
+ * How to determine the groups that should each have a minimum
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group
+ */
+ minimum: string;
+
+ /**
+ * The amount to charge per unit
+ */
+ unit_rate: string;
+ }
+ }
+
export interface NewFloatingGroupedWithMeteredMinimumPrice {
/**
* The cadence to bill for this price on.
@@ -1878,13 +2330,19 @@ export declare namespace PriceCreateParams {
*/
currency: string;
- grouped_with_metered_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ grouped_with_metered_minimum_config: NewFloatingGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_metered_minimum';
/**
@@ -1955,7 +2413,78 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingMatrixWithDisplayNamePrice {
+ export namespace NewFloatingGroupedWithMeteredMinimumPrice {
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ export interface GroupedWithMeteredMinimumConfig {
+ /**
+ * Used to partition the usage into groups. The minimum amount is applied to each
+ * group.
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group per unit
+ */
+ minimum_unit_amount: string;
+
+ /**
+ * Used to determine the unit rate
+ */
+ pricing_key: string;
+
+ /**
+ * Scale the unit rates by the scaling factor.
+ */
+ scaling_factors: Array;
+
+ /**
+ * Used to determine the unit rate scaling factor
+ */
+ scaling_key: string;
+
+ /**
+ * Apply per unit pricing to each pricing value. The minimum amount is applied any
+ * unmatched usage.
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace GroupedWithMeteredMinimumConfig {
+ /**
+ * Configuration for a scaling factor
+ */
+ export interface ScalingFactor {
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Scaling value
+ */
+ scaling_value: string;
+ }
+
+ /**
+ * Configuration for a unit amount
+ */
+ export interface UnitAmount {
+ /**
+ * Pricing value
+ */
+ pricing_value: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface NewFloatingGroupedWithMinMaxThresholdsPrice {
/**
* The cadence to bill for this price on.
*/
@@ -1966,14 +2495,20 @@ export declare namespace PriceCreateParams {
*/
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;
- matrix_with_display_name_config: { [key: string]: unknown };
-
- model_type: 'matrix_with_display_name';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_with_min_max_thresholds';
/**
* The name of the price.
@@ -2043,9 +2578,34 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingBulkWithProrationPrice {
- bulk_with_proration_config: { [key: string]: unknown };
+ 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 NewFloatingMatrixWithDisplayNamePrice {
/**
* The cadence to bill for this price on.
*/
@@ -2061,7 +2621,15 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'bulk_with_proration';
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ matrix_with_display_name_config: NewFloatingMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig;
+
+ /**
+ * The pricing model type
+ */
+ model_type: 'matrix_with_display_name';
/**
* The name of the price.
@@ -2131,6 +2699,45 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
+ export namespace NewFloatingMatrixWithDisplayNamePrice {
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ export interface MatrixWithDisplayNameConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ dimension: string;
+
+ /**
+ * Apply per unit pricing to each dimension value
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace MatrixWithDisplayNameConfig {
+ /**
+ * Configuration for a unit amount item
+ */
+ export interface UnitAmount {
+ /**
+ * The dimension value
+ */
+ dimension_value: string;
+
+ /**
+ * Display name for this dimension value
+ */
+ display_name: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
export interface NewFloatingGroupedTieredPackagePrice {
/**
* The cadence to bill for this price on.
@@ -2142,13 +2749,19 @@ export declare namespace PriceCreateParams {
*/
currency: string;
- grouped_tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ grouped_tiered_package_config: NewFloatingGroupedTieredPackagePrice.GroupedTieredPackageConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered_package';
/**
@@ -2219,7 +2832,47 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingScalableMatrixWithUnitPricingPrice {
+ export namespace NewFloatingGroupedTieredPackagePrice {
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ export interface GroupedTieredPackageConfig {
+ /**
+ * The event property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+ }
+
+ export interface NewFloatingMaxGroupTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -2235,15 +2888,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'scalable_matrix_with_unit_pricing';
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ max_group_tiered_package_config: NewFloatingMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig;
+
+ /**
+ * The pricing model type
+ */
+ model_type: 'max_group_tiered_package';
/**
* The name of the price.
*/
name: string;
- scalable_matrix_with_unit_pricing_config: { [key: string]: unknown };
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -2307,7 +2966,46 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingScalableMatrixWithTieredPricingPrice {
+ export namespace NewFloatingMaxGroupTieredPackagePrice {
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ export interface MaxGroupTieredPackageConfig {
+ /**
+ * The event property used to group before tiering the group with the highest value
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing to the largest group after grouping with the provided key.
+ */
+ tiers: Array;
+ }
+
+ export namespace MaxGroupTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface NewFloatingScalableMatrixWithUnitPricingPrice {
/**
* The cadence to bill for this price on.
*/
@@ -2323,14 +3021,20 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'scalable_matrix_with_tiered_pricing';
+ /**
+ * The pricing model type
+ */
+ model_type: 'scalable_matrix_with_unit_pricing';
/**
* The name of the price.
*/
name: string;
- scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ scalable_matrix_with_unit_pricing_config: NewFloatingScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -2395,14 +3099,66 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingCumulativeGroupedBulkPrice {
+ export namespace NewFloatingScalableMatrixWithUnitPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ export interface ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * The final unit price to rate against the output of the matrix
+ */
+ unit_price: string;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+
+ /**
+ * Used to determine the unit rate (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+ }
+ }
+
+ export interface NewFloatingScalableMatrixWithTieredPricingPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- cumulative_grouped_bulk_config: { [key: string]: unknown };
-
/**
* An ISO 4217 currency string for which this price is billed in.
*/
@@ -2413,13 +3169,21 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
- model_type: 'cumulative_grouped_bulk';
+ /**
+ * The pricing model type
+ */
+ model_type: 'scalable_matrix_with_tiered_pricing';
/**
* The name of the price.
*/
name: string;
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ scalable_matrix_with_tiered_pricing_config: NewFloatingScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -2483,25 +3247,95 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
- export interface NewFloatingGroupedWithMinMaxThresholdsPrice {
+ export namespace NewFloatingScalableMatrixWithTieredPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ export interface ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Used for the scalable matrix first dimension
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * Tier pricing structure
+ */
+ tiers: Array;
+
+ /**
+ * Used for the scalable matrix second dimension (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+
+ /**
+ * Configuration for a single tier entry with business logic
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface NewFloatingCumulativeGroupedBulkPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ cumulative_grouped_bulk_config: NewFloatingCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig;
+
/**
* An ISO 4217 currency string for which this price is billed in.
*/
currency: string;
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_with_min_max_thresholds';
+ /**
+ * The pricing model type
+ */
+ model_type: 'cumulative_grouped_bulk';
/**
* The name of the price.
@@ -2571,6 +3405,45 @@ export declare namespace PriceCreateParams {
metadata?: { [key: string]: string | null } | null;
}
+ export namespace NewFloatingCumulativeGroupedBulkPrice {
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ export interface CumulativeGroupedBulkConfig {
+ /**
+ * Each tier lower bound must have the same group of values.
+ */
+ dimension_values: Array;
+
+ /**
+ * Grouping key name
+ */
+ group: string;
+ }
+
+ export namespace CumulativeGroupedBulkConfig {
+ /**
+ * Configuration for a dimension value entry
+ */
+ export interface DimensionValue {
+ /**
+ * Grouping key value
+ */
+ grouping_key: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Unit amount for this combination
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
export interface NewFloatingMinimumCompositePrice {
/**
* The cadence to bill for this price on.
@@ -2587,8 +3460,14 @@ export declare namespace PriceCreateParams {
*/
item_id: string;
+ /**
+ * Configuration for minimum pricing
+ */
minimum_config: NewFloatingMinimumCompositePrice.MinimumConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'minimum';
/**
@@ -2660,6 +3539,9 @@ export declare namespace PriceCreateParams {
}
export namespace NewFloatingMinimumCompositePrice {
+ /**
+ * Configuration for minimum pricing
+ */
export interface MinimumConfig {
/**
* The minimum amount to apply
@@ -2667,10 +3549,9 @@ export declare namespace PriceCreateParams {
minimum_amount: string;
/**
- * By default, subtotals from minimum composite prices are prorated based on the
- * service period. Set to false to disable proration.
+ * If true, subtotals from this price are prorated based on the service period
*/
- prorated?: boolean | null;
+ prorated?: boolean;
}
}
}
@@ -2771,36 +3652,35 @@ export namespace PriceEvaluateMultipleParams {
grouping_keys?: Array;
/**
- * An inline price definition to evaluate, allowing you to test price
- * configurations before adding them to Orb.
+ * New floating price request body params.
*/
price?:
| Shared.NewFloatingUnitPrice
- | Shared.NewFloatingPackagePrice
- | Shared.NewFloatingMatrixPrice
- | Shared.NewFloatingMatrixWithAllocationPrice
| Shared.NewFloatingTieredPrice
| Shared.NewFloatingBulkPrice
+ | Shared.NewFloatingPackagePrice
+ | Shared.NewFloatingMatrixPrice
| Shared.NewFloatingThresholdTotalAmountPrice
| Shared.NewFloatingTieredPackagePrice
- | Shared.NewFloatingGroupedTieredPrice
- | Shared.NewFloatingMaxGroupTieredPackagePrice
| Shared.NewFloatingTieredWithMinimumPrice
- | Shared.NewFloatingPackageWithAllocationPrice
+ | Shared.NewFloatingGroupedTieredPrice
| Shared.NewFloatingTieredPackageWithMinimumPrice
+ | Shared.NewFloatingPackageWithAllocationPrice
| Shared.NewFloatingUnitWithPercentPrice
+ | Shared.NewFloatingMatrixWithAllocationPrice
| Shared.NewFloatingTieredWithProrationPrice
| Shared.NewFloatingUnitWithProrationPrice
| Shared.NewFloatingGroupedAllocationPrice
+ | Shared.NewFloatingBulkWithProrationPrice
| Shared.NewFloatingGroupedWithProratedMinimumPrice
| Shared.NewFloatingGroupedWithMeteredMinimumPrice
+ | PriceEvaluation.NewFloatingGroupedWithMinMaxThresholdsPrice
| Shared.NewFloatingMatrixWithDisplayNamePrice
- | Shared.NewFloatingBulkWithProrationPrice
| Shared.NewFloatingGroupedTieredPackagePrice
+ | Shared.NewFloatingMaxGroupTieredPackagePrice
| Shared.NewFloatingScalableMatrixWithUnitPricingPrice
| Shared.NewFloatingScalableMatrixWithTieredPricingPrice
| Shared.NewFloatingCumulativeGroupedBulkPrice
- | PriceEvaluation.NewFloatingGroupedWithMinMaxThresholdsPrice
| Shared.NewFloatingMinimumCompositePrice
| null;
@@ -2822,13 +3702,19 @@ export namespace PriceEvaluateMultipleParams {
*/
currency: string;
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * 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';
/**
@@ -2898,6 +3784,33 @@ export namespace PriceEvaluateMultipleParams {
*/
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;
+ }
+ }
}
}
@@ -2986,36 +3899,35 @@ export namespace PriceEvaluatePreviewEventsParams {
grouping_keys?: Array;
/**
- * An inline price definition to evaluate, allowing you to test price
- * configurations before adding them to Orb.
+ * New floating price request body params.
*/
price?:
| Shared.NewFloatingUnitPrice
- | Shared.NewFloatingPackagePrice
- | Shared.NewFloatingMatrixPrice
- | Shared.NewFloatingMatrixWithAllocationPrice
| Shared.NewFloatingTieredPrice
| Shared.NewFloatingBulkPrice
+ | Shared.NewFloatingPackagePrice
+ | Shared.NewFloatingMatrixPrice
| Shared.NewFloatingThresholdTotalAmountPrice
| Shared.NewFloatingTieredPackagePrice
- | Shared.NewFloatingGroupedTieredPrice
- | Shared.NewFloatingMaxGroupTieredPackagePrice
| Shared.NewFloatingTieredWithMinimumPrice
- | Shared.NewFloatingPackageWithAllocationPrice
+ | Shared.NewFloatingGroupedTieredPrice
| Shared.NewFloatingTieredPackageWithMinimumPrice
+ | Shared.NewFloatingPackageWithAllocationPrice
| Shared.NewFloatingUnitWithPercentPrice
+ | Shared.NewFloatingMatrixWithAllocationPrice
| Shared.NewFloatingTieredWithProrationPrice
| Shared.NewFloatingUnitWithProrationPrice
| Shared.NewFloatingGroupedAllocationPrice
+ | Shared.NewFloatingBulkWithProrationPrice
| Shared.NewFloatingGroupedWithProratedMinimumPrice
| Shared.NewFloatingGroupedWithMeteredMinimumPrice
+ | PriceEvaluation.NewFloatingGroupedWithMinMaxThresholdsPrice
| Shared.NewFloatingMatrixWithDisplayNamePrice
- | Shared.NewFloatingBulkWithProrationPrice
| Shared.NewFloatingGroupedTieredPackagePrice
+ | Shared.NewFloatingMaxGroupTieredPackagePrice
| Shared.NewFloatingScalableMatrixWithUnitPricingPrice
| Shared.NewFloatingScalableMatrixWithTieredPricingPrice
| Shared.NewFloatingCumulativeGroupedBulkPrice
- | PriceEvaluation.NewFloatingGroupedWithMinMaxThresholdsPrice
| Shared.NewFloatingMinimumCompositePrice
| null;
@@ -3037,13 +3949,19 @@ export namespace PriceEvaluatePreviewEventsParams {
*/
currency: string;
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * 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';
/**
@@ -3113,6 +4031,33 @@ export namespace PriceEvaluatePreviewEventsParams {
*/
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;
+ }
+ }
}
}
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 67372dcb..28468465 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -155,6 +155,9 @@ export interface BillingCycleConfiguration {
export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
+/**
+ * Configuration for bulk pricing
+ */
export interface BulkConfig {
/**
* Bulk tiers for rating based on total usage volume
@@ -162,6 +165,9 @@ export interface BulkConfig {
tiers: Array;
}
+/**
+ * Configuration for a single bulk pricing tier
+ */
export interface BulkTier {
/**
* Amount per unit
@@ -1480,6 +1486,9 @@ export interface ItemSlim {
name: string;
}
+/**
+ * Configuration for matrix pricing
+ */
export interface MatrixConfig {
/**
* Default per unit rate for any usage not bucketed into a specified matrix_value
@@ -1492,7 +1501,7 @@ export interface MatrixConfig {
dimensions: Array;
/**
- * Matrix values for specified matrix grouping keys
+ * Matrix values configuration
*/
matrix_values: Array;
}
@@ -1514,11 +1523,12 @@ export interface MatrixSubLineItem {
type: 'matrix';
}
+/**
+ * Configuration for a single matrix value
+ */
export interface MatrixValue {
/**
- * One or two matrix keys to filter usage to this Matrix value by. For example,
- * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
- * instance tier.
+ * One or two matrix keys to filter usage to this Matrix value by
*/
dimension_values: Array;
@@ -1528,11 +1538,14 @@ export interface MatrixValue {
unit_amount: string;
}
+/**
+ * Configuration for matrix pricing with usage allocation
+ */
export interface MatrixWithAllocationConfig {
/**
- * Allocation to be used to calculate the price
+ * Usage allocation
*/
- allocation: number;
+ allocation: string;
/**
* Default per unit rate for any usage not bucketed into a specified matrix_value
@@ -1545,9 +1558,28 @@ export interface MatrixWithAllocationConfig {
dimensions: Array;
/**
- * Matrix values for specified matrix grouping keys
+ * Matrix values configuration
*/
- matrix_values: Array;
+ matrix_values: Array;
+}
+
+export namespace MatrixWithAllocationConfig {
+ /**
+ * Configuration for a single matrix value
+ */
+ export interface MatrixValue {
+ /**
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
+ * instance tier.
+ */
+ dimension_values: Array;
+
+ /**
+ * Unit price for the specified dimension_values
+ */
+ unit_amount: string;
+ }
}
export interface Maximum {
@@ -1969,6 +2001,9 @@ export interface NewDimensionalPriceConfiguration {
}
export interface NewFloatingBulkPrice {
+ /**
+ * Configuration for bulk pricing
+ */
bulk_config: BulkConfig;
/**
@@ -1986,6 +2021,9 @@ export interface NewFloatingBulkPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'bulk';
/**
@@ -2057,7 +2095,10 @@ export interface NewFloatingBulkPrice {
}
export interface NewFloatingBulkWithProrationPrice {
- bulk_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ bulk_with_proration_config: NewFloatingBulkWithProrationPrice.BulkWithProrationConfig;
/**
* The cadence to bill for this price on.
@@ -2074,6 +2115,9 @@ export interface NewFloatingBulkWithProrationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'bulk_with_proration';
/**
@@ -2144,13 +2188,45 @@ export interface NewFloatingBulkWithProrationPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingBulkWithProrationPrice {
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ export interface BulkWithProrationConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkWithProrationConfig {
+ /**
+ * Configuration for a single bulk pricing tier with proration
+ */
+ export interface Tier {
+ /**
+ * Cost per unit
+ */
+ unit_amount: string;
+
+ /**
+ * The lower bound for this tier
+ */
+ tier_lower_bound?: string | null;
+ }
+ }
+}
+
export interface NewFloatingCumulativeGroupedBulkPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- cumulative_grouped_bulk_config: { [key: string]: unknown };
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ cumulative_grouped_bulk_config: NewFloatingCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig;
/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2162,6 +2238,9 @@ export interface NewFloatingCumulativeGroupedBulkPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'cumulative_grouped_bulk';
/**
@@ -2232,6 +2311,45 @@ export interface NewFloatingCumulativeGroupedBulkPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingCumulativeGroupedBulkPrice {
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ export interface CumulativeGroupedBulkConfig {
+ /**
+ * Each tier lower bound must have the same group of values.
+ */
+ dimension_values: Array;
+
+ /**
+ * Grouping key name
+ */
+ group: string;
+ }
+
+ export namespace CumulativeGroupedBulkConfig {
+ /**
+ * Configuration for a dimension value entry
+ */
+ export interface DimensionValue {
+ /**
+ * Grouping key value
+ */
+ grouping_key: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Unit amount for this combination
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewFloatingGroupedAllocationPrice {
/**
* The cadence to bill for this price on.
@@ -2243,13 +2361,19 @@ export interface NewFloatingGroupedAllocationPrice {
*/
currency: string;
- grouped_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ grouped_allocation_config: NewFloatingGroupedAllocationPrice.GroupedAllocationConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_allocation';
/**
@@ -2320,6 +2444,28 @@ export interface NewFloatingGroupedAllocationPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingGroupedAllocationPrice {
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ export interface GroupedAllocationConfig {
+ /**
+ * Usage allocation per group
+ */
+ allocation: string;
+
+ /**
+ * How to determine the groups that should each be allocated some quantity
+ */
+ grouping_key: string;
+
+ /**
+ * Unit rate for post-allocation
+ */
+ overage_unit_rate: string;
+ }
+}
+
export interface NewFloatingGroupedTieredPackagePrice {
/**
* The cadence to bill for this price on.
@@ -2331,13 +2477,19 @@ export interface NewFloatingGroupedTieredPackagePrice {
*/
currency: string;
- grouped_tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ grouped_tiered_package_config: NewFloatingGroupedTieredPackagePrice.GroupedTieredPackageConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered_package';
/**
@@ -2408,6 +2560,46 @@ export interface NewFloatingGroupedTieredPackagePrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingGroupedTieredPackagePrice {
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ export interface GroupedTieredPackageConfig {
+ /**
+ * The event property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
export interface NewFloatingGroupedTieredPrice {
/**
* The cadence to bill for this price on.
@@ -2419,13 +2611,19 @@ export interface NewFloatingGroupedTieredPrice {
*/
currency: string;
- grouped_tiered_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ grouped_tiered_config: NewFloatingGroupedTieredPrice.GroupedTieredConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered';
/**
@@ -2496,6 +2694,41 @@ export interface NewFloatingGroupedTieredPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingGroupedTieredPrice {
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ export interface GroupedTieredConfig {
+ /**
+ * The billable metric property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Apply tiered pricing to each segment generated after grouping with the provided
+ * key
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewFloatingGroupedWithMeteredMinimumPrice {
/**
* The cadence to bill for this price on.
@@ -2507,13 +2740,19 @@ export interface NewFloatingGroupedWithMeteredMinimumPrice {
*/
currency: string;
- grouped_with_metered_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ grouped_with_metered_minimum_config: NewFloatingGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_metered_minimum';
/**
@@ -2584,6 +2823,77 @@ export interface NewFloatingGroupedWithMeteredMinimumPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingGroupedWithMeteredMinimumPrice {
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ export interface GroupedWithMeteredMinimumConfig {
+ /**
+ * Used to partition the usage into groups. The minimum amount is applied to each
+ * group.
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group per unit
+ */
+ minimum_unit_amount: string;
+
+ /**
+ * Used to determine the unit rate
+ */
+ pricing_key: string;
+
+ /**
+ * Scale the unit rates by the scaling factor.
+ */
+ scaling_factors: Array;
+
+ /**
+ * Used to determine the unit rate scaling factor
+ */
+ scaling_key: string;
+
+ /**
+ * Apply per unit pricing to each pricing value. The minimum amount is applied any
+ * unmatched usage.
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace GroupedWithMeteredMinimumConfig {
+ /**
+ * Configuration for a scaling factor
+ */
+ export interface ScalingFactor {
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Scaling value
+ */
+ scaling_value: string;
+ }
+
+ /**
+ * Configuration for a unit amount
+ */
+ export interface UnitAmount {
+ /**
+ * Pricing value
+ */
+ pricing_value: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewFloatingGroupedWithProratedMinimumPrice {
/**
* The cadence to bill for this price on.
@@ -2595,13 +2905,19 @@ export interface NewFloatingGroupedWithProratedMinimumPrice {
*/
currency: string;
- grouped_with_prorated_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ grouped_with_prorated_minimum_config: NewFloatingGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_prorated_minimum';
/**
@@ -2672,6 +2988,28 @@ export interface NewFloatingGroupedWithProratedMinimumPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingGroupedWithProratedMinimumPrice {
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ export interface GroupedWithProratedMinimumConfig {
+ /**
+ * How to determine the groups that should each have a minimum
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group
+ */
+ minimum: string;
+
+ /**
+ * The amount to charge per unit
+ */
+ unit_rate: string;
+ }
+}
+
export interface NewFloatingMatrixPrice {
/**
* The cadence to bill for this price on.
@@ -2688,8 +3026,14 @@ export interface NewFloatingMatrixPrice {
*/
item_id: string;
+ /**
+ * Configuration for matrix pricing
+ */
matrix_config: MatrixConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix';
/**
@@ -2776,8 +3120,14 @@ export interface NewFloatingMatrixWithAllocationPrice {
*/
item_id: string;
+ /**
+ * Configuration for matrix_with_allocation pricing
+ */
matrix_with_allocation_config: MatrixWithAllocationConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_allocation';
/**
@@ -2864,8 +3214,14 @@ export interface NewFloatingMatrixWithDisplayNamePrice {
*/
item_id: string;
- matrix_with_display_name_config: { [key: string]: unknown };
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ matrix_with_display_name_config: NewFloatingMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_display_name';
/**
@@ -2936,6 +3292,45 @@ export interface NewFloatingMatrixWithDisplayNamePrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingMatrixWithDisplayNamePrice {
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ export interface MatrixWithDisplayNameConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ dimension: string;
+
+ /**
+ * Apply per unit pricing to each dimension value
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace MatrixWithDisplayNameConfig {
+ /**
+ * Configuration for a unit amount item
+ */
+ export interface UnitAmount {
+ /**
+ * The dimension value
+ */
+ dimension_value: string;
+
+ /**
+ * Display name for this dimension value
+ */
+ display_name: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewFloatingMaxGroupTieredPackagePrice {
/**
* The cadence to bill for this price on.
@@ -2952,8 +3347,14 @@ export interface NewFloatingMaxGroupTieredPackagePrice {
*/
item_id: string;
- max_group_tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ max_group_tiered_package_config: NewFloatingMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'max_group_tiered_package';
/**
@@ -3024,24 +3425,69 @@ export interface NewFloatingMaxGroupTieredPackagePrice {
metadata?: { [key: string]: string | null } | null;
}
-export interface NewFloatingMinimumCompositePrice {
+export namespace NewFloatingMaxGroupTieredPackagePrice {
/**
- * The cadence to bill for this price on.
+ * Configuration for max_group_tiered_package pricing
*/
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ export interface MaxGroupTieredPackageConfig {
+ /**
+ * The event property used to group before tiering the group with the highest value
+ */
+ grouping_key: string;
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+ /**
+ * Package size
+ */
+ package_size: string;
- /**
- * The id of the item the price will be associated with.
- */
+ /**
+ * Apply tiered pricing to the largest group after grouping with the provided key.
+ */
+ tiers: Array;
+ }
+
+ export namespace MaxGroupTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
+export interface NewFloatingMinimumCompositePrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
item_id: string;
+ /**
+ * Configuration for minimum pricing
+ */
minimum_config: NewFloatingMinimumCompositePrice.MinimumConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'minimum';
/**
@@ -3113,6 +3559,9 @@ export interface NewFloatingMinimumCompositePrice {
}
export namespace NewFloatingMinimumCompositePrice {
+ /**
+ * Configuration for minimum pricing
+ */
export interface MinimumConfig {
/**
* The minimum amount to apply
@@ -3120,10 +3569,9 @@ export namespace NewFloatingMinimumCompositePrice {
minimum_amount: string;
/**
- * By default, subtotals from minimum composite prices are prorated based on the
- * service period. Set to false to disable proration.
+ * If true, subtotals from this price are prorated based on the service period
*/
- prorated?: boolean | null;
+ prorated?: boolean;
}
}
@@ -3143,6 +3591,9 @@ export interface NewFloatingPackagePrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'package';
/**
@@ -3150,6 +3601,9 @@ export interface NewFloatingPackagePrice {
*/
name: string;
+ /**
+ * Configuration for package pricing
+ */
package_config: PackageConfig;
/**
@@ -3231,6 +3685,9 @@ export interface NewFloatingPackageWithAllocationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'package_with_allocation';
/**
@@ -3238,7 +3695,10 @@ export interface NewFloatingPackageWithAllocationPrice {
*/
name: string;
- package_with_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ package_with_allocation_config: NewFloatingPackageWithAllocationPrice.PackageWithAllocationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3303,6 +3763,28 @@ export interface NewFloatingPackageWithAllocationPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingPackageWithAllocationPrice {
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ export interface PackageWithAllocationConfig {
+ /**
+ * Usage allocation
+ */
+ allocation: string;
+
+ /**
+ * Price per package
+ */
+ package_amount: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+ }
+}
+
export interface NewFloatingScalableMatrixWithTieredPricingPrice {
/**
* The cadence to bill for this price on.
@@ -3319,6 +3801,9 @@ export interface NewFloatingScalableMatrixWithTieredPricingPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'scalable_matrix_with_tiered_pricing';
/**
@@ -3326,7 +3811,10 @@ export interface NewFloatingScalableMatrixWithTieredPricingPrice {
*/
name: string;
- scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ scalable_matrix_with_tiered_pricing_config: NewFloatingScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3391,6 +3879,70 @@ export interface NewFloatingScalableMatrixWithTieredPricingPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingScalableMatrixWithTieredPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ export interface ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Used for the scalable matrix first dimension
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * Tier pricing structure
+ */
+ tiers: Array;
+
+ /**
+ * Used for the scalable matrix second dimension (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+
+ /**
+ * Configuration for a single tier entry with business logic
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewFloatingScalableMatrixWithUnitPricingPrice {
/**
* The cadence to bill for this price on.
@@ -3407,6 +3959,9 @@ export interface NewFloatingScalableMatrixWithUnitPricingPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'scalable_matrix_with_unit_pricing';
/**
@@ -3414,7 +3969,10 @@ export interface NewFloatingScalableMatrixWithUnitPricingPrice {
*/
name: string;
- scalable_matrix_with_unit_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ scalable_matrix_with_unit_pricing_config: NewFloatingScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3479,6 +4037,60 @@ export interface NewFloatingScalableMatrixWithUnitPricingPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingScalableMatrixWithUnitPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ export interface ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * The final unit price to rate against the output of the matrix
+ */
+ unit_price: string;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+
+ /**
+ * Used to determine the unit rate (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+ }
+}
+
export interface NewFloatingThresholdTotalAmountPrice {
/**
* The cadence to bill for this price on.
@@ -3495,6 +4107,9 @@ export interface NewFloatingThresholdTotalAmountPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'threshold_total_amount';
/**
@@ -3502,7 +4117,10 @@ export interface NewFloatingThresholdTotalAmountPrice {
*/
name: string;
- threshold_total_amount_config: { [key: string]: unknown };
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ threshold_total_amount_config: NewFloatingThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3567,6 +4185,41 @@ export interface NewFloatingThresholdTotalAmountPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingThresholdTotalAmountPrice {
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ export interface ThresholdTotalAmountConfig {
+ /**
+ * When the quantity consumed passes a provided threshold, the configured total
+ * will be charged
+ */
+ consumption_table: Array;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+ }
+
+ export namespace ThresholdTotalAmountConfig {
+ /**
+ * Configuration for a single threshold
+ */
+ export interface ConsumptionTable {
+ /**
+ * Quantity threshold
+ */
+ threshold: string;
+
+ /**
+ * Total amount for this threshold
+ */
+ total_amount: string;
+ }
+ }
+}
+
export interface NewFloatingTieredPackagePrice {
/**
* The cadence to bill for this price on.
@@ -3583,6 +4236,9 @@ export interface NewFloatingTieredPackagePrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_package';
/**
@@ -3590,7 +4246,10 @@ export interface NewFloatingTieredPackagePrice {
*/
name: string;
- tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package pricing
+ */
+ tiered_package_config: NewFloatingTieredPackagePrice.TieredPackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3655,6 +4314,41 @@ export interface NewFloatingTieredPackagePrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingTieredPackagePrice {
+ /**
+ * Configuration for tiered_package pricing
+ */
+ export interface TieredPackageConfig {
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageConfig {
+ /**
+ * Configuration for a single tier with business logic
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
export interface NewFloatingTieredPackageWithMinimumPrice {
/**
* The cadence to bill for this price on.
@@ -3671,6 +4365,9 @@ export interface NewFloatingTieredPackageWithMinimumPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_package_with_minimum';
/**
@@ -3678,7 +4375,10 @@ export interface NewFloatingTieredPackageWithMinimumPrice {
*/
name: string;
- tiered_package_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ tiered_package_with_minimum_config: NewFloatingTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3743,6 +4443,46 @@ export interface NewFloatingTieredPackageWithMinimumPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingTieredPackageWithMinimumPrice {
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ export interface TieredPackageWithMinimumConfig {
+ /**
+ * Package size
+ */
+ package_size: number;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
export interface NewFloatingTieredPrice {
/**
* The cadence to bill for this price on.
@@ -3759,6 +4499,9 @@ export interface NewFloatingTieredPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered';
/**
@@ -3766,6 +4509,9 @@ export interface NewFloatingTieredPrice {
*/
name: string;
+ /**
+ * Configuration for tiered pricing
+ */
tiered_config: TieredConfig;
/**
@@ -3847,6 +4593,9 @@ export interface NewFloatingTieredWithMinimumPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_with_minimum';
/**
@@ -3854,7 +4603,10 @@ export interface NewFloatingTieredWithMinimumPrice {
*/
name: string;
- tiered_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ tiered_with_minimum_config: NewFloatingTieredWithMinimumPrice.TieredWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3919,6 +4671,51 @@ export interface NewFloatingTieredWithMinimumPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingTieredWithMinimumPrice {
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ export interface TieredWithMinimumConfig {
+ /**
+ * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are
+ * defined using exclusive lower bounds.
+ */
+ tiers: Array;
+
+ /**
+ * If true, tiers with an accrued amount of 0 will not be included in the rating.
+ */
+ hide_zero_amount_tiers?: boolean;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean;
+ }
+
+ export namespace TieredWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewFloatingTieredWithProrationPrice {
/**
* The cadence to bill for this price on.
@@ -3935,6 +4732,9 @@ export interface NewFloatingTieredWithProrationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_with_proration';
/**
@@ -3942,7 +4742,10 @@ export interface NewFloatingTieredWithProrationPrice {
*/
name: string;
- tiered_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_with_proration pricing
+ */
+ tiered_with_proration_config: NewFloatingTieredWithProrationPrice.TieredWithProrationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -4007,13 +4810,43 @@ export interface NewFloatingTieredWithProrationPrice {
metadata?: { [key: string]: string | null } | null;
}
-export interface NewFloatingUnitPrice {
+export namespace NewFloatingTieredWithProrationPrice {
/**
- * The cadence to bill for this price on.
+ * Configuration for tiered_with_proration pricing
*/
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ 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 NewFloatingUnitPrice {
+ /**
+ * 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;
@@ -4023,6 +4856,9 @@ export interface NewFloatingUnitPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit';
/**
@@ -4030,6 +4866,9 @@ export interface NewFloatingUnitPrice {
*/
name: string;
+ /**
+ * Configuration for unit pricing
+ */
unit_config: UnitConfig;
/**
@@ -4111,6 +4950,9 @@ export interface NewFloatingUnitWithPercentPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit_with_percent';
/**
@@ -4118,7 +4960,10 @@ export interface NewFloatingUnitWithPercentPrice {
*/
name: string;
- unit_with_percent_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ unit_with_percent_config: NewFloatingUnitWithPercentPrice.UnitWithPercentConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -4183,6 +5028,23 @@ export interface NewFloatingUnitWithPercentPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingUnitWithPercentPrice {
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ export interface UnitWithPercentConfig {
+ /**
+ * What percent, out of 100, of the calculated total to charge
+ */
+ percent: string;
+
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+}
+
export interface NewFloatingUnitWithProrationPrice {
/**
* The cadence to bill for this price on.
@@ -4199,6 +5061,9 @@ export interface NewFloatingUnitWithProrationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit_with_proration';
/**
@@ -4206,7 +5071,10 @@ export interface NewFloatingUnitWithProrationPrice {
*/
name: string;
- unit_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ unit_with_proration_config: NewFloatingUnitWithProrationPrice.UnitWithProrationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -4271,6 +5139,18 @@ export interface NewFloatingUnitWithProrationPrice {
metadata?: { [key: string]: string | null } | null;
}
+export namespace NewFloatingUnitWithProrationPrice {
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ export interface UnitWithProrationConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+}
+
export interface NewMaximum {
adjustment_type: 'maximum';
@@ -4403,6 +5283,9 @@ export interface NewPercentageDiscount {
}
export interface NewPlanBulkPrice {
+ /**
+ * Configuration for bulk pricing
+ */
bulk_config: BulkConfig;
/**
@@ -4415,6 +5298,9 @@ export interface NewPlanBulkPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'bulk';
/**
@@ -4498,7 +5384,10 @@ export interface NewPlanBulkPrice {
}
export interface NewPlanBulkWithProrationPrice {
- bulk_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ bulk_with_proration_config: NewPlanBulkWithProrationPrice.BulkWithProrationConfig;
/**
* The cadence to bill for this price on.
@@ -4510,6 +5399,9 @@ export interface NewPlanBulkWithProrationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'bulk_with_proration';
/**
@@ -4592,19 +5484,54 @@ export interface NewPlanBulkWithProrationPrice {
reference_id?: string | null;
}
+export namespace NewPlanBulkWithProrationPrice {
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ export interface BulkWithProrationConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkWithProrationConfig {
+ /**
+ * Configuration for a single bulk pricing tier with proration
+ */
+ export interface Tier {
+ /**
+ * Cost per unit
+ */
+ unit_amount: string;
+
+ /**
+ * The lower bound for this tier
+ */
+ tier_lower_bound?: string | null;
+ }
+ }
+}
+
export interface NewPlanCumulativeGroupedBulkPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- cumulative_grouped_bulk_config: { [key: string]: unknown };
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ cumulative_grouped_bulk_config: NewPlanCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'cumulative_grouped_bulk';
/**
@@ -4687,19 +5614,64 @@ export interface NewPlanCumulativeGroupedBulkPrice {
reference_id?: string | null;
}
+export namespace NewPlanCumulativeGroupedBulkPrice {
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ export interface CumulativeGroupedBulkConfig {
+ /**
+ * Each tier lower bound must have the same group of values.
+ */
+ dimension_values: Array;
+
+ /**
+ * Grouping key name
+ */
+ group: string;
+ }
+
+ export namespace CumulativeGroupedBulkConfig {
+ /**
+ * Configuration for a dimension value entry
+ */
+ export interface DimensionValue {
+ /**
+ * Grouping key value
+ */
+ grouping_key: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Unit amount for this combination
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewPlanGroupedAllocationPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ grouped_allocation_config: NewPlanGroupedAllocationPrice.GroupedAllocationConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_allocation';
/**
@@ -4782,19 +5754,47 @@ export interface NewPlanGroupedAllocationPrice {
reference_id?: string | null;
}
+export namespace NewPlanGroupedAllocationPrice {
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ export interface GroupedAllocationConfig {
+ /**
+ * Usage allocation per group
+ */
+ allocation: string;
+
+ /**
+ * How to determine the groups that should each be allocated some quantity
+ */
+ grouping_key: string;
+
+ /**
+ * Unit rate for post-allocation
+ */
+ overage_unit_rate: string;
+ }
+}
+
export interface NewPlanGroupedTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ grouped_tiered_package_config: NewPlanGroupedTieredPackagePrice.GroupedTieredPackageConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered_package';
/**
@@ -4877,19 +5877,65 @@ export interface NewPlanGroupedTieredPackagePrice {
reference_id?: string | null;
}
+export namespace NewPlanGroupedTieredPackagePrice {
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ export interface GroupedTieredPackageConfig {
+ /**
+ * The event property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
export interface NewPlanGroupedTieredPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_tiered_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ grouped_tiered_config: NewPlanGroupedTieredPrice.GroupedTieredConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered';
/**
@@ -4972,19 +6018,60 @@ export interface NewPlanGroupedTieredPrice {
reference_id?: string | null;
}
+export namespace NewPlanGroupedTieredPrice {
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ export interface GroupedTieredConfig {
+ /**
+ * The billable metric property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Apply tiered pricing to each segment generated after grouping with the provided
+ * key
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewPlanGroupedWithMeteredMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_metered_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ grouped_with_metered_minimum_config: NewPlanGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_metered_minimum';
/**
@@ -5067,19 +6154,96 @@ export interface NewPlanGroupedWithMeteredMinimumPrice {
reference_id?: string | null;
}
+export namespace NewPlanGroupedWithMeteredMinimumPrice {
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ export interface GroupedWithMeteredMinimumConfig {
+ /**
+ * Used to partition the usage into groups. The minimum amount is applied to each
+ * group.
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group per unit
+ */
+ minimum_unit_amount: string;
+
+ /**
+ * Used to determine the unit rate
+ */
+ pricing_key: string;
+
+ /**
+ * Scale the unit rates by the scaling factor.
+ */
+ scaling_factors: Array;
+
+ /**
+ * Used to determine the unit rate scaling factor
+ */
+ scaling_key: string;
+
+ /**
+ * Apply per unit pricing to each pricing value. The minimum amount is applied any
+ * unmatched usage.
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace GroupedWithMeteredMinimumConfig {
+ /**
+ * Configuration for a scaling factor
+ */
+ export interface ScalingFactor {
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Scaling value
+ */
+ scaling_value: string;
+ }
+
+ /**
+ * Configuration for a unit amount
+ */
+ export interface UnitAmount {
+ /**
+ * Pricing value
+ */
+ pricing_value: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewPlanGroupedWithProratedMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_prorated_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ grouped_with_prorated_minimum_config: NewPlanGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_prorated_minimum';
/**
@@ -5162,6 +6326,28 @@ export interface NewPlanGroupedWithProratedMinimumPrice {
reference_id?: string | null;
}
+export namespace NewPlanGroupedWithProratedMinimumPrice {
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ export interface GroupedWithProratedMinimumConfig {
+ /**
+ * How to determine the groups that should each have a minimum
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group
+ */
+ minimum: string;
+
+ /**
+ * The amount to charge per unit
+ */
+ unit_rate: string;
+ }
+}
+
export interface NewPlanMatrixPrice {
/**
* The cadence to bill for this price on.
@@ -5173,8 +6359,14 @@ export interface NewPlanMatrixPrice {
*/
item_id: string;
+ /**
+ * Configuration for matrix pricing
+ */
matrix_config: MatrixConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix';
/**
@@ -5268,8 +6460,14 @@ export interface NewPlanMatrixWithAllocationPrice {
*/
item_id: string;
+ /**
+ * Configuration for matrix_with_allocation pricing
+ */
matrix_with_allocation_config: MatrixWithAllocationConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_allocation';
/**
@@ -5363,8 +6561,14 @@ export interface NewPlanMatrixWithDisplayNamePrice {
*/
item_id: string;
- matrix_with_display_name_config: { [key: string]: unknown };
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ matrix_with_display_name_config: NewPlanMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_display_name';
/**
@@ -5447,20 +6651,65 @@ export interface NewPlanMatrixWithDisplayNamePrice {
reference_id?: string | null;
}
-export interface NewPlanMaxGroupTieredPackagePrice {
- /**
- * The cadence to bill for this price on.
- */
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
-
+export namespace NewPlanMatrixWithDisplayNamePrice {
/**
- * The id of the item the price will be associated with.
+ * Configuration for matrix_with_display_name pricing
*/
- item_id: string;
-
- max_group_tiered_package_config: { [key: string]: unknown };
+ export interface MatrixWithDisplayNameConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ dimension: string;
- model_type: 'max_group_tiered_package';
+ /**
+ * Apply per unit pricing to each dimension value
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace MatrixWithDisplayNameConfig {
+ /**
+ * Configuration for a unit amount item
+ */
+ export interface UnitAmount {
+ /**
+ * The dimension value
+ */
+ dimension_value: string;
+
+ /**
+ * Display name for this dimension value
+ */
+ display_name: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
+export interface NewPlanMaxGroupTieredPackagePrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ max_group_tiered_package_config: NewPlanMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig;
+
+ /**
+ * The pricing model type
+ */
+ model_type: 'max_group_tiered_package';
/**
* The name of the price.
@@ -5542,6 +6791,45 @@ export interface NewPlanMaxGroupTieredPackagePrice {
reference_id?: string | null;
}
+export namespace NewPlanMaxGroupTieredPackagePrice {
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ export interface MaxGroupTieredPackageConfig {
+ /**
+ * The event property used to group before tiering the group with the highest value
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing to the largest group after grouping with the provided key.
+ */
+ tiers: Array;
+ }
+
+ export namespace MaxGroupTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewPlanMinimumCompositePrice {
/**
* The cadence to bill for this price on.
@@ -5553,8 +6841,14 @@ export interface NewPlanMinimumCompositePrice {
*/
item_id: string;
+ /**
+ * Configuration for minimum pricing
+ */
minimum_config: NewPlanMinimumCompositePrice.MinimumConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'minimum';
/**
@@ -5638,6 +6932,9 @@ export interface NewPlanMinimumCompositePrice {
}
export namespace NewPlanMinimumCompositePrice {
+ /**
+ * Configuration for minimum pricing
+ */
export interface MinimumConfig {
/**
* The minimum amount to apply
@@ -5645,10 +6942,9 @@ export namespace NewPlanMinimumCompositePrice {
minimum_amount: string;
/**
- * By default, subtotals from minimum composite prices are prorated based on the
- * service period. Set to false to disable proration.
+ * If true, subtotals from this price are prorated based on the service period
*/
- prorated?: boolean | null;
+ prorated?: boolean;
}
}
@@ -5663,6 +6959,9 @@ export interface NewPlanPackagePrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'package';
/**
@@ -5670,6 +6969,9 @@ export interface NewPlanPackagePrice {
*/
name: string;
+ /**
+ * Configuration for package pricing
+ */
package_config: PackageConfig;
/**
@@ -5758,6 +7060,9 @@ export interface NewPlanPackageWithAllocationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'package_with_allocation';
/**
@@ -5765,7 +7070,10 @@ export interface NewPlanPackageWithAllocationPrice {
*/
name: string;
- package_with_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ package_with_allocation_config: NewPlanPackageWithAllocationPrice.PackageWithAllocationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -5842,6 +7150,28 @@ export interface NewPlanPackageWithAllocationPrice {
reference_id?: string | null;
}
+export namespace NewPlanPackageWithAllocationPrice {
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ export interface PackageWithAllocationConfig {
+ /**
+ * Usage allocation
+ */
+ allocation: string;
+
+ /**
+ * Price per package
+ */
+ package_amount: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+ }
+}
+
export interface NewPlanScalableMatrixWithTieredPricingPrice {
/**
* The cadence to bill for this price on.
@@ -5853,6 +7183,9 @@ export interface NewPlanScalableMatrixWithTieredPricingPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'scalable_matrix_with_tiered_pricing';
/**
@@ -5860,7 +7193,10 @@ export interface NewPlanScalableMatrixWithTieredPricingPrice {
*/
name: string;
- scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ scalable_matrix_with_tiered_pricing_config: NewPlanScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -5937,6 +7273,70 @@ export interface NewPlanScalableMatrixWithTieredPricingPrice {
reference_id?: string | null;
}
+export namespace NewPlanScalableMatrixWithTieredPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ export interface ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Used for the scalable matrix first dimension
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * Tier pricing structure
+ */
+ tiers: Array;
+
+ /**
+ * Used for the scalable matrix second dimension (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+
+ /**
+ * Configuration for a single tier entry with business logic
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewPlanScalableMatrixWithUnitPricingPrice {
/**
* The cadence to bill for this price on.
@@ -5948,6 +7348,9 @@ export interface NewPlanScalableMatrixWithUnitPricingPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'scalable_matrix_with_unit_pricing';
/**
@@ -5955,7 +7358,10 @@ export interface NewPlanScalableMatrixWithUnitPricingPrice {
*/
name: string;
- scalable_matrix_with_unit_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ scalable_matrix_with_unit_pricing_config: NewPlanScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6032,6 +7438,60 @@ export interface NewPlanScalableMatrixWithUnitPricingPrice {
reference_id?: string | null;
}
+export namespace NewPlanScalableMatrixWithUnitPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ export interface ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * The final unit price to rate against the output of the matrix
+ */
+ unit_price: string;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+
+ /**
+ * Used to determine the unit rate (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+ }
+}
+
export interface NewPlanThresholdTotalAmountPrice {
/**
* The cadence to bill for this price on.
@@ -6043,6 +7503,9 @@ export interface NewPlanThresholdTotalAmountPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'threshold_total_amount';
/**
@@ -6050,7 +7513,10 @@ export interface NewPlanThresholdTotalAmountPrice {
*/
name: string;
- threshold_total_amount_config: { [key: string]: unknown };
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ threshold_total_amount_config: NewPlanThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6127,7 +7593,42 @@ export interface NewPlanThresholdTotalAmountPrice {
reference_id?: string | null;
}
-export interface NewPlanTierWithProrationPrice {
+export namespace NewPlanThresholdTotalAmountPrice {
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ export interface ThresholdTotalAmountConfig {
+ /**
+ * When the quantity consumed passes a provided threshold, the configured total
+ * will be charged
+ */
+ consumption_table: Array;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+ }
+
+ export namespace ThresholdTotalAmountConfig {
+ /**
+ * Configuration for a single threshold
+ */
+ export interface ConsumptionTable {
+ /**
+ * Quantity threshold
+ */
+ threshold: string;
+
+ /**
+ * Total amount for this threshold
+ */
+ total_amount: string;
+ }
+ }
+}
+
+export interface NewPlanTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -6138,14 +7639,20 @@ export interface NewPlanTierWithProrationPrice {
*/
item_id: string;
- model_type: 'tiered_with_proration';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_package';
/**
* The name of the price.
*/
name: string;
- tiered_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package pricing
+ */
+ tiered_package_config: NewPlanTieredPackagePrice.TieredPackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6222,7 +7729,42 @@ export interface NewPlanTierWithProrationPrice {
reference_id?: string | null;
}
-export interface NewPlanTieredPackagePrice {
+export namespace NewPlanTieredPackagePrice {
+ /**
+ * Configuration for tiered_package pricing
+ */
+ export interface TieredPackageConfig {
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageConfig {
+ /**
+ * Configuration for a single tier with business logic
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
+export interface NewPlanTieredPackageWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -6233,14 +7775,20 @@ export interface NewPlanTieredPackagePrice {
*/
item_id: string;
- model_type: 'tiered_package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_package_with_minimum';
/**
* The name of the price.
*/
name: string;
- tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ tiered_package_with_minimum_config: NewPlanTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6317,7 +7865,47 @@ export interface NewPlanTieredPackagePrice {
reference_id?: string | null;
}
-export interface NewPlanTieredPackageWithMinimumPrice {
+export namespace NewPlanTieredPackageWithMinimumPrice {
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ export interface TieredPackageWithMinimumConfig {
+ /**
+ * Package size
+ */
+ package_size: number;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
+export interface NewPlanTieredPrice {
/**
* The cadence to bill for this price on.
*/
@@ -6328,14 +7916,20 @@ export interface NewPlanTieredPackageWithMinimumPrice {
*/
item_id: string;
- model_type: 'tiered_package_with_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered';
/**
* The name of the price.
*/
name: string;
- tiered_package_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered pricing
+ */
+ tiered_config: TieredConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6412,7 +8006,7 @@ export interface NewPlanTieredPackageWithMinimumPrice {
reference_id?: string | null;
}
-export interface NewPlanTieredPrice {
+export interface NewPlanTieredWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -6423,14 +8017,20 @@ export interface NewPlanTieredPrice {
*/
item_id: string;
- model_type: 'tiered';
-
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_with_minimum';
+
/**
* The name of the price.
*/
name: string;
- tiered_config: TieredConfig;
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ tiered_with_minimum_config: NewPlanTieredWithMinimumPrice.TieredWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6507,99 +8107,49 @@ export interface NewPlanTieredPrice {
reference_id?: string | null;
}
-export interface NewPlanTieredWithMinimumPrice {
- /**
- * 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;
-
- model_type: 'tiered_with_minimum';
-
- /**
- * The name of the price.
- */
- name: string;
-
- tiered_with_minimum_config: { [key: string]: unknown };
-
- /**
- * 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?: 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?: UnitConversionRateConfig | 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?: NewDimensionalPriceConfiguration | null;
-
+export namespace NewPlanTieredWithMinimumPrice {
/**
- * An alias for the price.
+ * Configuration for tiered_with_minimum pricing
*/
- external_price_id?: string | null;
+ export interface TieredWithMinimumConfig {
+ /**
+ * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are
+ * defined using exclusive lower bounds.
+ */
+ tiers: Array;
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fixed_price_quantity?: number | null;
+ /**
+ * If true, tiers with an accrued amount of 0 will not be included in the rating.
+ */
+ hide_zero_amount_tiers?: boolean;
- /**
- * The property used to group this price on an invoice
- */
- invoice_grouping_key?: string | null;
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean;
+ }
- /**
- * 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?: NewBillingCycleConfiguration | null;
+ export namespace TieredWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
- /**
- * 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;
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
- /**
- * A transient ID that can be used to reference this price when adding adjustments
- * in the same API call.
- */
- reference_id?: string | null;
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
}
export interface NewPlanUnitPrice {
@@ -6613,6 +8163,9 @@ export interface NewPlanUnitPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit';
/**
@@ -6620,6 +8173,9 @@ export interface NewPlanUnitPrice {
*/
name: string;
+ /**
+ * Configuration for unit pricing
+ */
unit_config: UnitConfig;
/**
@@ -6708,6 +8264,9 @@ export interface NewPlanUnitWithPercentPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit_with_percent';
/**
@@ -6715,7 +8274,10 @@ export interface NewPlanUnitWithPercentPrice {
*/
name: string;
- unit_with_percent_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ unit_with_percent_config: NewPlanUnitWithPercentPrice.UnitWithPercentConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6792,6 +8354,23 @@ export interface NewPlanUnitWithPercentPrice {
reference_id?: string | null;
}
+export namespace NewPlanUnitWithPercentPrice {
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ export interface UnitWithPercentConfig {
+ /**
+ * What percent, out of 100, of the calculated total to charge
+ */
+ percent: string;
+
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+}
+
export interface NewPlanUnitWithProrationPrice {
/**
* The cadence to bill for this price on.
@@ -6803,6 +8382,9 @@ export interface NewPlanUnitWithProrationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'unit_with_proration';
/**
@@ -6810,7 +8392,10 @@ export interface NewPlanUnitWithProrationPrice {
*/
name: string;
- unit_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ unit_with_proration_config: NewPlanUnitWithProrationPrice.UnitWithProrationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -6887,6 +8472,18 @@ export interface NewPlanUnitWithProrationPrice {
reference_id?: string | null;
}
+export namespace NewPlanUnitWithProrationPrice {
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ export interface UnitWithProrationConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+}
+
export interface NewUsageDiscount {
adjustment_type: 'usage_discount';
@@ -6944,6 +8541,9 @@ export interface OtherSubLineItem {
type: "'null'";
}
+/**
+ * Configuration for package pricing
+ */
export interface PackageConfig {
/**
* A currency amount to rate usage by
@@ -7282,14 +8882,14 @@ export interface PlanPhaseUsageDiscountAdjustment {
*/
export type Price =
| Price.UnitPrice
- | Price.PackagePrice
- | Price.MatrixPrice
| Price.TieredPrice
| Price.BulkPrice
+ | Price.PackagePrice
+ | Price.MatrixPrice
| Price.ThresholdTotalAmountPrice
| Price.TieredPackagePrice
- | Price.GroupedTieredPrice
| Price.TieredWithMinimumPrice
+ | Price.GroupedTieredPrice
| Price.TieredPackageWithMinimumPrice
| Price.PackageWithAllocationPrice
| Price.UnitWithPercentPrice
@@ -7297,16 +8897,16 @@ export type Price =
| Price.TieredWithProrationPrice
| Price.UnitWithProrationPrice
| Price.GroupedAllocationPrice
+ | Price.BulkWithProrationPrice
| Price.GroupedWithProratedMinimumPrice
| Price.GroupedWithMeteredMinimumPrice
+ | Price.GroupedWithMinMaxThresholdsPrice
| Price.MatrixWithDisplayNamePrice
- | Price.BulkWithProrationPrice
| Price.GroupedTieredPackagePrice
| Price.MaxGroupTieredPackagePrice
| Price.ScalableMatrixWithUnitPricingPrice
| Price.ScalableMatrixWithTieredPricingPrice
| Price.CumulativeGroupedBulkPrice
- | Price.GroupedWithMinMaxThresholdsPrice
| Price.MinimumCompositePrice;
export namespace Price {
@@ -7372,13 +8972,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'unit';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7386,12 +8989,15 @@ export namespace Price {
*/
replaces_price_id: string | null;
+ /**
+ * Configuration for unit pricing
+ */
unit_config: Shared.UnitConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface PackagePrice {
+ export interface TieredPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -7453,15 +9059,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered';
name: string;
- package_config: Shared.PackageConfig;
-
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7469,16 +9076,26 @@ export namespace Price {
*/
replaces_price_id: string | null;
+ /**
+ * Configuration for tiered pricing
+ */
+ tiered_config: Shared.TieredConfig;
+
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface MatrixPrice {
+ export interface BulkPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
billing_cycle_configuration: Shared.BillingCycleConfiguration;
+ /**
+ * Configuration for bulk pricing
+ */
+ bulk_config: Shared.BulkConfig;
+
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
composite_price_filters: Array | null;
@@ -7506,8 +9123,6 @@ export namespace Price {
item: Shared.ItemSlim;
- matrix_config: Shared.MatrixConfig;
-
/**
* @deprecated
*/
@@ -7536,13 +9151,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'matrix';
+ /**
+ * The pricing model type
+ */
+ model_type: 'bulk';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7553,7 +9171,7 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface TieredPrice {
+ export interface PackagePrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -7615,13 +9233,21 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'tiered';
+ /**
+ * The pricing model type
+ */
+ model_type: 'package';
name: string;
+ /**
+ * Configuration for package pricing
+ */
+ package_config: Shared.PackageConfig;
+
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7629,20 +9255,16 @@ export namespace Price {
*/
replaces_price_id: string | null;
- tiered_config: Shared.TieredConfig;
-
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface BulkPrice {
+ export interface MatrixPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
billing_cycle_configuration: Shared.BillingCycleConfiguration;
- bulk_config: Shared.BulkConfig;
-
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
composite_price_filters: Array | null;
@@ -7670,6 +9292,11 @@ export namespace Price {
item: Shared.ItemSlim;
+ /**
+ * Configuration for matrix pricing
+ */
+ matrix_config: Shared.MatrixConfig;
+
/**
* @deprecated
*/
@@ -7698,13 +9325,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'bulk';
+ /**
+ * The pricing model type
+ */
+ model_type: 'matrix';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7777,13 +9407,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'threshold_total_amount';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7791,11 +9424,49 @@ export namespace Price {
*/
replaces_price_id: string | null;
- threshold_total_amount_config: { [key: string]: unknown };
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ threshold_total_amount_config: ThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace ThresholdTotalAmountPrice {
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ export interface ThresholdTotalAmountConfig {
+ /**
+ * When the quantity consumed passes a provided threshold, the configured total
+ * will be charged
+ */
+ consumption_table: Array;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+ }
+
+ export namespace ThresholdTotalAmountConfig {
+ /**
+ * Configuration for a single threshold
+ */
+ export interface ConsumptionTable {
+ /**
+ * Quantity threshold
+ */
+ threshold: string;
+
+ /**
+ * Total amount for this threshold
+ */
+ total_amount: string;
+ }
+ }
+ }
+
export interface TieredPackagePrice {
id: string;
@@ -7858,13 +9529,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_package';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7872,12 +9546,50 @@ export namespace Price {
*/
replaces_price_id: string | null;
- tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package pricing
+ */
+ tiered_package_config: TieredPackagePrice.TieredPackageConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface GroupedTieredPrice {
+ export namespace TieredPackagePrice {
+ /**
+ * Configuration for tiered_package pricing
+ */
+ export interface TieredPackageConfig {
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageConfig {
+ /**
+ * Configuration for a single tier with business logic
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+ }
+
+ export interface TieredWithMinimumPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -7907,8 +9619,6 @@ export namespace Price {
fixed_price_quantity: number | null;
- grouped_tiered_config: { [key: string]: unknown };
-
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
@@ -7941,13 +9651,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'grouped_tiered';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_with_minimum';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -7955,13 +9668,63 @@ export namespace Price {
*/
replaces_price_id: string | null;
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ tiered_with_minimum_config: TieredWithMinimumPrice.TieredWithMinimumConfig;
+
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface TieredWithMinimumPrice {
- id: string;
+ export namespace TieredWithMinimumPrice {
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ export interface TieredWithMinimumConfig {
+ /**
+ * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are
+ * defined using exclusive lower bounds.
+ */
+ tiers: Array;
- billable_metric: Shared.BillableMetricTiny | null;
+ /**
+ * If true, tiers with an accrued amount of 0 will not be included in the rating.
+ */
+ hide_zero_amount_tiers?: boolean;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean;
+ }
+
+ export namespace TieredWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface GroupedTieredPrice {
+ id: string;
+
+ billable_metric: Shared.BillableMetricTiny | null;
billing_cycle_configuration: Shared.BillingCycleConfiguration;
@@ -7988,6 +9751,11 @@ export namespace Price {
fixed_price_quantity: number | null;
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ grouped_tiered_config: GroupedTieredPrice.GroupedTieredConfig;
+
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
@@ -8020,13 +9788,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'tiered_with_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_tiered';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8034,11 +9805,44 @@ export namespace Price {
*/
replaces_price_id: string | null;
- tiered_with_minimum_config: { [key: string]: unknown };
-
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace GroupedTieredPrice {
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ export interface GroupedTieredConfig {
+ /**
+ * The billable metric property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Apply tiered pricing to each segment generated after grouping with the provided
+ * key
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
export interface TieredPackageWithMinimumPrice {
id: string;
@@ -8101,13 +9905,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_package_with_minimum';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8115,11 +9922,54 @@ export namespace Price {
*/
replaces_price_id: string | null;
- tiered_package_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ tiered_package_with_minimum_config: TieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace TieredPackageWithMinimumPrice {
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ export interface TieredPackageWithMinimumConfig {
+ /**
+ * Package size
+ */
+ package_size: number;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+ }
+
export interface PackageWithAllocationPrice {
id: string;
@@ -8182,15 +10032,21 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'package_with_allocation';
name: string;
- package_with_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ package_with_allocation_config: PackageWithAllocationPrice.PackageWithAllocationConfig;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8201,6 +10057,28 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace PackageWithAllocationPrice {
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ export interface PackageWithAllocationConfig {
+ /**
+ * Usage allocation
+ */
+ allocation: string;
+
+ /**
+ * Price per package
+ */
+ package_amount: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+ }
+ }
+
export interface UnitWithPercentPrice {
id: string;
@@ -8263,13 +10141,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'unit_with_percent';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8277,11 +10158,31 @@ export namespace Price {
*/
replaces_price_id: string | null;
- unit_with_percent_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ unit_with_percent_config: UnitWithPercentPrice.UnitWithPercentConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace UnitWithPercentPrice {
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ export interface UnitWithPercentConfig {
+ /**
+ * What percent, out of 100, of the calculated total to charge
+ */
+ percent: string;
+
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+ }
+
export interface MatrixWithAllocationPrice {
id: string;
@@ -8316,6 +10217,9 @@ export namespace Price {
item: Shared.ItemSlim;
+ /**
+ * Configuration for matrix_with_allocation pricing
+ */
matrix_with_allocation_config: Shared.MatrixWithAllocationConfig;
/**
@@ -8346,13 +10250,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_allocation';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8425,13 +10332,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'tiered_with_proration';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8439,11 +10349,44 @@ export namespace Price {
*/
replaces_price_id: string | null;
- tiered_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_with_proration pricing
+ */
+ tiered_with_proration_config: TieredWithProrationPrice.TieredWithProrationConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace TieredWithProrationPrice {
+ /**
+ * 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 UnitWithProrationPrice {
id: string;
@@ -8506,13 +10449,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'unit_with_proration';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8520,11 +10466,26 @@ export namespace Price {
*/
replaces_price_id: string | null;
- unit_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ unit_with_proration_config: UnitWithProrationPrice.UnitWithProrationConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace UnitWithProrationPrice {
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ export interface UnitWithProrationConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+ }
+
export interface GroupedAllocationPrice {
id: string;
@@ -8555,7 +10516,10 @@ export namespace Price {
fixed_price_quantity: number | null;
- grouped_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ grouped_allocation_config: GroupedAllocationPrice.GroupedAllocationConfig;
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
@@ -8589,13 +10553,16 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_allocation';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8606,13 +10573,40 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface GroupedWithProratedMinimumPrice {
+ export namespace GroupedAllocationPrice {
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ export interface GroupedAllocationConfig {
+ /**
+ * Usage allocation per group
+ */
+ allocation: string;
+
+ /**
+ * How to determine the groups that should each be allocated some quantity
+ */
+ grouping_key: string;
+
+ /**
+ * Unit rate for post-allocation
+ */
+ overage_unit_rate: string;
+ }
+ }
+
+ export interface BulkWithProrationPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
billing_cycle_configuration: Shared.BillingCycleConfiguration;
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ bulk_with_proration_config: BulkWithProrationPrice.BulkWithProrationConfig;
+
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
composite_price_filters: Array | null;
@@ -8636,8 +10630,6 @@ export namespace Price {
fixed_price_quantity: number | null;
- grouped_with_prorated_minimum_config: { [key: string]: unknown };
-
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
@@ -8670,13 +10662,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'grouped_with_prorated_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'bulk_with_proration';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8687,7 +10682,36 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface GroupedWithMeteredMinimumPrice {
+ export namespace BulkWithProrationPrice {
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ export interface BulkWithProrationConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkWithProrationConfig {
+ /**
+ * Configuration for a single bulk pricing tier with proration
+ */
+ export interface Tier {
+ /**
+ * Cost per unit
+ */
+ unit_amount: string;
+
+ /**
+ * The lower bound for this tier
+ */
+ tier_lower_bound?: string | null;
+ }
+ }
+ }
+
+ export interface GroupedWithProratedMinimumPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -8717,7 +10741,10 @@ export namespace Price {
fixed_price_quantity: number | null;
- grouped_with_metered_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ grouped_with_prorated_minimum_config: GroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig;
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
@@ -8751,13 +10778,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'grouped_with_metered_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_with_prorated_minimum';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8768,7 +10798,29 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface MatrixWithDisplayNamePrice {
+ export namespace GroupedWithProratedMinimumPrice {
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ export interface GroupedWithProratedMinimumConfig {
+ /**
+ * How to determine the groups that should each have a minimum
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group
+ */
+ minimum: string;
+
+ /**
+ * The amount to charge per unit
+ */
+ unit_rate: string;
+ }
+ }
+
+ export interface GroupedWithMeteredMinimumPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -8798,12 +10850,15 @@ export namespace Price {
fixed_price_quantity: number | null;
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ grouped_with_metered_minimum_config: GroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig;
+
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
- matrix_with_display_name_config: { [key: string]: unknown };
-
/**
* @deprecated
*/
@@ -8832,13 +10887,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'matrix_with_display_name';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_with_metered_minimum';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8849,15 +10907,84 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface BulkWithProrationPrice {
+ export namespace GroupedWithMeteredMinimumPrice {
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ export interface GroupedWithMeteredMinimumConfig {
+ /**
+ * Used to partition the usage into groups. The minimum amount is applied to each
+ * group.
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group per unit
+ */
+ minimum_unit_amount: string;
+
+ /**
+ * Used to determine the unit rate
+ */
+ pricing_key: string;
+
+ /**
+ * Scale the unit rates by the scaling factor.
+ */
+ scaling_factors: Array;
+
+ /**
+ * Used to determine the unit rate scaling factor
+ */
+ scaling_key: string;
+
+ /**
+ * Apply per unit pricing to each pricing value. The minimum amount is applied any
+ * unmatched usage.
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace GroupedWithMeteredMinimumConfig {
+ /**
+ * Configuration for a scaling factor
+ */
+ export interface ScalingFactor {
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Scaling value
+ */
+ scaling_value: string;
+ }
+
+ /**
+ * Configuration for a unit amount
+ */
+ export interface UnitAmount {
+ /**
+ * Pricing value
+ */
+ pricing_value: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface GroupedWithMinMaxThresholdsPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
billing_cycle_configuration: Shared.BillingCycleConfiguration;
- bulk_with_proration_config: { [key: string]: unknown };
-
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
composite_price_filters: Array | null;
@@ -8881,6 +11008,11 @@ export namespace Price {
fixed_price_quantity: number | null;
+ /**
+ * Configuration for grouped_with_min_max_thresholds pricing
+ */
+ grouped_with_min_max_thresholds_config: GroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
+
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
@@ -8913,13 +11045,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'bulk_with_proration';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_with_min_max_thresholds';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -8930,7 +11065,34 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface GroupedTieredPackagePrice {
+ export namespace GroupedWithMinMaxThresholdsPrice {
+ /**
+ * 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 MatrixWithDisplayNamePrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -8960,12 +11122,15 @@ export namespace Price {
fixed_price_quantity: number | null;
- grouped_tiered_package_config: { [key: string]: unknown };
-
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ matrix_with_display_name_config: MatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig;
+
/**
* @deprecated
*/
@@ -8994,13 +11159,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'grouped_tiered_package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'matrix_with_display_name';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9011,7 +11179,46 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface MaxGroupTieredPackagePrice {
+ export namespace MatrixWithDisplayNamePrice {
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ export interface MatrixWithDisplayNameConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ dimension: string;
+
+ /**
+ * Apply per unit pricing to each dimension value
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace MatrixWithDisplayNameConfig {
+ /**
+ * Configuration for a unit amount item
+ */
+ export interface UnitAmount {
+ /**
+ * The dimension value
+ */
+ dimension_value: string;
+
+ /**
+ * Display name for this dimension value
+ */
+ display_name: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface GroupedTieredPackagePrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -9041,12 +11248,15 @@ export namespace Price {
fixed_price_quantity: number | null;
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ grouped_tiered_package_config: GroupedTieredPackagePrice.GroupedTieredPackageConfig;
+
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
- max_group_tiered_package_config: { [key: string]: unknown };
-
/**
* @deprecated
*/
@@ -9075,13 +11285,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'max_group_tiered_package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'grouped_tiered_package';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9092,7 +11305,47 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface ScalableMatrixWithUnitPricingPrice {
+ export namespace GroupedTieredPackagePrice {
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ export interface GroupedTieredPackageConfig {
+ /**
+ * The event property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+ }
+
+ export interface MaxGroupTieredPackagePrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -9126,6 +11379,11 @@ export namespace Price {
item: Shared.ItemSlim;
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ max_group_tiered_package_config: MaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig;
+
/**
* @deprecated
*/
@@ -9154,13 +11412,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'scalable_matrix_with_unit_pricing';
+ /**
+ * The pricing model type
+ */
+ model_type: 'max_group_tiered_package';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9168,12 +11429,49 @@ export namespace Price {
*/
replaces_price_id: string | null;
- scalable_matrix_with_unit_pricing_config: { [key: string]: unknown };
-
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface ScalableMatrixWithTieredPricingPrice {
+ export namespace MaxGroupTieredPackagePrice {
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ export interface MaxGroupTieredPackageConfig {
+ /**
+ * The event property used to group before tiering the group with the highest value
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing to the largest group after grouping with the provided key.
+ */
+ tiers: Array;
+ }
+
+ export namespace MaxGroupTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface ScalableMatrixWithUnitPricingPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -9235,13 +11533,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'scalable_matrix_with_tiered_pricing';
+ /**
+ * The pricing model type
+ */
+ model_type: 'scalable_matrix_with_unit_pricing';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9249,12 +11550,69 @@ export namespace Price {
*/
replaces_price_id: string | null;
- scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ scalable_matrix_with_unit_pricing_config: ScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig;
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface CumulativeGroupedBulkPrice {
+ export namespace ScalableMatrixWithUnitPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ export interface ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * The final unit price to rate against the output of the matrix
+ */
+ unit_price: string;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+
+ /**
+ * Used to determine the unit rate (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+ }
+ }
+
+ export interface ScalableMatrixWithTieredPricingPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -9273,8 +11631,6 @@ export namespace Price {
credit_allocation: Shared.Allocation | null;
- cumulative_grouped_bulk_config: { [key: string]: unknown };
-
currency: string;
/**
@@ -9318,13 +11674,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'cumulative_grouped_bulk';
+ /**
+ * The pricing model type
+ */
+ model_type: 'scalable_matrix_with_tiered_pricing';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9332,10 +11691,79 @@ export namespace Price {
*/
replaces_price_id: string | null;
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ scalable_matrix_with_tiered_pricing_config: ScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig;
+
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
- export interface GroupedWithMinMaxThresholdsPrice {
+ export namespace ScalableMatrixWithTieredPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ export interface ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Used for the scalable matrix first dimension
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * Tier pricing structure
+ */
+ tiers: Array;
+
+ /**
+ * Used for the scalable matrix second dimension (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+
+ /**
+ * Configuration for a single tier entry with business logic
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
+ export interface CumulativeGroupedBulkPrice {
id: string;
billable_metric: Shared.BillableMetricTiny | null;
@@ -9354,6 +11782,11 @@ export namespace Price {
credit_allocation: Shared.Allocation | null;
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ cumulative_grouped_bulk_config: CumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig;
+
currency: string;
/**
@@ -9365,8 +11798,6 @@ export namespace Price {
fixed_price_quantity: number | null;
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
-
invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null;
item: Shared.ItemSlim;
@@ -9399,13 +11830,16 @@ export namespace Price {
*/
minimum_amount: string | null;
- model_type: 'grouped_with_min_max_thresholds';
+ /**
+ * The pricing model type
+ */
+ model_type: 'cumulative_grouped_bulk';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9416,6 +11850,45 @@ export namespace Price {
dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null;
}
+ export namespace CumulativeGroupedBulkPrice {
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ export interface CumulativeGroupedBulkConfig {
+ /**
+ * Each tier lower bound must have the same group of values.
+ */
+ dimension_values: Array;
+
+ /**
+ * Grouping key name
+ */
+ group: string;
+ }
+
+ export namespace CumulativeGroupedBulkConfig {
+ /**
+ * Configuration for a dimension value entry
+ */
+ export interface DimensionValue {
+ /**
+ * Grouping key value
+ */
+ grouping_key: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Unit amount for this combination
+ */
+ unit_amount: string;
+ }
+ }
+ }
+
export interface MinimumCompositePrice {
id: string;
@@ -9478,15 +11951,21 @@ export namespace Price {
*/
minimum_amount: string | null;
+ /**
+ * Configuration for minimum pricing
+ */
minimum_config: MinimumCompositePrice.MinimumConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'minimum';
name: string;
plan_phase_order: number | null;
- price_type: 'usage_price' | 'fixed_price';
+ price_type: 'usage_price' | 'fixed_price' | 'composite_price';
/**
* The price id this price replaces. This price will take the place of the replaced
@@ -9498,6 +11977,9 @@ export namespace Price {
}
export namespace MinimumCompositePrice {
+ /**
+ * Configuration for minimum pricing
+ */
export interface MinimumConfig {
/**
* The minimum amount to apply
@@ -9505,10 +11987,9 @@ export namespace Price {
minimum_amount: string;
/**
- * By default, subtotals from minimum composite prices are prorated based on the
- * service period. Set to false to disable proration.
+ * If true, subtotals from this price are prorated based on the service period
*/
- prorated?: boolean | null;
+ prorated?: boolean;
}
}
}
@@ -9629,6 +12110,9 @@ export interface TaxAmount {
tax_rate_percentage: string | null;
}
+/**
+ * Configuration for a single tier
+ */
export interface Tier {
/**
* Exclusive tier starting value
@@ -9641,19 +12125,12 @@ export interface Tier {
unit_amount: string;
/**
- * Inclusive tier ending value. If null, this is treated as the last tier
+ * Inclusive tier ending value. This value is null if and only if this is the last
+ * tier.
*/
last_unit?: number | null;
}
-export interface TierConfig {
- first_unit: number;
-
- last_unit: number | null;
-
- unit_amount: string;
-}
-
export interface TierSubLineItem {
/**
* The total amount for this sub line item.
@@ -9666,11 +12143,24 @@ export interface TierSubLineItem {
quantity: number;
- tier_config: TierConfig;
+ tier_config: TierSubLineItem.TierConfig;
type: 'tier';
}
+export namespace TierSubLineItem {
+ export interface TierConfig {
+ first_unit: number;
+
+ last_unit: number | null;
+
+ unit_amount: string;
+ }
+}
+
+/**
+ * Configuration for tiered pricing
+ */
export interface TieredConfig {
/**
* Tiers for rating based on total usage quantities into the specified tier
@@ -9728,11 +12218,19 @@ export interface TrialDiscount {
trial_percentage_discount?: number | null;
}
+/**
+ * Configuration for unit pricing
+ */
export interface UnitConfig {
/**
* Rate per unit of usage
*/
unit_amount: string;
+
+ /**
+ * Multiplier to scale rated quantity by
+ */
+ scaling_factor?: number | null;
}
export interface UnitConversionRateConfig {
diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts
index 1ef0fa3e..269a540f 100644
--- a/src/resources/subscriptions.ts
+++ b/src/resources/subscriptions.ts
@@ -1093,6 +1093,9 @@ export interface DiscountOverride {
}
export interface NewSubscriptionBulkPrice {
+ /**
+ * Configuration for bulk pricing
+ */
bulk_config: Shared.BulkConfig;
/**
@@ -1105,6 +1108,9 @@ export interface NewSubscriptionBulkPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'bulk';
/**
@@ -1188,7 +1194,10 @@ export interface NewSubscriptionBulkPrice {
}
export interface NewSubscriptionBulkWithProrationPrice {
- bulk_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ bulk_with_proration_config: NewSubscriptionBulkWithProrationPrice.BulkWithProrationConfig;
/**
* The cadence to bill for this price on.
@@ -1200,6 +1209,9 @@ export interface NewSubscriptionBulkWithProrationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'bulk_with_proration';
/**
@@ -1282,19 +1294,54 @@ export interface NewSubscriptionBulkWithProrationPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionBulkWithProrationPrice {
+ /**
+ * Configuration for bulk_with_proration pricing
+ */
+ export interface BulkWithProrationConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkWithProrationConfig {
+ /**
+ * Configuration for a single bulk pricing tier with proration
+ */
+ export interface Tier {
+ /**
+ * Cost per unit
+ */
+ unit_amount: string;
+
+ /**
+ * The lower bound for this tier
+ */
+ tier_lower_bound?: string | null;
+ }
+ }
+}
+
export interface NewSubscriptionCumulativeGroupedBulkPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- cumulative_grouped_bulk_config: { [key: string]: unknown };
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ cumulative_grouped_bulk_config: NewSubscriptionCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'cumulative_grouped_bulk';
/**
@@ -1377,19 +1424,64 @@ export interface NewSubscriptionCumulativeGroupedBulkPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionCumulativeGroupedBulkPrice {
+ /**
+ * Configuration for cumulative_grouped_bulk pricing
+ */
+ export interface CumulativeGroupedBulkConfig {
+ /**
+ * Each tier lower bound must have the same group of values.
+ */
+ dimension_values: Array;
+
+ /**
+ * Grouping key name
+ */
+ group: string;
+ }
+
+ export namespace CumulativeGroupedBulkConfig {
+ /**
+ * Configuration for a dimension value entry
+ */
+ export interface DimensionValue {
+ /**
+ * Grouping key value
+ */
+ grouping_key: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Unit amount for this combination
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewSubscriptionGroupedAllocationPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ grouped_allocation_config: NewSubscriptionGroupedAllocationPrice.GroupedAllocationConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_allocation';
/**
@@ -1472,19 +1564,47 @@ export interface NewSubscriptionGroupedAllocationPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionGroupedAllocationPrice {
+ /**
+ * Configuration for grouped_allocation pricing
+ */
+ export interface GroupedAllocationConfig {
+ /**
+ * Usage allocation per group
+ */
+ allocation: string;
+
+ /**
+ * How to determine the groups that should each be allocated some quantity
+ */
+ grouping_key: string;
+
+ /**
+ * Unit rate for post-allocation
+ */
+ overage_unit_rate: string;
+ }
+}
+
export interface NewSubscriptionGroupedTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ grouped_tiered_package_config: NewSubscriptionGroupedTieredPackagePrice.GroupedTieredPackageConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered_package';
/**
@@ -1567,19 +1687,65 @@ export interface NewSubscriptionGroupedTieredPackagePrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionGroupedTieredPackagePrice {
+ /**
+ * Configuration for grouped_tiered_package pricing
+ */
+ export interface GroupedTieredPackageConfig {
+ /**
+ * The event property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
export interface NewSubscriptionGroupedTieredPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_tiered_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ grouped_tiered_config: NewSubscriptionGroupedTieredPrice.GroupedTieredConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_tiered';
/**
@@ -1662,19 +1828,60 @@ export interface NewSubscriptionGroupedTieredPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionGroupedTieredPrice {
+ /**
+ * Configuration for grouped_tiered pricing
+ */
+ export interface GroupedTieredConfig {
+ /**
+ * The billable metric property used to group before tiering
+ */
+ grouping_key: string;
+
+ /**
+ * Apply tiered pricing to each segment generated after grouping with the provided
+ * key
+ */
+ tiers: Array;
+ }
+
+ export namespace GroupedTieredConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_metered_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ grouped_with_metered_minimum_config: NewSubscriptionGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_metered_minimum';
/**
@@ -1757,19 +1964,96 @@ export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionGroupedWithMeteredMinimumPrice {
+ /**
+ * Configuration for grouped_with_metered_minimum pricing
+ */
+ export interface GroupedWithMeteredMinimumConfig {
+ /**
+ * Used to partition the usage into groups. The minimum amount is applied to each
+ * group.
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group per unit
+ */
+ minimum_unit_amount: string;
+
+ /**
+ * Used to determine the unit rate
+ */
+ pricing_key: string;
+
+ /**
+ * Scale the unit rates by the scaling factor.
+ */
+ scaling_factors: Array;
+
+ /**
+ * Used to determine the unit rate scaling factor
+ */
+ scaling_key: string;
+
+ /**
+ * Apply per unit pricing to each pricing value. The minimum amount is applied any
+ * unmatched usage.
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace GroupedWithMeteredMinimumConfig {
+ /**
+ * Configuration for a scaling factor
+ */
+ export interface ScalingFactor {
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Scaling value
+ */
+ scaling_value: string;
+ }
+
+ /**
+ * Configuration for a unit amount
+ */
+ export interface UnitAmount {
+ /**
+ * Pricing value
+ */
+ pricing_value: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewSubscriptionGroupedWithProratedMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_prorated_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ grouped_with_prorated_minimum_config: NewSubscriptionGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'grouped_with_prorated_minimum';
/**
@@ -1852,6 +2136,28 @@ export interface NewSubscriptionGroupedWithProratedMinimumPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionGroupedWithProratedMinimumPrice {
+ /**
+ * Configuration for grouped_with_prorated_minimum pricing
+ */
+ export interface GroupedWithProratedMinimumConfig {
+ /**
+ * How to determine the groups that should each have a minimum
+ */
+ grouping_key: string;
+
+ /**
+ * The minimum amount to charge per group
+ */
+ minimum: string;
+
+ /**
+ * The amount to charge per unit
+ */
+ unit_rate: string;
+ }
+}
+
export interface NewSubscriptionMatrixPrice {
/**
* The cadence to bill for this price on.
@@ -1863,8 +2169,14 @@ export interface NewSubscriptionMatrixPrice {
*/
item_id: string;
+ /**
+ * Configuration for matrix pricing
+ */
matrix_config: Shared.MatrixConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix';
/**
@@ -1958,8 +2270,14 @@ export interface NewSubscriptionMatrixWithAllocationPrice {
*/
item_id: string;
+ /**
+ * Configuration for matrix_with_allocation pricing
+ */
matrix_with_allocation_config: Shared.MatrixWithAllocationConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_allocation';
/**
@@ -2053,8 +2371,14 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice {
*/
item_id: string;
- matrix_with_display_name_config: { [key: string]: unknown };
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ matrix_with_display_name_config: NewSubscriptionMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'matrix_with_display_name';
/**
@@ -2137,6 +2461,45 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionMatrixWithDisplayNamePrice {
+ /**
+ * Configuration for matrix_with_display_name pricing
+ */
+ export interface MatrixWithDisplayNameConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ dimension: string;
+
+ /**
+ * Apply per unit pricing to each dimension value
+ */
+ unit_amounts: Array;
+ }
+
+ export namespace MatrixWithDisplayNameConfig {
+ /**
+ * Configuration for a unit amount item
+ */
+ export interface UnitAmount {
+ /**
+ * The dimension value
+ */
+ dimension_value: string;
+
+ /**
+ * Display name for this dimension value
+ */
+ display_name: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewSubscriptionMaxGroupTieredPackagePrice {
/**
* The cadence to bill for this price on.
@@ -2148,8 +2511,14 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice {
*/
item_id: string;
- max_group_tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ max_group_tiered_package_config: NewSubscriptionMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'max_group_tiered_package';
/**
@@ -2232,6 +2601,45 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionMaxGroupTieredPackagePrice {
+ /**
+ * Configuration for max_group_tiered_package pricing
+ */
+ export interface MaxGroupTieredPackageConfig {
+ /**
+ * The event property used to group before tiering the group with the highest value
+ */
+ grouping_key: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing to the largest group after grouping with the provided key.
+ */
+ tiers: Array;
+ }
+
+ export namespace MaxGroupTieredPackageConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewSubscriptionMinimumCompositePrice {
/**
* The cadence to bill for this price on.
@@ -2243,8 +2651,14 @@ export interface NewSubscriptionMinimumCompositePrice {
*/
item_id: string;
+ /**
+ * Configuration for minimum pricing
+ */
minimum_config: NewSubscriptionMinimumCompositePrice.MinimumConfig;
+ /**
+ * The pricing model type
+ */
model_type: 'minimum';
/**
@@ -2328,6 +2742,9 @@ export interface NewSubscriptionMinimumCompositePrice {
}
export namespace NewSubscriptionMinimumCompositePrice {
+ /**
+ * Configuration for minimum pricing
+ */
export interface MinimumConfig {
/**
* The minimum amount to apply
@@ -2335,10 +2752,9 @@ export namespace NewSubscriptionMinimumCompositePrice {
minimum_amount: string;
/**
- * By default, subtotals from minimum composite prices are prorated based on the
- * service period. Set to false to disable proration.
+ * If true, subtotals from this price are prorated based on the service period
*/
- prorated?: boolean | null;
+ prorated?: boolean;
}
}
@@ -2353,6 +2769,9 @@ export interface NewSubscriptionPackagePrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'package';
/**
@@ -2360,6 +2779,9 @@ export interface NewSubscriptionPackagePrice {
*/
name: string;
+ /**
+ * Configuration for package pricing
+ */
package_config: Shared.PackageConfig;
/**
@@ -2448,6 +2870,9 @@ export interface NewSubscriptionPackageWithAllocationPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'package_with_allocation';
/**
@@ -2455,7 +2880,10 @@ export interface NewSubscriptionPackageWithAllocationPrice {
*/
name: string;
- package_with_allocation_config: { [key: string]: unknown };
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ package_with_allocation_config: NewSubscriptionPackageWithAllocationPrice.PackageWithAllocationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -2532,6 +2960,28 @@ export interface NewSubscriptionPackageWithAllocationPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionPackageWithAllocationPrice {
+ /**
+ * Configuration for package_with_allocation pricing
+ */
+ export interface PackageWithAllocationConfig {
+ /**
+ * Usage allocation
+ */
+ allocation: string;
+
+ /**
+ * Price per package
+ */
+ package_amount: string;
+
+ /**
+ * Package size
+ */
+ package_size: string;
+ }
+}
+
export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
/**
* The cadence to bill for this price on.
@@ -2543,6 +2993,9 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'scalable_matrix_with_tiered_pricing';
/**
@@ -2550,7 +3003,10 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
*/
name: string;
- scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ scalable_matrix_with_tiered_pricing_config: NewSubscriptionScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -2627,6 +3083,70 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_tiered_pricing pricing
+ */
+ export interface ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Used for the scalable matrix first dimension
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * Tier pricing structure
+ */
+ tiers: Array;
+
+ /**
+ * Used for the scalable matrix second dimension (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithTieredPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+
+ /**
+ * Configuration for a single tier entry with business logic
+ */
+ export interface Tier {
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
/**
* The cadence to bill for this price on.
@@ -2638,6 +3158,9 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'scalable_matrix_with_unit_pricing';
/**
@@ -2645,7 +3168,10 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
*/
name: string;
- scalable_matrix_with_unit_pricing_config: { [key: string]: unknown };
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ scalable_matrix_with_unit_pricing_config: NewSubscriptionScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -2722,6 +3248,60 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
reference_id?: string | null;
}
+export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice {
+ /**
+ * Configuration for scalable_matrix_with_unit_pricing pricing
+ */
+ export interface ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Used to determine the unit rate
+ */
+ first_dimension: string;
+
+ /**
+ * Apply a scaling factor to each dimension
+ */
+ matrix_scaling_factors: Array;
+
+ /**
+ * The final unit price to rate against the output of the matrix
+ */
+ unit_price: string;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+
+ /**
+ * Used to determine the unit rate (optional)
+ */
+ second_dimension?: string | null;
+ }
+
+ export namespace ScalableMatrixWithUnitPricingConfig {
+ /**
+ * Configuration for a single matrix scaling factor
+ */
+ export interface MatrixScalingFactor {
+ /**
+ * First dimension value
+ */
+ first_dimension_value: string;
+
+ /**
+ * Scaling factor
+ */
+ scaling_factor: string;
+
+ /**
+ * Second dimension value (optional)
+ */
+ second_dimension_value?: string | null;
+ }
+ }
+}
+
export interface NewSubscriptionThresholdTotalAmountPrice {
/**
* The cadence to bill for this price on.
@@ -2733,6 +3313,9 @@ export interface NewSubscriptionThresholdTotalAmountPrice {
*/
item_id: string;
+ /**
+ * The pricing model type
+ */
model_type: 'threshold_total_amount';
/**
@@ -2740,7 +3323,10 @@ export interface NewSubscriptionThresholdTotalAmountPrice {
*/
name: string;
- threshold_total_amount_config: { [key: string]: unknown };
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ threshold_total_amount_config: NewSubscriptionThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -2817,7 +3403,42 @@ export interface NewSubscriptionThresholdTotalAmountPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionTierWithProrationPrice {
+export namespace NewSubscriptionThresholdTotalAmountPrice {
+ /**
+ * Configuration for threshold_total_amount pricing
+ */
+ export interface ThresholdTotalAmountConfig {
+ /**
+ * When the quantity consumed passes a provided threshold, the configured total
+ * will be charged
+ */
+ consumption_table: Array;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean | null;
+ }
+
+ export namespace ThresholdTotalAmountConfig {
+ /**
+ * Configuration for a single threshold
+ */
+ export interface ConsumptionTable {
+ /**
+ * Quantity threshold
+ */
+ threshold: string;
+
+ /**
+ * Total amount for this threshold
+ */
+ total_amount: string;
+ }
+ }
+}
+
+export interface NewSubscriptionTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -2828,14 +3449,20 @@ export interface NewSubscriptionTierWithProrationPrice {
*/
item_id: string;
- model_type: 'tiered_with_proration';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_package';
/**
* The name of the price.
*/
name: string;
- tiered_with_proration_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package pricing
+ */
+ tiered_package_config: NewSubscriptionTieredPackagePrice.TieredPackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -2912,7 +3539,42 @@ export interface NewSubscriptionTierWithProrationPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionTieredPackagePrice {
+export namespace NewSubscriptionTieredPackagePrice {
+ /**
+ * Configuration for tiered_package pricing
+ */
+ export interface TieredPackageConfig {
+ /**
+ * Package size
+ */
+ package_size: string;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageConfig {
+ /**
+ * Configuration for a single tier with business logic
+ */
+ export interface Tier {
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
+export interface NewSubscriptionTieredPackageWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -2923,14 +3585,20 @@ export interface NewSubscriptionTieredPackagePrice {
*/
item_id: string;
- model_type: 'tiered_package';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_package_with_minimum';
/**
* The name of the price.
*/
name: string;
- tiered_package_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ tiered_package_with_minimum_config: NewSubscriptionTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3007,7 +3675,47 @@ export interface NewSubscriptionTieredPackagePrice {
reference_id?: string | null;
}
-export interface NewSubscriptionTieredPackageWithMinimumPrice {
+export namespace NewSubscriptionTieredPackageWithMinimumPrice {
+ /**
+ * Configuration for tiered_package_with_minimum pricing
+ */
+ export interface TieredPackageWithMinimumConfig {
+ /**
+ * Package size
+ */
+ package_size: number;
+
+ /**
+ * Apply tiered pricing after rounding up the quantity to the package size. Tiers
+ * are defined using exclusive lower bounds.
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredPackageWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Price per package
+ */
+ per_unit: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+ }
+ }
+}
+
+export interface NewSubscriptionTieredPrice {
/**
* The cadence to bill for this price on.
*/
@@ -3018,14 +3726,20 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice {
*/
item_id: string;
- model_type: 'tiered_package_with_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered';
/**
* The name of the price.
*/
name: string;
- tiered_package_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for tiered pricing
+ */
+ tiered_config: Shared.TieredConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3102,7 +3816,7 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionTieredPrice {
+export interface NewSubscriptionTieredWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -3113,14 +3827,20 @@ export interface NewSubscriptionTieredPrice {
*/
item_id: string;
- model_type: 'tiered';
+ /**
+ * The pricing model type
+ */
+ model_type: 'tiered_with_minimum';
/**
* The name of the price.
*/
name: string;
- tiered_config: Shared.TieredConfig;
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ tiered_with_minimum_config: NewSubscriptionTieredWithMinimumPrice.TieredWithMinimumConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3197,7 +3917,52 @@ export interface NewSubscriptionTieredPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionTieredWithMinimumPrice {
+export namespace NewSubscriptionTieredWithMinimumPrice {
+ /**
+ * Configuration for tiered_with_minimum pricing
+ */
+ export interface TieredWithMinimumConfig {
+ /**
+ * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are
+ * defined using exclusive lower bounds.
+ */
+ tiers: Array;
+
+ /**
+ * If true, tiers with an accrued amount of 0 will not be included in the rating.
+ */
+ hide_zero_amount_tiers?: boolean;
+
+ /**
+ * If true, the unit price will be prorated to the billing period
+ */
+ prorate?: boolean;
+ }
+
+ export namespace TieredWithMinimumConfig {
+ /**
+ * Configuration for a single tier
+ */
+ export interface Tier {
+ /**
+ * Minimum amount
+ */
+ minimum_amount: string;
+
+ /**
+ * Tier lower bound
+ */
+ tier_lower_bound: string;
+
+ /**
+ * Per unit amount
+ */
+ unit_amount: string;
+ }
+ }
+}
+
+export interface NewSubscriptionUnitPrice {
/**
* The cadence to bill for this price on.
*/
@@ -3208,14 +3973,20 @@ export interface NewSubscriptionTieredWithMinimumPrice {
*/
item_id: string;
- model_type: 'tiered_with_minimum';
+ /**
+ * The pricing model type
+ */
+ model_type: 'unit';
/**
* The name of the price.
*/
name: string;
- tiered_with_minimum_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit pricing
+ */
+ unit_config: Shared.UnitConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3292,7 +4063,7 @@ export interface NewSubscriptionTieredWithMinimumPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionUnitPrice {
+export interface NewSubscriptionUnitWithPercentPrice {
/**
* The cadence to bill for this price on.
*/
@@ -3303,14 +4074,20 @@ export interface NewSubscriptionUnitPrice {
*/
item_id: string;
- model_type: 'unit';
+ /**
+ * The pricing model type
+ */
+ model_type: 'unit_with_percent';
/**
* The name of the price.
*/
name: string;
- unit_config: Shared.UnitConfig;
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ unit_with_percent_config: NewSubscriptionUnitWithPercentPrice.UnitWithPercentConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3387,7 +4164,24 @@ export interface NewSubscriptionUnitPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionUnitWithPercentPrice {
+export namespace NewSubscriptionUnitWithPercentPrice {
+ /**
+ * Configuration for unit_with_percent pricing
+ */
+ export interface UnitWithPercentConfig {
+ /**
+ * What percent, out of 100, of the calculated total to charge
+ */
+ percent: string;
+
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+}
+
+export interface NewSubscriptionUnitWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -3398,14 +4192,20 @@ export interface NewSubscriptionUnitWithPercentPrice {
*/
item_id: string;
- model_type: 'unit_with_percent';
+ /**
+ * The pricing model type
+ */
+ model_type: 'unit_with_proration';
/**
* The name of the price.
*/
name: string;
- unit_with_percent_config: { [key: string]: unknown };
+ /**
+ * Configuration for unit_with_proration pricing
+ */
+ unit_with_proration_config: NewSubscriptionUnitWithProrationPrice.UnitWithProrationConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -3482,99 +4282,16 @@ export interface NewSubscriptionUnitWithPercentPrice {
reference_id?: string | null;
}
-export interface NewSubscriptionUnitWithProrationPrice {
+export namespace NewSubscriptionUnitWithProrationPrice {
/**
- * The cadence to bill for this price on.
+ * Configuration for unit_with_proration pricing
*/
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
-
- /**
- * The id of the item the price will be associated with.
- */
- item_id: string;
-
- model_type: 'unit_with_proration';
-
- /**
- * The name of the price.
- */
- name: string;
-
- unit_with_proration_config: { [key: string]: unknown };
-
- /**
- * 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 interface UnitWithProrationConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
}
/**
@@ -4120,35 +4837,35 @@ export namespace SubscriptionCreateParams {
plan_phase_order?: number | null;
/**
- * The definition of a new price to create and add to the subscription.
+ * New subscription price request body params.
*/
price?:
| SubscriptionsAPI.NewSubscriptionUnitPrice
- | SubscriptionsAPI.NewSubscriptionPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionTieredPrice
| SubscriptionsAPI.NewSubscriptionBulkPrice
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
| SubscriptionsAPI.NewSubscriptionTieredPackagePrice
| SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
| SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
+ | AddPrice.NewSubscriptionTieredWithProrationPrice
| SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
| SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
| SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
| SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
- | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
| SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
| null;
@@ -4166,19 +4883,156 @@ export namespace SubscriptionCreateParams {
}
export namespace AddPrice {
+ 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';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * 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';
/**
@@ -4260,6 +5114,33 @@ export namespace SubscriptionCreateParams {
*/
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 RemoveAdjustment {
@@ -4338,35 +5219,35 @@ export namespace SubscriptionCreateParams {
minimum_amount?: string | null;
/**
- * The definition of a new price to create and add to the subscription.
+ * New subscription price request body params.
*/
price?:
| SubscriptionsAPI.NewSubscriptionUnitPrice
- | SubscriptionsAPI.NewSubscriptionPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionTieredPrice
| SubscriptionsAPI.NewSubscriptionBulkPrice
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
| SubscriptionsAPI.NewSubscriptionTieredPackagePrice
| SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
| SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
+ | ReplacePrice.NewSubscriptionTieredWithProrationPrice
| SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
| SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
| SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
| SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
- | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
| SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
| null;
@@ -4377,26 +5258,32 @@ export namespace SubscriptionCreateParams {
}
export namespace ReplacePrice {
- export interface NewSubscriptionGroupedWithMinMaxThresholdsPrice {
+ export interface NewSubscriptionTieredWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_with_min_max_thresholds';
+ /**
+ * 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.
@@ -4471,6 +5358,164 @@ export namespace SubscriptionCreateParams {
*/
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;
+ }
+ }
}
}
@@ -4715,35 +5760,35 @@ export namespace SubscriptionPriceIntervalsParams {
minimum_amount?: number | null;
/**
- * The definition of a new price to create and add to the subscription.
+ * New floating price request body params.
*/
price?:
| Shared.NewFloatingUnitPrice
- | Shared.NewFloatingPackagePrice
- | Shared.NewFloatingMatrixPrice
- | Shared.NewFloatingMatrixWithAllocationPrice
| Shared.NewFloatingTieredPrice
| Shared.NewFloatingBulkPrice
+ | Shared.NewFloatingPackagePrice
+ | Shared.NewFloatingMatrixPrice
| Shared.NewFloatingThresholdTotalAmountPrice
| Shared.NewFloatingTieredPackagePrice
- | Shared.NewFloatingGroupedTieredPrice
- | Shared.NewFloatingMaxGroupTieredPackagePrice
| Shared.NewFloatingTieredWithMinimumPrice
- | Shared.NewFloatingPackageWithAllocationPrice
+ | Shared.NewFloatingGroupedTieredPrice
| Shared.NewFloatingTieredPackageWithMinimumPrice
+ | Shared.NewFloatingPackageWithAllocationPrice
| Shared.NewFloatingUnitWithPercentPrice
+ | Shared.NewFloatingMatrixWithAllocationPrice
| Shared.NewFloatingTieredWithProrationPrice
| Shared.NewFloatingUnitWithProrationPrice
| Shared.NewFloatingGroupedAllocationPrice
+ | Shared.NewFloatingBulkWithProrationPrice
| Shared.NewFloatingGroupedWithProratedMinimumPrice
| Shared.NewFloatingGroupedWithMeteredMinimumPrice
+ | Add.NewFloatingGroupedWithMinMaxThresholdsPrice
| Shared.NewFloatingMatrixWithDisplayNamePrice
- | Shared.NewFloatingBulkWithProrationPrice
| Shared.NewFloatingGroupedTieredPackagePrice
+ | Shared.NewFloatingMaxGroupTieredPackagePrice
| Shared.NewFloatingScalableMatrixWithUnitPricingPrice
| Shared.NewFloatingScalableMatrixWithTieredPricingPrice
| Shared.NewFloatingCumulativeGroupedBulkPrice
- | Add.NewFloatingGroupedWithMinMaxThresholdsPrice
| Shared.NewFloatingMinimumCompositePrice
| null;
@@ -4816,13 +5861,19 @@ export namespace SubscriptionPriceIntervalsParams {
*/
currency: string;
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * 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';
/**
@@ -4892,6 +5943,33 @@ export namespace SubscriptionPriceIntervalsParams {
*/
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 AddAdjustment {
@@ -5275,35 +6353,35 @@ export namespace SubscriptionSchedulePlanChangeParams {
plan_phase_order?: number | null;
/**
- * The definition of a new price to create and add to the subscription.
+ * New subscription price request body params.
*/
price?:
| SubscriptionsAPI.NewSubscriptionUnitPrice
- | SubscriptionsAPI.NewSubscriptionPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionTieredPrice
| SubscriptionsAPI.NewSubscriptionBulkPrice
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
| SubscriptionsAPI.NewSubscriptionTieredPackagePrice
| SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
| SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
+ | AddPrice.NewSubscriptionTieredWithProrationPrice
| SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
| SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
| SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
| SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
- | AddPrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
| SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
| null;
@@ -5321,19 +6399,156 @@ export namespace SubscriptionSchedulePlanChangeParams {
}
export namespace AddPrice {
+ 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';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * 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';
/**
@@ -5415,6 +6630,33 @@ export namespace SubscriptionSchedulePlanChangeParams {
*/
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 RemoveAdjustment {
@@ -5493,35 +6735,35 @@ export namespace SubscriptionSchedulePlanChangeParams {
minimum_amount?: string | null;
/**
- * The definition of a new price to create and add to the subscription.
+ * New subscription price request body params.
*/
price?:
| SubscriptionsAPI.NewSubscriptionUnitPrice
- | SubscriptionsAPI.NewSubscriptionPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionTieredPrice
| SubscriptionsAPI.NewSubscriptionBulkPrice
+ | SubscriptionsAPI.NewSubscriptionPackagePrice
+ | SubscriptionsAPI.NewSubscriptionMatrixPrice
| SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice
| SubscriptionsAPI.NewSubscriptionTieredPackagePrice
| SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
+ | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
| SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice
+ | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice
+ | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
+ | ReplacePrice.NewSubscriptionTieredWithProrationPrice
| SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice
| SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice
- | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
- | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
- | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
- | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice
| SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
| SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice
| SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice
- | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice
- | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice
- | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice
- | ReplacePrice.NewSubscriptionGroupedWithMinMaxThresholdsPrice
+ | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice
| SubscriptionsAPI.NewSubscriptionMinimumCompositePrice
| null;
@@ -5532,19 +6774,156 @@ export namespace SubscriptionSchedulePlanChangeParams {
}
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';
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
+ /**
+ * 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';
/**
@@ -5626,6 +7005,33 @@ export namespace SubscriptionSchedulePlanChangeParams {
*/
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;
+ }
+ }
}
}
@@ -5719,7 +7125,6 @@ export declare namespace Subscriptions {
type NewSubscriptionScalableMatrixWithTieredPricingPrice as NewSubscriptionScalableMatrixWithTieredPricingPrice,
type NewSubscriptionScalableMatrixWithUnitPricingPrice as NewSubscriptionScalableMatrixWithUnitPricingPrice,
type NewSubscriptionThresholdTotalAmountPrice as NewSubscriptionThresholdTotalAmountPrice,
- type NewSubscriptionTierWithProrationPrice as NewSubscriptionTierWithProrationPrice,
type NewSubscriptionTieredPackagePrice as NewSubscriptionTieredPackagePrice,
type NewSubscriptionTieredPackageWithMinimumPrice as NewSubscriptionTieredPackageWithMinimumPrice,
type NewSubscriptionTieredPrice as NewSubscriptionTieredPrice,
diff --git a/src/version.ts b/src/version.ts
index a0cba220..3d370464 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '5.6.0'; // x-release-please-version
+export const VERSION = '5.7.0'; // x-release-please-version
diff --git a/tests/api-resources/beta/beta.test.ts b/tests/api-resources/beta/beta.test.ts
index d4a8c772..ab38fcac 100644
--- a/tests/api-resources/beta/beta.test.ts
+++ b/tests/api-resources/beta/beta.test.ts
@@ -54,7 +54,7 @@ describe('resource beta', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -113,7 +113,7 @@ describe('resource beta', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
diff --git a/tests/api-resources/beta/external-plan-id.test.ts b/tests/api-resources/beta/external-plan-id.test.ts
index a24646de..dc013b92 100644
--- a/tests/api-resources/beta/external-plan-id.test.ts
+++ b/tests/api-resources/beta/external-plan-id.test.ts
@@ -54,7 +54,7 @@ describe('resource externalPlanId', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -113,7 +113,7 @@ describe('resource externalPlanId', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
diff --git a/tests/api-resources/invoices.test.ts b/tests/api-resources/invoices.test.ts
index f6e88c6c..93fbb847 100644
--- a/tests/api-resources/invoices.test.ts
+++ b/tests/api-resources/invoices.test.ts
@@ -46,7 +46,7 @@ describe('resource invoices', () => {
name: 'Line Item Name',
quantity: 1,
start_date: '2023-09-22',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
},
],
customer_id: '4khy3nwzktxv7',
diff --git a/tests/api-resources/plans/plans.test.ts b/tests/api-resources/plans/plans.test.ts
index 8e0a1d9e..03514146 100644
--- a/tests/api-resources/plans/plans.test.ts
+++ b/tests/api-resources/plans/plans.test.ts
@@ -39,7 +39,7 @@ describe('resource plans', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
diff --git a/tests/api-resources/prices/prices.test.ts b/tests/api-resources/prices/prices.test.ts
index 1b457bc9..69b4472b 100644
--- a/tests/api-resources/prices/prices.test.ts
+++ b/tests/api-resources/prices/prices.test.ts
@@ -34,7 +34,7 @@ describe('resource prices', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -143,7 +143,7 @@ describe('resource prices', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -209,7 +209,7 @@ describe('resource prices', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts
index b4556008..9b66d74a 100644
--- a/tests/api-resources/subscriptions.test.ts
+++ b/tests/api-resources/subscriptions.test.ts
@@ -317,7 +317,7 @@ describe('resource subscriptions', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -405,7 +405,7 @@ describe('resource subscriptions', () => {
item_id: 'item_id',
model_type: 'unit',
name: 'Annual fee',
- unit_config: { unit_amount: 'unit_amount' },
+ unit_config: { unit_amount: 'unit_amount', scaling_factor: 0 },
billable_metric_id: 'billable_metric_id',
billed_in_advance: true,
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },