diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 27e41843..98144b04 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.64.0" + ".": "4.65.0" } diff --git a/.stats.yml b/.stats.yml index 5776427f..715ea230 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c8fc7d0bf70bf7ed91a141f346a02929e4d25a6fac7b59f58b68136ed6ff024f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-48084a007f009b4358484f09a3a7b74a990c402669f9d15adfbb60e4f835f951.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f727531..62c1b83a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 4.65.0 (2025-03-05) + +Full Changelog: [v4.64.0...v4.65.0](https://github.com/orbcorp/orb-node/compare/v4.64.0...v4.65.0) + +### Features + +* **api:** api update ([#535](https://github.com/orbcorp/orb-node/issues/535)) ([42e41ce](https://github.com/orbcorp/orb-node/commit/42e41cebe5784cbc254d503ae49111b682d066c9)) +* **api:** manual updates ([#538](https://github.com/orbcorp/orb-node/issues/538)) ([5f99471](https://github.com/orbcorp/orb-node/commit/5f994713a02b7ca7def32339dc7cb530bf964cec)) +* **api:** manual updates ([#540](https://github.com/orbcorp/orb-node/issues/540)) ([e144b49](https://github.com/orbcorp/orb-node/commit/e144b49763b1d755088ecb2f478943107387d6d4)) +* **api:** manual updates ([#542](https://github.com/orbcorp/orb-node/issues/542)) ([970f1b8](https://github.com/orbcorp/orb-node/commit/970f1b873462bc1d5609b694d43fca2c1749c4f1)) + ## 4.64.0 (2025-03-01) Full Changelog: [v4.63.0...v4.64.0](https://github.com/orbcorp/orb-node/compare/v4.63.0...v4.64.0) diff --git a/api.md b/api.md index 12415ef6..c9764db2 100644 --- a/api.md +++ b/api.md @@ -11,6 +11,7 @@ Types: - TrialDiscount - UsageDiscount + # TopLevel Types: diff --git a/package.json b/package.json index 0d3332cc..192a6208 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "4.64.0", + "version": "4.65.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/resources/shared.ts b/src/resources/shared.ts index ab2dbcef..1c9387b6 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -21,24 +21,6 @@ export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term'; export type Discount = PercentageDiscount | TrialDiscount | UsageDiscount | AmountDiscount; -export interface UsageDiscount { - /** - * List of price_ids that this discount applies to. For plan/plan phase discounts, - * this can be a subset of prices. - */ - applies_to_price_ids: Array; - - discount_type: 'usage'; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - - reason?: string | null; -} - export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount; export interface PaginationMetadata { @@ -86,3 +68,21 @@ export interface TrialDiscount { */ trial_percentage_discount?: number | null; } + +export interface UsageDiscount { + /** + * List of price_ids that this discount applies to. For plan/plan phase discounts, + * this can be a subset of prices. + */ + applies_to_price_ids: Array; + + discount_type: 'usage'; + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for + */ + usage_discount: number; + + reason?: string | null; +} diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index ea5cfe0e..292186d9 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -8346,6 +8346,13 @@ export namespace SubscriptionCreateParams { | AddPrice.NewSubscriptionGroupedAllocationPrice | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice | AddPrice.NewSubscriptionBulkWithProrationPrice + | AddPrice.NewSubscriptionScalableMatrixWithUnitPricingPrice + | AddPrice.NewSubscriptionScalableMatrixWithTieredPricingPrice + | AddPrice.NewSubscriptionCumulativeGroupedBulkPrice + | AddPrice.NewSubscriptionMaxGroupTieredPackagePrice + | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice + | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice + | AddPrice.NewSubscriptionGroupedTieredPackagePrice | null; /** @@ -10722,297 +10729,265 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } } - } - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } + model_type: 'scalable_matrix_with_unit_pricing'; - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove on the subscription. - */ - adjustment_id: string; - } + /** + * The name of the price. + */ + name: string; - export interface RemovePrice { - /** - * The external price id of the price to remove on the subscription. - */ - external_price_id?: string | null; + scalable_matrix_with_unit_pricing_config: Record; - /** - * The id of the price to remove on the subscription. - */ - price_id?: string | null; - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | ReplaceAdjustment.NewPercentageDiscount - | ReplaceAdjustment.NewUsageDiscount - | ReplaceAdjustment.NewAmountDiscount - | ReplaceAdjustment.NewMinimum - | ReplaceAdjustment.NewMaximum; + /** + * 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; - /** - * The id of the adjustment on the plan to replace in the subscription. - */ - replaces_adjustment_id: string; - } + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; /** - * The set of price IDs to which this adjustment applies. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - applies_to_price_ids: Array; + currency?: string | null; - percentage_discount: number; + /** + * An alias for the price. + */ + external_price_id?: string | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - is_invoice_level?: boolean; - } + fixed_price_quantity?: number | null; - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; /** - * The set of price IDs to which this adjustment applies. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - applies_to_price_ids: Array; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - usage_discount: number; + /** + * 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?: Record | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - is_invoice_level?: boolean; + reference_id?: string | null; } - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - + export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { /** - * The set of price IDs to which this adjustment applies. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - applies_to_price_ids: Array; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - is_invoice_level?: boolean; - } + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - export interface NewMinimum { - adjustment_type: 'minimum'; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** - * The set of price IDs to which this adjustment applies. + * The cadence to bill for this price on. */ - applies_to_price_ids: Array; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * The item ID that revenue from this minimum will be attributed to. + * The id of the item the price will be associated with. */ item_id: string; - minimum_amount: string; + model_type: 'scalable_matrix_with_tiered_pricing'; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * The name of the price. */ - is_invoice_level?: boolean; - } + name: string; - export interface NewMaximum { - adjustment_type: 'maximum'; + scalable_matrix_with_tiered_pricing_config: Record; /** - * The set of price IDs to which this adjustment applies. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - applies_to_price_ids: Array; + billable_metric_id?: string | null; - maximum_amount: string; + /** + * 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; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - is_invoice_level?: boolean; - } - } + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the subscription. - */ - replaces_price_id: string; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: ReplacePrice.AllocationPrice | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for the replacement price. - */ - discounts?: Array | null; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * The external price id of the price to add to the subscription. - */ - 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 new quantity of the price, if the price is a fixed price. - */ - fixed_price_quantity?: number | null; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for the replacement price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for the replacement price. - */ - minimum_amount?: string | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | ReplacePrice.NewSubscriptionUnitPrice - | ReplacePrice.NewSubscriptionPackagePrice - | ReplacePrice.NewSubscriptionMatrixPrice - | ReplacePrice.NewSubscriptionTieredPrice - | ReplacePrice.NewSubscriptionTieredBpsPrice - | ReplacePrice.NewSubscriptionBpsPrice - | ReplacePrice.NewSubscriptionBulkBpsPrice - | ReplacePrice.NewSubscriptionBulkPrice - | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice - | ReplacePrice.NewSubscriptionTieredPackagePrice - | ReplacePrice.NewSubscriptionTieredWithMinimumPrice - | ReplacePrice.NewSubscriptionUnitWithPercentPrice - | ReplacePrice.NewSubscriptionPackageWithAllocationPrice - | ReplacePrice.NewSubscriptionTierWithProrationPrice - | ReplacePrice.NewSubscriptionUnitWithProrationPrice - | ReplacePrice.NewSubscriptionGroupedAllocationPrice - | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice - | ReplacePrice.NewSubscriptionBulkWithProrationPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - } - - export namespace ReplacePrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + /** + * 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?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. + * 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`. */ - currency: string; + metadata?: Record | null; /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - expires_at_end_of_cadence: boolean; + reference_id?: string | null; } - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; - + export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { /** - * Only available if discount_type is `amount`. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - amount_discount?: string | null; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount?: number | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - usage_discount?: number | null; + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewSubscriptionUnitPrice { + export interface NewSubscriptionCumulativeGroupedBulkPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + cumulative_grouped_bulk_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'unit'; + model_type: 'cumulative_grouped_bulk'; /** * The name of the price. */ name: string; - unit_config: NewSubscriptionUnitPrice.UnitConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -11029,7 +11004,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11062,7 +11037,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -11078,14 +11053,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - + export namespace NewSubscriptionCumulativeGroupedBulkPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -11119,7 +11087,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionPackagePrice { + export interface NewSubscriptionMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -11130,15 +11098,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'package'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * The name of the price. */ name: string; - package_config: NewSubscriptionPackagePrice.PackageConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -11155,7 +11123,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11188,7 +11156,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -11204,20 +11172,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - + export namespace NewSubscriptionMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -11251,20 +11206,20 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionMatrixPrice { + 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: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; + model_type: 'grouped_with_metered_minimum'; /** * The name of the price. @@ -11287,7 +11242,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11320,7 +11275,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -11336,40 +11291,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - 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 namespace NewSubscriptionGroupedWithMeteredMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -11403,7 +11325,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredPrice { + export interface NewSubscriptionMatrixWithDisplayNamePrice { /** * The cadence to bill for this price on. */ @@ -11414,15 +11336,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered'; + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; /** * The name of the price. */ name: string; - tiered_config: NewSubscriptionTieredPrice.TieredConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -11439,7 +11361,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11472,7 +11394,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -11488,33 +11410,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Inclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Exclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - + export namespace NewSubscriptionMatrixWithDisplayNamePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -11548,26 +11444,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredBpsPrice { + export interface NewSubscriptionGroupedTieredPackagePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + grouped_tiered_package_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'tiered_bps'; + model_type: 'grouped_tiered_package'; /** * The name of the price. */ name: string; - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -11584,7 +11480,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11617,7 +11513,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -11633,54 +11529,22 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { + export namespace NewSubscriptionGroupedTieredPackagePrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers + * The duration of the billing period. */ - tiers: Array; - } + duration: number; - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Inclusive tier starting value - */ - minimum_amount: string; - - /** - * Exclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -11698,287 +11562,285 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } } + } - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; + export interface BillingCycleAnchorConfiguration { + /** + * The day of the month on which the billing cycle is anchored. If the maximum + * number of days in a month is greater than this value, the last day of the month + * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + * period begins on the 30th. + */ + day: number; - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + /** + * The month on which the billing cycle is anchored (e.g. a quarterly price + * anchored in February would have cycles starting February, May, August, and + * November). + */ + month?: number | null; - /** - * The id of the item the price will be associated with. - */ - item_id: string; + /** + * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + */ + year?: number | null; + } - model_type: 'bps'; + export interface RemoveAdjustment { + /** + * The id of the adjustment to remove on the subscription. + */ + adjustment_id: string; + } - /** - * The name of the price. - */ - name: string; + export interface RemovePrice { + /** + * The external price id of the price to remove on the subscription. + */ + external_price_id?: string | null; - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; + /** + * The id of the price to remove on the subscription. + */ + price_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; + export interface ReplaceAdjustment { + /** + * The definition of a new adjustment to create and add to the subscription. + */ + adjustment: + | ReplaceAdjustment.NewPercentageDiscount + | ReplaceAdjustment.NewUsageDiscount + | ReplaceAdjustment.NewAmountDiscount + | ReplaceAdjustment.NewMinimum + | ReplaceAdjustment.NewMaximum; - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; + /** + * The id of the adjustment on the plan to replace in the subscription. + */ + replaces_adjustment_id: string; + } - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; + export namespace ReplaceAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. + * The set of price IDs to which this adjustment applies. */ - currency?: string | null; + applies_to_price_ids: Array; - /** - * An alias for the price. - */ - external_price_id?: string | null; + percentage_discount: number; /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - fixed_price_quantity?: number | null; + is_invoice_level?: boolean; + } - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * The set of price IDs to which this adjustment applies. */ - invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; + applies_to_price_ids: Array; - /** - * 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?: Record | null; + usage_discount: number; /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - reference_id?: string | null; + is_invoice_level?: boolean; } - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; + export interface NewAmountDiscount { + adjustment_type: 'amount_discount'; - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } + amount_discount: string; /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * The set of price IDs to which this adjustment applies. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + applies_to_price_ids: Array; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + is_invoice_level?: boolean; } - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; + export interface NewMinimum { + adjustment_type: 'minimum'; /** - * The cadence to bill for this price on. + * The set of price IDs to which this adjustment applies. */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + applies_to_price_ids: Array; /** - * The id of the item the price will be associated with. + * The item ID that revenue from this minimum will be attributed to. */ item_id: string; - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; + minimum_amount: string; /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - billable_metric_id?: string | null; + is_invoice_level?: boolean; + } - /** - * 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; + export interface NewMaximum { + adjustment_type: 'maximum'; /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * The set of price IDs to which this adjustment applies. */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; + applies_to_price_ids: Array; - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; + maximum_amount: string; /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - currency?: string | null; + is_invoice_level?: boolean; + } + } - /** - * An alias for the price. - */ - external_price_id?: string | null; + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the subscription. + */ + replaces_price_id: string; - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: ReplacePrice.AllocationPrice | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for the replacement price. + */ + discounts?: Array | null; + + /** + * The external price id of the price to add to the subscription. + */ + external_price_id?: string | null; + + /** + * The new quantity of the price, if the price is a fixed price. + */ + fixed_price_quantity?: number | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for the replacement price. + */ + maximum_amount?: string | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for the replacement price. + */ + minimum_amount?: string | null; + + /** + * The definition of a new price to create and add to the subscription. + */ + price?: + | ReplacePrice.NewSubscriptionUnitPrice + | ReplacePrice.NewSubscriptionPackagePrice + | ReplacePrice.NewSubscriptionMatrixPrice + | ReplacePrice.NewSubscriptionTieredPrice + | ReplacePrice.NewSubscriptionTieredBpsPrice + | ReplacePrice.NewSubscriptionBpsPrice + | ReplacePrice.NewSubscriptionBulkBpsPrice + | ReplacePrice.NewSubscriptionBulkPrice + | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice + | ReplacePrice.NewSubscriptionTieredPackagePrice + | ReplacePrice.NewSubscriptionTieredWithMinimumPrice + | ReplacePrice.NewSubscriptionUnitWithPercentPrice + | ReplacePrice.NewSubscriptionPackageWithAllocationPrice + | ReplacePrice.NewSubscriptionTierWithProrationPrice + | ReplacePrice.NewSubscriptionUnitWithProrationPrice + | ReplacePrice.NewSubscriptionGroupedAllocationPrice + | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice + | ReplacePrice.NewSubscriptionBulkWithProrationPrice + | ReplacePrice.NewSubscriptionScalableMatrixWithUnitPricingPrice + | ReplacePrice.NewSubscriptionScalableMatrixWithTieredPricingPrice + | ReplacePrice.NewSubscriptionCumulativeGroupedBulkPrice + | ReplacePrice.NewSubscriptionMaxGroupTieredPackagePrice + | ReplacePrice.NewSubscriptionGroupedWithMeteredMinimumPrice + | ReplacePrice.NewSubscriptionMatrixWithDisplayNamePrice + | ReplacePrice.NewSubscriptionGroupedTieredPackagePrice + | null; + + /** + * The id of the price to add to the subscription. + */ + price_id?: string | null; + } + export namespace ReplacePrice { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + export interface AllocationPrice { /** - * The property used to group this price on an invoice + * An amount of the currency to allocate to the customer at the specified cadence. */ - invoice_grouping_key?: string | null; + amount: string; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * The cadence at which to allocate the amount to the customer. */ - invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; /** - * 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`. + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. */ - metadata?: Record | null; + currency: string; /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. */ - reference_id?: string | null; + expires_at_end_of_cadence: boolean; } - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } + export interface Discount { + discount_type: 'percentage' | 'usage' | 'amount'; /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * Only available if discount_type is `amount`. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + amount_discount?: string | null; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + percentage_discount?: number | null; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for + */ + usage_discount?: number | null; } - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - + export interface NewSubscriptionUnitPrice { /** * The cadence to bill for this price on. */ @@ -11989,13 +11851,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'bulk'; + model_type: 'unit'; /** * The name of the price. */ name: string; + unit_config: NewSubscriptionUnitPrice.UnitConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -12012,7 +11876,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12045,7 +11909,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12061,26 +11925,12 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { + export namespace NewSubscriptionUnitPrice { + export interface UnitConfig { /** - * Bulk tiers for rating based on total usage volume + * Rate per unit of usage */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } + unit_amount: string; } /** @@ -12116,7 +11966,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionThresholdTotalAmountPrice { + export interface NewSubscriptionPackagePrice { /** * The cadence to bill for this price on. */ @@ -12127,14 +11977,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'threshold_total_amount'; + model_type: 'package'; /** * The name of the price. */ name: string; - threshold_total_amount_config: Record; + package_config: NewSubscriptionPackagePrice.PackageConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -12152,7 +12002,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12185,7 +12035,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12201,7 +12051,20 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionThresholdTotalAmountPrice { + export namespace NewSubscriptionPackagePrice { + export interface PackageConfig { + /** + * A currency amount to rate usage by + */ + package_amount: string; + + /** + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating + */ + package_size: number; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12235,7 +12098,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredPackagePrice { + export interface NewSubscriptionMatrixPrice { /** * The cadence to bill for this price on. */ @@ -12246,15 +12109,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_package'; + matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; + + model_type: 'matrix'; /** * The name of the price. */ name: string; - tiered_package_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -12271,7 +12134,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12304,7 +12167,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12320,21 +12183,54 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { + export namespace NewSubscriptionMatrixPrice { + export interface MatrixConfig { /** - * The duration of the billing period. + * Default per unit rate for any usage not bucketed into a specified matrix_value */ - duration: number; + default_unit_amount: string; /** - * The unit of billing period duration. + * One or two event property values to evaluate matrix groups by */ - duration_unit: 'day' | 'month'; + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } + + export namespace MatrixConfig { + 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; + } + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; } /** @@ -12354,7 +12250,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredWithMinimumPrice { + export interface NewSubscriptionTieredPrice { /** * The cadence to bill for this price on. */ @@ -12365,14 +12261,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_with_minimum'; + model_type: 'tiered'; /** * The name of the price. */ name: string; - tiered_with_minimum_config: Record; + tiered_config: NewSubscriptionTieredPrice.TieredConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -12390,7 +12286,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12423,7 +12319,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12439,7 +12335,33 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithMinimumPrice { + export namespace NewSubscriptionTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Inclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Exclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12473,7 +12395,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionUnitWithPercentPrice { + export interface NewSubscriptionTieredBpsPrice { /** * The cadence to bill for this price on. */ @@ -12484,14 +12406,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'unit_with_percent'; + model_type: 'tiered_bps'; /** * The name of the price. */ name: string; - unit_with_percent_config: Record; + tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -12509,7 +12431,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12542,7 +12464,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12558,7 +12480,39 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithPercentPrice { + export namespace NewSubscriptionTieredBpsPrice { + export interface TieredBpsConfig { + /** + * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + * tiers + */ + tiers: Array; + } + + export namespace TieredBpsConfig { + export interface Tier { + /** + * Per-event basis point rate + */ + bps: number; + + /** + * Inclusive tier starting value + */ + minimum_amount: string; + + /** + * Exclusive tier ending value + */ + maximum_amount?: string | null; + + /** + * Per unit maximum to charge + */ + per_unit_maximum?: string | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12592,7 +12546,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionPackageWithAllocationPrice { + export interface NewSubscriptionBpsPrice { + bps_config: NewSubscriptionBpsPrice.BpsConfig; + /** * The cadence to bill for this price on. */ @@ -12603,15 +12559,13 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'package_with_allocation'; + model_type: 'bps'; /** * The name of the price. */ name: string; - package_with_allocation_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -12628,7 +12582,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12661,7 +12615,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12677,7 +12631,19 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionPackageWithAllocationPrice { + export namespace NewSubscriptionBpsPrice { + export interface BpsConfig { + /** + * Basis point take rate per event + */ + bps: number; + + /** + * Optional currency amount maximum to cap spend per event + */ + per_unit_maximum?: string | null; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12711,7 +12677,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTierWithProrationPrice { + export interface NewSubscriptionBulkBpsPrice { + bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; + /** * The cadence to bill for this price on. */ @@ -12722,15 +12690,13 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_with_proration'; + model_type: 'bulk_bps'; /** * The name of the price. */ name: string; - tiered_with_proration_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -12747,7 +12713,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12780,7 +12746,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12796,7 +12762,34 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTierWithProrationPrice { + export namespace NewSubscriptionBulkBpsPrice { + export interface BulkBpsConfig { + /** + * Tiers for a bulk BPS pricing model where all usage is aggregated to a single + * tier based on total volume + */ + tiers: Array; + } + + export namespace BulkBpsConfig { + export interface Tier { + /** + * Basis points to rate on + */ + bps: number; + + /** + * Upper bound for tier + */ + maximum_amount?: string | null; + + /** + * The maximum amount to charge for any one event + */ + per_unit_maximum?: string | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12830,7 +12823,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionUnitWithProrationPrice { + export interface NewSubscriptionBulkPrice { + bulk_config: NewSubscriptionBulkPrice.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -12841,15 +12836,13 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'unit_with_proration'; + model_type: 'bulk'; /** * The name of the price. */ name: string; - unit_with_proration_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -12866,7 +12859,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12899,7 +12892,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12915,7 +12908,28 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithProrationPrice { + export namespace NewSubscriptionBulkPrice { + export interface BulkConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkConfig { + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Upper bound for this tier + */ + maximum_units?: number | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12949,26 +12963,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionGroupedAllocationPrice { + export interface NewSubscriptionThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_allocation_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_allocation'; + model_type: 'threshold_total_amount'; /** * The name of the price. */ name: string; + threshold_total_amount_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -12985,7 +12999,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13018,7 +13032,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13034,7 +13048,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedAllocationPrice { + export namespace NewSubscriptionThresholdTotalAmountPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -13068,26 +13082,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionGroupedWithProratedMinimumPrice { + export interface NewSubscriptionTieredPackagePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_prorated_minimum_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_with_prorated_minimum'; + model_type: 'tiered_package'; /** * The name of the price. */ name: string; + tiered_package_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -13104,7 +13118,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13137,7 +13151,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13153,7 +13167,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { + export namespace NewSubscriptionTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -13187,9 +13201,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - + export interface NewSubscriptionTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -13200,13 +13212,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'bulk_with_proration'; + model_type: 'tiered_with_minimum'; /** * The name of the price. */ name: string; + tiered_with_minimum_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -13223,7 +13237,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13256,7 +13270,7 @@ export namespace SubscriptionCreateParams { * 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?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13272,7 +13286,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkWithProrationPrice { + export namespace NewSubscriptionTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -13305,392 +13319,264 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } } - } -} -export interface SubscriptionUpdateParams { - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. - */ - auto_collection?: boolean | null; + export interface NewSubscriptionUnitWithPercentPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * Determines the default memo on this subscription's invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo?: string | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * When this subscription's accrued usage reaches this threshold, an invoice will - * be issued for the subscription. If not specified, invoices will only be issued - * at the end of the billing period. - */ - invoicing_threshold?: string | null; + model_type: 'unit_with_percent'; - /** - * 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?: Record | null; + /** + * The name of the price. + */ + name: string; - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms?: number | null; -} + unit_with_percent_config: Record; -export interface SubscriptionListParams extends PageParams { - 'created_at[gt]'?: string | null; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - 'created_at[gte]'?: 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; - 'created_at[lt]'?: string | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; - 'created_at[lte]'?: string | null; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - customer_id?: Array | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - external_customer_id?: string | null; + /** + * An alias for the price. + */ + external_price_id?: string | null; - status?: 'active' | 'ended' | 'upcoming' | null; -} + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; -export interface SubscriptionCancelParams { - /** - * Determines the timing of subscription cancellation - */ - cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date'; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * If false, this request will fail if it would void an issued invoice or create a - * credit note. Consider using this as a safety mechanism if you do not expect - * existing invoices to be changed. - */ - allow_invoice_credit_or_void?: boolean | 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?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; - /** - * The date that the cancellation should take effect. This parameter can only be - * passed if the `cancel_option` is `requested_date`. - */ - cancellation_date?: string | null; -} + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; -export interface SubscriptionFetchCostsParams { - /** - * The currency or custom pricing unit to use. - */ - currency?: string | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } - /** - * Costs returned are exclusive of `timeframe_end`. - */ - timeframe_end?: string | null; + export namespace NewSubscriptionUnitWithPercentPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Costs returned are inclusive of `timeframe_start`. - */ - timeframe_start?: string | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } - /** - * Controls whether Orb returns cumulative costs since the start of the billing - * period, or incremental day-by-day costs. If your customer has minimums or - * discounts, it's strongly recommended that you use the default cumulative - * behavior. - */ - view_mode?: 'periodic' | 'cumulative' | null; -} + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; -export interface SubscriptionFetchScheduleParams extends PageParams { - 'start_date[gt]'?: string | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } - 'start_date[gte]'?: string | null; + export interface NewSubscriptionPackageWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - 'start_date[lt]'?: string | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - 'start_date[lte]'?: string | null; -} + model_type: 'package_with_allocation'; -export interface SubscriptionFetchUsageParams { - /** - * When specified in conjunction with `group_by`, this parameter filters usage to a - * single billable metric. Note that both `group_by` and `billable_metric_id` must - * be specified together. - */ - billable_metric_id?: string | null; + /** + * The name of the price. + */ + name: string; - first_dimension_key?: string | null; + package_with_allocation_config: Record; - first_dimension_value?: string | null; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * This determines the windowing of usage reporting. - */ - granularity?: 'day' | 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; - /** - * Groups per-price usage by the key provided. - */ - group_by?: string | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; - second_dimension_key?: string | null; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - second_dimension_value?: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * Usage returned is exclusive of `timeframe_end`. - */ - timeframe_end?: string | null; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * Usage returned is inclusive of `timeframe_start`. - */ - timeframe_start?: string | null; - - /** - * Controls whether Orb returns cumulative usage since the start of the billing - * period, or incremental day-by-day usage. If your customer has minimums or - * discounts, it's strongly recommended that you use the default cumulative - * behavior. - */ - view_mode?: 'periodic' | 'cumulative' | null; -} - -export interface SubscriptionPriceIntervalsParams { - /** - * A list of price intervals to add to the subscription. - */ - add?: Array; - - /** - * A list of adjustments to add to the subscription. - */ - add_adjustments?: Array; - - /** - * If false, this request will fail if it would void an issued invoice or create a - * credit note. Consider using this as a safety mechanism if you do not expect - * existing invoices to be changed. - */ - allow_invoice_credit_or_void?: boolean | null; - - /** - * A list of price intervals to edit on the subscription. - */ - edit?: Array; - - /** - * A list of adjustments to edit on the subscription. - */ - edit_adjustments?: Array; -} - -export namespace SubscriptionPriceIntervalsParams { - export interface Add { - /** - * The start date of the price interval. This is the date that the price will start - * billing on the subscription. - */ - start_date: (string & {}) | Shared.BillingCycleRelativeDate; - - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: Add.AllocationPrice | null; - - /** - * A list of discounts to initialize on the price interval. - */ - discounts?: Array< - | Add.AmountDiscountCreationParams - | Add.PercentageDiscountCreationParams - | Add.UsageDiscountCreationParams - > | null; - - /** - * The end date of the price interval. This is the date that the price will stop - * billing on the subscription. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * An additional filter to apply to usage queries. This filter must be expressed as - * a boolean - * [computed property](/extensibility/advanced-metrics#computed-properties). If - * null, usage queries will not include any additional filter. - */ - filter?: string | null; - - /** - * A list of fixed fee quantity transitions to initialize on the price interval. - */ - fixed_fee_quantity_transitions?: Array | null; - - /** - * The maximum amount that will be billed for this price interval for a given - * billing period. - */ - maximum_amount?: number | null; - - /** - * The minimum amount that will be billed for this price interval for a given - * billing period. - */ - minimum_amount?: number | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | Add.NewFloatingUnitPrice - | Add.NewFloatingPackagePrice - | Add.NewFloatingMatrixPrice - | Add.NewFloatingMatrixWithAllocationPrice - | Add.NewFloatingTieredPrice - | Add.NewFloatingTieredBpsPrice - | Add.NewFloatingBpsPrice - | Add.NewFloatingBulkBpsPrice - | Add.NewFloatingBulkPrice - | Add.NewFloatingThresholdTotalAmountPrice - | Add.NewFloatingTieredPackagePrice - | Add.NewFloatingGroupedTieredPrice - | Add.NewFloatingMaxGroupTieredPackagePrice - | Add.NewFloatingTieredWithMinimumPrice - | Add.NewFloatingPackageWithAllocationPrice - | Add.NewFloatingTieredPackageWithMinimumPrice - | Add.NewFloatingUnitWithPercentPrice - | Add.NewFloatingTieredWithProrationPrice - | Add.NewFloatingUnitWithProrationPrice - | Add.NewFloatingGroupedAllocationPrice - | Add.NewFloatingGroupedWithProratedMinimumPrice - | Add.NewFloatingGroupedWithMeteredMinimumPrice - | Add.NewFloatingMatrixWithDisplayNamePrice - | Add.NewFloatingBulkWithProrationPrice - | Add.NewFloatingGroupedTieredPackagePrice - | Add.NewFloatingScalableMatrixWithUnitPricingPrice - | Add.NewFloatingScalableMatrixWithTieredPricingPrice - | Add.NewFloatingCumulativeGroupedBulkPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; - } - - export namespace Add { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { /** - * An amount of the currency to allocate to the customer at the specified cadence. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - amount: string; + fixed_price_quantity?: number | null; /** - * The cadence at which to allocate the amount to the customer. + * The property used to group this price on an invoice */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + invoice_grouping_key?: string | null; /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - currency: string; + invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * 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`. */ - expires_at_end_of_cadence: boolean; - } + metadata?: Record | null; - export interface AmountDiscountCreationParams { /** - * Only available if discount_type is `amount`. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - amount_discount: number; - - discount_type: 'amount'; + reference_id?: string | null; } - export interface PercentageDiscountCreationParams { - discount_type: 'percentage'; - + export namespace NewSubscriptionPackageWithAllocationPrice { /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - percentage_discount: number; - } - - export interface UsageDiscountCreationParams { - discount_type: 'usage'; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for. - */ - usage_discount: number; - } + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } - export interface FixedFeeQuantityTransition { /** - * The date that the fixed fee quantity transition should take effect. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - effective_date: string; + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * The quantity of the fixed fee quantity transition. - */ - quantity: number; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewFloatingUnitPrice { + export interface NewSubscriptionTierWithProrationPrice { /** * 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; - model_type: 'unit'; + model_type: 'tiered_with_proration'; /** * The name of the price. */ name: string; - unit_config: NewFloatingUnitPrice.UnitConfig; + tiered_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -13708,13 +13594,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -13735,7 +13627,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13743,16 +13635,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - export namespace NewFloatingUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } + /** + * 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 NewSubscriptionTierWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -13786,30 +13677,25 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingPackagePrice { + export interface NewSubscriptionUnitWithProrationPrice { /** * 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; - model_type: 'package'; + model_type: 'unit_with_proration'; /** * The name of the price. */ name: string; - package_config: NewFloatingPackagePrice.PackageConfig; + unit_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -13827,13 +13713,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -13854,7 +13746,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13862,22 +13754,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } + /** + * 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 NewSubscriptionUnitWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -13911,25 +13796,20 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMatrixPrice { + export interface NewSubscriptionGroupedAllocationPrice { /** * 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; + grouped_allocation_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - matrix_config: NewFloatingMatrixPrice.MatrixConfig; - - model_type: 'matrix'; + model_type: 'grouped_allocation'; /** * The name of the price. @@ -13952,13 +13832,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -13979,7 +13865,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13987,42 +13873,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - 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; - } - } + /** + * 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 NewSubscriptionGroupedAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14056,25 +13915,20 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMatrixWithAllocationPrice { + export interface NewSubscriptionGroupedWithProratedMinimumPrice { /** * 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; + grouped_with_prorated_minimum_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; + model_type: 'grouped_with_prorated_minimum'; /** * The name of the price. @@ -14097,13 +13951,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -14124,7 +13984,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14132,47 +13992,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - 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; - } - } + /** + * 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 NewSubscriptionGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14206,31 +14034,26 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredPrice { + export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; + /** * 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; - model_type: 'tiered'; + model_type: 'bulk_with_proration'; /** * The name of the price. */ name: string; - tiered_config: NewFloatingTieredPrice.TieredConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -14247,13 +14070,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -14274,7 +14103,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14282,35 +14111,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Inclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - /** - * Exclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | 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 NewSubscriptionBulkWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14344,30 +14153,25 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredBpsPrice { + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * 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; - model_type: 'tiered_bps'; + model_type: 'scalable_matrix_with_unit_pricing'; /** * The name of the price. */ name: string; - tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig; + scalable_matrix_with_unit_pricing_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -14385,7 +14189,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14393,9 +14197,15 @@ export namespace SubscriptionPriceIntervalsParams { conversion_rate?: number | null; /** - * An alias for the price. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - external_price_id?: string | null; + currency?: string | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; /** * If the Price represents a fixed cost, this represents the quantity of units @@ -14412,7 +14222,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14420,41 +14230,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Inclusive tier starting value - */ - minimum_amount: string; - - /** - * Exclusive tier ending value - */ - maximum_amount?: string | null; - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | 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 NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14488,31 +14272,26 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingBpsPrice { - bps_config: NewFloatingBpsPrice.BpsConfig; - + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * 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; - model_type: 'bps'; + model_type: 'scalable_matrix_with_tiered_pricing'; /** * The name of the price. */ name: string; + scalable_matrix_with_tiered_pricing_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -14529,13 +14308,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -14556,7 +14341,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14564,21 +14349,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | 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 NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14612,25 +14391,20 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingBulkBpsPrice { - bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; - + export interface NewSubscriptionCumulativeGroupedBulkPrice { /** * 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; + cumulative_grouped_bulk_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'bulk_bps'; + model_type: 'cumulative_grouped_bulk'; /** * The name of the price. @@ -14653,13 +14427,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -14680,7 +14460,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14688,36 +14468,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | 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 NewSubscriptionCumulativeGroupedBulkPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14751,25 +14510,20 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingBulkPrice { - bulk_config: NewFloatingBulkPrice.BulkConfig; - + export interface NewSubscriptionMaxGroupTieredPackagePrice { /** * 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; - model_type: 'bulk'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * The name of the price. @@ -14792,13 +14546,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -14819,7 +14579,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14827,30 +14587,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - - export namespace NewFloatingBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - /** - * Upper bound for this tier - */ - maximum_units?: number | 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 NewSubscriptionMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14884,31 +14629,26 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingThresholdTotalAmountPrice { + export interface NewSubscriptionGroupedWithMeteredMinimumPrice { /** * 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; + grouped_with_metered_minimum_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'threshold_total_amount'; + model_type: 'grouped_with_metered_minimum'; /** * The name of the price. */ name: string; - threshold_total_amount_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -14925,13 +14665,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -14952,7 +14698,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14960,9 +14706,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | 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 NewFloatingThresholdTotalAmountPrice { + export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14996,31 +14748,26 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredPackagePrice { + export interface NewSubscriptionMatrixWithDisplayNamePrice { /** * 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; - model_type: 'tiered_package'; + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; /** * The name of the price. */ name: string; - tiered_package_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -15037,13 +14784,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -15064,7 +14817,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15072,9 +14825,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | 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 NewFloatingTieredPackagePrice { + export namespace NewSubscriptionMatrixWithDisplayNamePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15108,25 +14867,20 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedTieredPrice { + export interface NewSubscriptionGroupedTieredPackagePrice { /** * 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; - - grouped_tiered_config: Record; + grouped_tiered_package_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_tiered'; + model_type: 'grouped_tiered_package'; /** * The name of the price. @@ -15149,13 +14903,19 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + /** * An alias for the price. */ @@ -15176,7 +14936,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15184,9 +14944,15 @@ export namespace SubscriptionPriceIntervalsParams { * by setting `metadata` to `null`. */ metadata?: Record | null; - } - export namespace NewFloatingGroupedTieredPrice { + /** + * 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 NewSubscriptionGroupedTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15219,232 +14985,369 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } } + } +} - export interface NewFloatingMaxGroupTieredPackagePrice { - /** - * 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; +export interface SubscriptionUpdateParams { + /** + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. This property defaults to + * the plan's behavior. + */ + auto_collection?: boolean | null; - /** - * The id of the item the price will be associated with. - */ - item_id: string; + /** + * Determines the default memo on this subscription's invoices. Note that if this + * is not provided, it is determined by the plan configuration. + */ + default_invoice_memo?: string | null; - max_group_tiered_package_config: Record; + /** + * When this subscription's accrued usage reaches this threshold, an invoice will + * be issued for the subscription. If not specified, invoices will only be issued + * at the end of the billing period. + */ + invoicing_threshold?: string | null; - model_type: 'max_group_tiered_package'; + /** + * 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?: Record | null; - /** - * The name of the price. - */ - name: string; + /** + * Determines the difference between the invoice issue date for subscription + * invoices as the date that they are due. A value of `0` here represents that the + * invoice is due on issue, whereas a value of `30` represents that the customer + * has a month to pay the invoice. + */ + net_terms?: number | null; +} - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; +export interface SubscriptionListParams extends PageParams { + 'created_at[gt]'?: 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; + 'created_at[gte]'?: string | null; - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + 'created_at[lt]'?: string | null; - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; + 'created_at[lte]'?: string | null; - /** - * An alias for the price. - */ - external_price_id?: string | null; + customer_id?: Array | null; - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; + external_customer_id?: string | null; - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; + status?: 'active' | 'ended' | 'upcoming' | 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?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; +export interface SubscriptionCancelParams { + /** + * Determines the timing of subscription cancellation + */ + cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date'; - /** - * 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?: Record | null; - } + /** + * If false, this request will fail if it would void an issued invoice or create a + * credit note. Consider using this as a safety mechanism if you do not expect + * existing invoices to be changed. + */ + allow_invoice_credit_or_void?: boolean | null; - export namespace NewFloatingMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + /** + * The date that the cancellation should take effect. This parameter can only be + * passed if the `cancel_option` is `requested_date`. + */ + cancellation_date?: string | null; +} - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } +export interface SubscriptionFetchCostsParams { + /** + * The currency or custom pricing unit to use. + */ + currency?: string | null; - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + /** + * Costs returned are exclusive of `timeframe_end`. + */ + timeframe_end?: string | null; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } + /** + * Costs returned are inclusive of `timeframe_start`. + */ + timeframe_start?: string | null; - export interface NewFloatingTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + /** + * Controls whether Orb returns cumulative costs since the start of the billing + * period, or incremental day-by-day costs. If your customer has minimums or + * discounts, it's strongly recommended that you use the default cumulative + * behavior. + */ + view_mode?: 'periodic' | 'cumulative' | null; +} - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; +export interface SubscriptionFetchScheduleParams extends PageParams { + 'start_date[gt]'?: string | null; - /** - * The id of the item the price will be associated with. - */ - item_id: string; + 'start_date[gte]'?: string | null; - model_type: 'tiered_with_minimum'; + 'start_date[lt]'?: string | null; - /** - * The name of the price. - */ - name: string; + 'start_date[lte]'?: string | null; +} - tiered_with_minimum_config: Record; +export interface SubscriptionFetchUsageParams { + /** + * When specified in conjunction with `group_by`, this parameter filters usage to a + * single billable metric. Note that both `group_by` and `billable_metric_id` must + * be specified together. + */ + billable_metric_id?: string | null; - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; + first_dimension_key?: 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; + first_dimension_value?: string | null; - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; + /** + * This determines the windowing of usage reporting. + */ + granularity?: 'day' | null; - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; + /** + * Groups per-price usage by the key provided. + */ + group_by?: string | null; - /** - * An alias for the price. - */ - external_price_id?: string | null; + second_dimension_key?: string | null; - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; + second_dimension_value?: string | null; - /** - * The property used to group this price on an invoice + /** + * Usage returned is exclusive of `timeframe_end`. + */ + timeframe_end?: string | null; + + /** + * Usage returned is inclusive of `timeframe_start`. + */ + timeframe_start?: string | null; + + /** + * Controls whether Orb returns cumulative usage since the start of the billing + * period, or incremental day-by-day usage. If your customer has minimums or + * discounts, it's strongly recommended that you use the default cumulative + * behavior. + */ + view_mode?: 'periodic' | 'cumulative' | null; +} + +export interface SubscriptionPriceIntervalsParams { + /** + * A list of price intervals to add to the subscription. + */ + add?: Array; + + /** + * A list of adjustments to add to the subscription. + */ + add_adjustments?: Array; + + /** + * If false, this request will fail if it would void an issued invoice or create a + * credit note. Consider using this as a safety mechanism if you do not expect + * existing invoices to be changed. + */ + allow_invoice_credit_or_void?: boolean | null; + + /** + * A list of price intervals to edit on the subscription. + */ + edit?: Array; + + /** + * A list of adjustments to edit on the subscription. + */ + edit_adjustments?: Array; +} + +export namespace SubscriptionPriceIntervalsParams { + export interface Add { + /** + * The start date of the price interval. This is the date that the price will start + * billing on the subscription. + */ + start_date: (string & {}) | Shared.BillingCycleRelativeDate; + + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: Add.AllocationPrice | null; + + /** + * A list of discounts to initialize on the price interval. + */ + discounts?: Array< + | Add.AmountDiscountCreationParams + | Add.PercentageDiscountCreationParams + | Add.UsageDiscountCreationParams + > | null; + + /** + * The end date of the price interval. This is the date that the price will stop + * billing on the subscription. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + + /** + * The external price id of the price to add to the subscription. + */ + external_price_id?: string | null; + + /** + * An additional filter to apply to usage queries. This filter must be expressed as + * a boolean + * [computed property](/extensibility/advanced-metrics#computed-properties). If + * null, usage queries will not include any additional filter. + */ + filter?: string | null; + + /** + * A list of fixed fee quantity transitions to initialize on the price interval. + */ + fixed_fee_quantity_transitions?: Array | null; + + /** + * The maximum amount that will be billed for this price interval for a given + * billing period. + */ + maximum_amount?: number | null; + + /** + * The minimum amount that will be billed for this price interval for a given + * billing period. + */ + minimum_amount?: number | null; + + /** + * The definition of a new price to create and add to the subscription. + */ + price?: + | Add.NewFloatingUnitPrice + | Add.NewFloatingPackagePrice + | Add.NewFloatingMatrixPrice + | Add.NewFloatingMatrixWithAllocationPrice + | Add.NewFloatingTieredPrice + | Add.NewFloatingTieredBpsPrice + | Add.NewFloatingBpsPrice + | Add.NewFloatingBulkBpsPrice + | Add.NewFloatingBulkPrice + | Add.NewFloatingThresholdTotalAmountPrice + | Add.NewFloatingTieredPackagePrice + | Add.NewFloatingGroupedTieredPrice + | Add.NewFloatingMaxGroupTieredPackagePrice + | Add.NewFloatingTieredWithMinimumPrice + | Add.NewFloatingPackageWithAllocationPrice + | Add.NewFloatingTieredPackageWithMinimumPrice + | Add.NewFloatingUnitWithPercentPrice + | Add.NewFloatingTieredWithProrationPrice + | Add.NewFloatingUnitWithProrationPrice + | Add.NewFloatingGroupedAllocationPrice + | Add.NewFloatingGroupedWithProratedMinimumPrice + | Add.NewFloatingGroupedWithMeteredMinimumPrice + | Add.NewFloatingMatrixWithDisplayNamePrice + | Add.NewFloatingBulkWithProrationPrice + | Add.NewFloatingGroupedTieredPackagePrice + | Add.NewFloatingScalableMatrixWithUnitPricingPrice + | Add.NewFloatingScalableMatrixWithTieredPricingPrice + | Add.NewFloatingCumulativeGroupedBulkPrice + | null; + + /** + * The id of the price to add to the subscription. + */ + price_id?: string | null; + + /** + * A list of customer IDs whose usage events will be aggregated and billed under + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. + */ + usage_customer_ids?: Array | null; + } + + export namespace Add { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + export interface AllocationPrice { + /** + * An amount of the currency to allocate to the customer at the specified cadence. */ - invoice_grouping_key?: string | null; + amount: string; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * The cadence at which to allocate the amount to the customer. */ - invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; /** - * 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`. + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. */ - metadata?: Record | null; + currency: string; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. + */ + expires_at_end_of_cadence: boolean; } - export namespace NewFloatingTieredWithMinimumPrice { + export interface AmountDiscountCreationParams { /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * Only available if discount_type is `amount`. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + amount_discount: number; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + discount_type: 'amount'; + } + + export interface PercentageDiscountCreationParams { + discount_type: 'percentage'; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + percentage_discount: number; + } - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + export interface UsageDiscountCreationParams { + discount_type: 'usage'; + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for. + */ + usage_discount: number; } - export interface NewFloatingPackageWithAllocationPrice { + export interface FixedFeeQuantityTransition { + /** + * The date that the fixed fee quantity transition should take effect. + */ + effective_date: string; + + /** + * The quantity of the fixed fee quantity transition. + */ + quantity: number; + } + + export interface NewFloatingUnitPrice { /** * The cadence to bill for this price on. */ @@ -15460,14 +15363,14 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'package_with_allocation'; + model_type: 'unit'; /** * The name of the price. */ name: string; - package_with_allocation_config: Record; + unit_config: NewFloatingUnitPrice.UnitConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -15485,7 +15388,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15512,7 +15415,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15522,11 +15425,18 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ + export namespace NewFloatingUnitPrice { + export interface UnitConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ export interface BillingCycleConfiguration { /** * The duration of the billing period. @@ -15556,7 +15466,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredPackageWithMinimumPrice { + export interface NewFloatingPackagePrice { /** * The cadence to bill for this price on. */ @@ -15572,14 +15482,14 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'tiered_package_with_minimum'; + model_type: 'package'; /** * The name of the price. */ name: string; - tiered_package_with_minimum_config: Record; + package_config: NewFloatingPackagePrice.PackageConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -15597,7 +15507,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15624,7 +15534,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15634,7 +15544,20 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingTieredPackageWithMinimumPrice { + export namespace NewFloatingPackagePrice { + export interface PackageConfig { + /** + * A currency amount to rate usage by + */ + package_amount: string; + + /** + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating + */ + package_size: number; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15668,7 +15591,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingUnitWithPercentPrice { + export interface NewFloatingMatrixPrice { /** * The cadence to bill for this price on. */ @@ -15684,15 +15607,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'unit_with_percent'; + matrix_config: NewFloatingMatrixPrice.MatrixConfig; + + model_type: 'matrix'; /** * The name of the price. */ name: string; - unit_with_percent_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -15709,7 +15632,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15736,7 +15659,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15746,7 +15669,40 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingUnitWithPercentPrice { + export namespace NewFloatingMatrixPrice { + export interface MatrixConfig { + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } + + export namespace MatrixConfig { + 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; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15780,7 +15736,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredWithProrationPrice { + export interface NewFloatingMatrixWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -15796,15 +15752,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'tiered_with_proration'; + matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_allocation'; /** * The name of the price. */ name: string; - tiered_with_proration_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -15821,7 +15777,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15848,7 +15804,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15858,7 +15814,45 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingTieredWithProrationPrice { + export namespace NewFloatingMatrixWithAllocationPrice { + export interface MatrixWithAllocationConfig { + /** + * Allocation to be used to calculate the price + */ + allocation: number; + + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } + + export namespace MatrixWithAllocationConfig { + 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; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15892,7 +15886,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingUnitWithProrationPrice { + export interface NewFloatingTieredPrice { /** * The cadence to bill for this price on. */ @@ -15908,14 +15902,14 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'unit_with_proration'; + model_type: 'tiered'; /** * The name of the price. */ name: string; - unit_with_proration_config: Record; + tiered_config: NewFloatingTieredPrice.TieredConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -15933,7 +15927,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15960,7 +15954,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15970,7 +15964,33 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingUnitWithProrationPrice { + export namespace NewFloatingTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Inclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Exclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16004,7 +16024,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedAllocationPrice { + export interface NewFloatingTieredBpsPrice { /** * The cadence to bill for this price on. */ @@ -16015,20 +16035,20 @@ export namespace SubscriptionPriceIntervalsParams { */ currency: string; - grouped_allocation_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_allocation'; + model_type: 'tiered_bps'; /** * The name of the price. */ name: string; + tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16045,7 +16065,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16072,7 +16092,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16082,7 +16102,39 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedAllocationPrice { + export namespace NewFloatingTieredBpsPrice { + export interface TieredBpsConfig { + /** + * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + * tiers + */ + tiers: Array; + } + + export namespace TieredBpsConfig { + export interface Tier { + /** + * Per-event basis point rate + */ + bps: number; + + /** + * Inclusive tier starting value + */ + minimum_amount: string; + + /** + * Exclusive tier ending value + */ + maximum_amount?: string | null; + + /** + * Per unit maximum to charge + */ + per_unit_maximum?: string | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16116,7 +16168,9 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedWithProratedMinimumPrice { + export interface NewFloatingBpsPrice { + bps_config: NewFloatingBpsPrice.BpsConfig; + /** * The cadence to bill for this price on. */ @@ -16127,14 +16181,12 @@ export namespace SubscriptionPriceIntervalsParams { */ currency: string; - grouped_with_prorated_minimum_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_with_prorated_minimum'; + model_type: 'bps'; /** * The name of the price. @@ -16157,7 +16209,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16184,7 +16236,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16194,7 +16246,19 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedWithProratedMinimumPrice { + export namespace NewFloatingBpsPrice { + export interface BpsConfig { + /** + * Basis point take rate per event + */ + bps: number; + + /** + * Optional currency amount maximum to cap spend per event + */ + per_unit_maximum?: string | null; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16228,7 +16292,9 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedWithMeteredMinimumPrice { + export interface NewFloatingBulkBpsPrice { + bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; + /** * The cadence to bill for this price on. */ @@ -16239,14 +16305,12 @@ export namespace SubscriptionPriceIntervalsParams { */ currency: string; - grouped_with_metered_minimum_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_with_metered_minimum'; + model_type: 'bulk_bps'; /** * The name of the price. @@ -16269,7 +16333,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16296,7 +16360,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16306,7 +16370,34 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedWithMeteredMinimumPrice { + export namespace NewFloatingBulkBpsPrice { + export interface BulkBpsConfig { + /** + * Tiers for a bulk BPS pricing model where all usage is aggregated to a single + * tier based on total volume + */ + tiers: Array; + } + + export namespace BulkBpsConfig { + export interface Tier { + /** + * Basis points to rate on + */ + bps: number; + + /** + * Upper bound for tier + */ + maximum_amount?: string | null; + + /** + * The maximum amount to charge for any one event + */ + per_unit_maximum?: string | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16340,7 +16431,9 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMatrixWithDisplayNamePrice { + export interface NewFloatingBulkPrice { + bulk_config: NewFloatingBulkPrice.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -16356,9 +16449,7 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; + model_type: 'bulk'; /** * The name of the price. @@ -16381,7 +16472,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16408,7 +16499,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16418,7 +16509,28 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingMatrixWithDisplayNamePrice { + export namespace NewFloatingBulkPrice { + export interface BulkConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkConfig { + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Upper bound for this tier + */ + maximum_units?: number | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16452,9 +16564,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingBulkWithProrationPrice { - bulk_with_proration_config: Record; - + export interface NewFloatingThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ @@ -16470,13 +16580,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'bulk_with_proration'; + model_type: 'threshold_total_amount'; /** * The name of the price. */ name: string; + threshold_total_amount_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16493,7 +16605,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16520,7 +16632,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16530,7 +16642,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingBulkWithProrationPrice { + export namespace NewFloatingThresholdTotalAmountPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16564,7 +16676,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedTieredPackagePrice { + export interface NewFloatingTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -16575,20 +16687,20 @@ export namespace SubscriptionPriceIntervalsParams { */ currency: string; - grouped_tiered_package_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_tiered_package'; + model_type: 'tiered_package'; /** * The name of the price. */ name: string; + tiered_package_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16605,7 +16717,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16632,7 +16744,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16642,7 +16754,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedTieredPackagePrice { + export namespace NewFloatingTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16676,7 +16788,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingScalableMatrixWithUnitPricingPrice { + export interface NewFloatingGroupedTieredPrice { /** * The cadence to bill for this price on. */ @@ -16687,20 +16799,20 @@ export namespace SubscriptionPriceIntervalsParams { */ currency: string; + grouped_tiered_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'scalable_matrix_with_unit_pricing'; + model_type: 'grouped_tiered'; /** * The name of the price. */ name: string; - scalable_matrix_with_unit_pricing_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16717,7 +16829,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16744,7 +16856,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16754,7 +16866,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingScalableMatrixWithUnitPricingPrice { + export namespace NewFloatingGroupedTieredPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16788,7 +16900,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingScalableMatrixWithTieredPricingPrice { + export interface NewFloatingMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -16804,15 +16916,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'scalable_matrix_with_tiered_pricing'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * The name of the price. */ name: string; - scalable_matrix_with_tiered_pricing_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16829,7 +16941,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16856,7 +16968,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16866,7 +16978,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingScalableMatrixWithTieredPricingPrice { + export namespace NewFloatingMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16900,14 +17012,12 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingCumulativeGroupedBulkPrice { + export interface NewFloatingTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; - /** * An ISO 4217 currency string for which this price is billed in. */ @@ -16918,13 +17028,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'cumulative_grouped_bulk'; + model_type: 'tiered_with_minimum'; /** * The name of the price. */ name: string; + tiered_with_minimum_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16941,7 +17053,7 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16968,7 +17080,7 @@ export namespace SubscriptionPriceIntervalsParams { * 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?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16978,7 +17090,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingCumulativeGroupedBulkPrice { + export namespace NewFloatingTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -17011,614 +17123,4026 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } } - } - - export interface AddAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; - - /** - * The start date of the adjustment interval. This is the date that the adjustment - * will start affecting prices on the subscription. - */ - start_date: (string & {}) | Shared.BillingCycleRelativeDate; - - /** - * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - } - - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + export interface NewFloatingPackageWithAllocationPrice { /** - * The set of price IDs to which this adjustment applies. + * The cadence to bill for this price on. */ - applies_to_price_ids: Array; - - percentage_discount: number; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * An ISO 4217 currency string for which this price is billed in. */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + currency: string; /** - * The set of price IDs to which this adjustment applies. + * The id of the item the price will be associated with. */ - applies_to_price_ids: Array; + item_id: string; - usage_discount: number; + model_type: 'package_with_allocation'; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * The name of the price. */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; + name: string; - amount_discount: string; + package_with_allocation_config: Record; /** - * The set of price IDs to which this adjustment applies. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - applies_to_price_ids: Array; + billable_metric_id?: string | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * 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. */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; + billed_in_advance?: boolean | null; /** - * The set of price IDs to which this adjustment applies. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - applies_to_price_ids: Array; + billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; /** - * The item ID that revenue from this minimum will be attributed to. + * The per unit conversion rate of the price currency to the invoicing currency. */ - item_id: string; - - minimum_amount: string; + conversion_rate?: number | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * An alias for the price. */ - is_invoice_level?: boolean; - } + external_price_id?: string | null; - export interface NewMaximum { - adjustment_type: 'maximum'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; /** - * The set of price IDs to which this adjustment applies. + * The property used to group this price on an invoice */ - applies_to_price_ids: Array; + invoice_grouping_key?: string | null; - maximum_amount: string; + /** + * 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?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * 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`. */ - is_invoice_level?: boolean; + metadata?: Record | null; } - } - export interface Edit { - /** - * The id of the price interval to edit. - */ - price_interval_id: string; + export namespace NewFloatingPackageWithAllocationPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * The updated billing cycle day for this price interval. If not specified, the - * billing cycle day will not be updated. Note that overlapping price intervals - * must have the same billing cycle day. - */ - billing_cycle_day?: number | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } - /** - * The updated end date of this price interval. If not specified, the start date - * will not be updated. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * An additional filter to apply to usage queries. This filter must be expressed as - * a boolean - * [computed property](/extensibility/advanced-metrics#computed-properties). If - * null, usage queries will not include any additional filter. - */ - filter?: string | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } - /** - * A list of fixed fee quantity transitions to use for this price interval. Note - * that this list will overwrite all existing fixed fee quantity transitions on the - * price interval. - */ - fixed_fee_quantity_transitions?: Array | null; + export interface NewFloatingTieredPackageWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The updated start date of this price interval. If not specified, the start date - * will not be updated. - */ - start_date?: (string & {}) | Shared.BillingCycleRelativeDate; + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_package_with_minimum'; - export namespace Edit { - export interface FixedFeeQuantityTransition { /** - * The date that the fixed fee quantity transition should take effect. + * The name of the price. */ - effective_date: string; + name: string; + + tiered_package_with_minimum_config: Record; /** - * The quantity of the fixed fee quantity transition. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - quantity: number; - } - } + billable_metric_id?: string | null; - export interface EditAdjustment { - /** - * The id of the adjustment interval to edit. - */ - adjustment_interval_id: string; + /** + * 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; - /** - * The updated end date of this adjustment interval. If not specified, the start - * date will not be updated. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - /** - * The updated start date of this adjustment interval. If not specified, the start - * date will not be updated. - */ - start_date?: (string & {}) | Shared.BillingCycleRelativeDate; - } -} + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; -export interface SubscriptionSchedulePlanChangeParams { - change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * Additional adjustments to be added to the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - add_adjustments?: Array | null; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * Additional prices to be added to the subscription. (Only available for accounts - * that have migrated off of legacy subscription overrides) - */ - add_prices?: Array | null; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be - * aligned with the plan change's effective date. - */ - align_billing_with_plan_change_date?: boolean | 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?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. If not specified, this - * defaults to the behavior configured for this customer. - */ - auto_collection?: boolean | 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?: Record | null; + } - /** - * Reset billing periods to be aligned with the plan change's effective date or - * start of the month. Defaults to `unchanged` which keeps subscription's existing - * billing cycle alignment. - */ - billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null; + export namespace NewFloatingTieredPackageWithMinimumPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - billing_cycle_anchor_configuration?: SubscriptionSchedulePlanChangeParams.BillingCycleAnchorConfiguration | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } - /** - * The date that the plan change should take effect. This parameter can only be - * passed if the `change_option` is `requested_date`. If a date with no time is - * passed, the plan change will happen at midnight in the customer's timezone. - */ - change_date?: string | null; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Redemption code to be used for this subscription. If the coupon cannot be found - * by its redemption code, or cannot be redeemed, an error response will be - * returned and the subscription creation or plan change will not be scheduled. - */ - coupon_redemption_code?: string | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } - credits_overage_rate?: number | null; + export interface NewFloatingUnitWithPercentPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * Determines the default memo on this subscription's invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo?: string | null; + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; - /** - * The external_plan_id of the plan that the given subscription should be switched - * to. Note that either this property or `plan_id` must be specified. - */ - external_plan_id?: string | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + unit_with_percent_config: Record; + + /** + * 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?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingUnitWithPercentPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingTieredWithProrationPrice { + /** + * 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; + + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_proration_config: Record; + + /** + * 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?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingTieredWithProrationPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingUnitWithProrationPrice { + /** + * 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; + + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + unit_with_proration_config: Record; + + /** + * 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?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingUnitWithProrationPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingGroupedAllocationPrice { + /** + * 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; + + grouped_allocation_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingGroupedAllocationPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingGroupedWithProratedMinimumPrice { + /** + * 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; + + grouped_with_prorated_minimum_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_with_prorated_minimum'; + + /** + * 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?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingGroupedWithProratedMinimumPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingGroupedWithMeteredMinimumPrice { + /** + * 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; + + grouped_with_metered_minimum_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_with_metered_minimum'; + + /** + * 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?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingGroupedWithMeteredMinimumPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingMatrixWithDisplayNamePrice { + /** + * 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; + + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; + + /** + * 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?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingMatrixWithDisplayNamePrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * 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; + + model_type: 'bulk_with_proration'; + + /** + * 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?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingBulkWithProrationPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingGroupedTieredPackagePrice { + /** + * 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; + + grouped_tiered_package_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered_package'; + + /** + * 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?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingGroupedTieredPackagePrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingScalableMatrixWithUnitPricingPrice { + /** + * 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; + + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + scalable_matrix_with_unit_pricing_config: Record; + + /** + * 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?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingScalableMatrixWithUnitPricingPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingScalableMatrixWithTieredPricingPrice { + /** + * 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; + + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + scalable_matrix_with_tiered_pricing_config: Record; + + /** + * 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?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingScalableMatrixWithTieredPricingPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + cumulative_grouped_bulk_config: Record; + + /** + * 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; + + model_type: 'cumulative_grouped_bulk'; + + /** + * 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?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | 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?: Record | null; + } + + export namespace NewFloatingCumulativeGroupedBulkPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + } + + export interface AddAdjustment { + /** + * The definition of a new adjustment to create and add to the subscription. + */ + adjustment: + | AddAdjustment.NewPercentageDiscount + | AddAdjustment.NewUsageDiscount + | AddAdjustment.NewAmountDiscount + | AddAdjustment.NewMinimum + | AddAdjustment.NewMaximum; + + /** + * The start date of the adjustment interval. This is the date that the adjustment + * will start affecting prices on the subscription. + */ + start_date: (string & {}) | Shared.BillingCycleRelativeDate; + + /** + * The end date of the adjustment interval. This is the date that the adjustment + * will stop affecting prices on the subscription. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + } + + export namespace AddAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + percentage_discount: number; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + usage_discount: number; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewAmountDiscount { + adjustment_type: 'amount_discount'; + + amount_discount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + maximum_amount: string; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + } + + export interface Edit { + /** + * The id of the price interval to edit. + */ + price_interval_id: string; + + /** + * The updated billing cycle day for this price interval. If not specified, the + * billing cycle day will not be updated. Note that overlapping price intervals + * must have the same billing cycle day. + */ + billing_cycle_day?: number | null; + + /** + * The updated end date of this price interval. If not specified, the start date + * will not be updated. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + + /** + * An additional filter to apply to usage queries. This filter must be expressed as + * a boolean + * [computed property](/extensibility/advanced-metrics#computed-properties). If + * null, usage queries will not include any additional filter. + */ + filter?: string | null; + + /** + * A list of fixed fee quantity transitions to use for this price interval. Note + * that this list will overwrite all existing fixed fee quantity transitions on the + * price interval. + */ + fixed_fee_quantity_transitions?: Array | null; + + /** + * The updated start date of this price interval. If not specified, the start date + * will not be updated. + */ + start_date?: (string & {}) | Shared.BillingCycleRelativeDate; + + /** + * A list of customer IDs whose usage events will be aggregated and billed under + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. + */ + usage_customer_ids?: Array | null; + } + + export namespace Edit { + export interface FixedFeeQuantityTransition { + /** + * The date that the fixed fee quantity transition should take effect. + */ + effective_date: string; + + /** + * The quantity of the fixed fee quantity transition. + */ + quantity: number; + } + } + + export interface EditAdjustment { + /** + * The id of the adjustment interval to edit. + */ + adjustment_interval_id: string; + + /** + * The updated end date of this adjustment interval. If not specified, the start + * date will not be updated. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + + /** + * The updated start date of this adjustment interval. If not specified, the start + * date will not be updated. + */ + start_date?: (string & {}) | Shared.BillingCycleRelativeDate; + } +} + +export interface SubscriptionSchedulePlanChangeParams { + change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; + + /** + * Additional adjustments to be added to the subscription. (Only available for + * accounts that have migrated off of legacy subscription overrides) + */ + add_adjustments?: Array | null; + + /** + * Additional prices to be added to the subscription. (Only available for accounts + * that have migrated off of legacy subscription overrides) + */ + add_prices?: Array | null; + + /** + * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be + * aligned with the plan change's effective date. + */ + align_billing_with_plan_change_date?: boolean | null; + + /** + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. If not specified, this + * defaults to the behavior configured for this customer. + */ + auto_collection?: boolean | null; + + /** + * Reset billing periods to be aligned with the plan change's effective date or + * start of the month. Defaults to `unchanged` which keeps subscription's existing + * billing cycle alignment. + */ + billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null; + + billing_cycle_anchor_configuration?: SubscriptionSchedulePlanChangeParams.BillingCycleAnchorConfiguration | null; + + /** + * The date that the plan change should take effect. This parameter can only be + * passed if the `change_option` is `requested_date`. If a date with no time is + * passed, the plan change will happen at midnight in the customer's timezone. + */ + change_date?: string | null; + + /** + * Redemption code to be used for this subscription. If the coupon cannot be found + * by its redemption code, or cannot be redeemed, an error response will be + * returned and the subscription creation or plan change will not be scheduled. + */ + coupon_redemption_code?: string | null; + + credits_overage_rate?: number | null; + + /** + * Determines the default memo on this subscription's invoices. Note that if this + * is not provided, it is determined by the plan configuration. + */ + default_invoice_memo?: string | null; + + /** + * The external_plan_id of the plan that the given subscription should be switched + * to. Note that either this property or `plan_id` must be specified. + */ + external_plan_id?: string | null; + + /** * An additional filter to apply to usage queries. This filter must be expressed as * a boolean * [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - filter?: string | null; + filter?: string | null; + + /** + * The phase of the plan to start with + */ + initial_phase_order?: number | null; + + /** + * When this subscription's accrued usage reaches this threshold, an invoice will + * be issued for the subscription. If not specified, invoices will only be issued + * at the end of the billing period. + */ + invoicing_threshold?: string | null; + + /** + * The net terms determines the difference between the invoice date and the issue + * date for the invoice. If you intend the invoice to be due on issue, set this + * to 0. If not provided, this defaults to the value specified in the plan. + */ + net_terms?: number | null; + + per_credit_overage_amount?: number | null; + + /** + * The plan that the given subscription should be switched to. Note that either + * this property or `external_plan_id` must be specified. + */ + plan_id?: string | null; + + /** + * Specifies which version of the plan to change to. If null, the default version + * will be used. + */ + plan_version_number?: number | null; + + /** + * Optionally provide a list of overrides for prices on the plan + */ + price_overrides?: Array | null; + + /** + * Plan adjustments to be removed from the subscription. (Only available for + * accounts that have migrated off of legacy subscription overrides) + */ + remove_adjustments?: Array | null; + + /** + * Plan prices to be removed from the subscription. (Only available for accounts + * that have migrated off of legacy subscription overrides) + */ + remove_prices?: Array | null; + + /** + * Plan adjustments to be replaced with additional adjustments on the subscription. + * (Only available for accounts that have migrated off of legacy subscription + * overrides) + */ + replace_adjustments?: Array | null; + + /** + * Plan prices to be replaced with additional prices on the subscription. (Only + * available for accounts that have migrated off of legacy subscription overrides) + */ + replace_prices?: Array | null; + + /** + * The duration of the trial period in days. If not provided, this defaults to the + * value specified in the plan. If `0` is provided, the trial on the plan will be + * skipped. + */ + trial_duration_days?: number | null; + + /** + * A list of customer IDs whose usage events will be aggregated and billed under + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. + */ + usage_customer_ids?: Array | null; +} + +export namespace SubscriptionSchedulePlanChangeParams { + export interface AddAdjustment { + /** + * The definition of a new adjustment to create and add to the subscription. + */ + adjustment: + | AddAdjustment.NewPercentageDiscount + | AddAdjustment.NewUsageDiscount + | AddAdjustment.NewAmountDiscount + | AddAdjustment.NewMinimum + | AddAdjustment.NewMaximum; + + /** + * The end date of the adjustment interval. This is the date that the adjustment + * will stop affecting prices on the subscription. + */ + end_date?: string | null; + + /** + * The phase to add this adjustment to. + */ + plan_phase_order?: number | null; + + /** + * The start date of the adjustment interval. This is the date that the adjustment + * will start affecting prices on the subscription. If null, the adjustment will + * start when the phase or subscription starts. + */ + start_date?: string | null; + } + + export namespace AddAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + percentage_discount: number; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + usage_discount: number; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewAmountDiscount { + adjustment_type: 'amount_discount'; + + amount_discount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + maximum_amount: string; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + } + + export interface AddPrice { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: AddPrice.AllocationPrice | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for this price. + */ + discounts?: Array | null; + + /** + * The end date of the price interval. This is the date that the price will stop + * billing on the subscription. If null, billing will end when the phase or + * subscription ends. + */ + end_date?: string | null; + + /** + * The external price id of the price to add to the subscription. + */ + external_price_id?: string | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for this price. + */ + maximum_amount?: string | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for this price. + */ + minimum_amount?: string | null; + + /** + * The phase to add this price to. + */ + plan_phase_order?: number | null; + + /** + * The definition of a new price to create and add to the subscription. + */ + price?: + | AddPrice.NewSubscriptionUnitPrice + | AddPrice.NewSubscriptionPackagePrice + | AddPrice.NewSubscriptionMatrixPrice + | AddPrice.NewSubscriptionTieredPrice + | AddPrice.NewSubscriptionTieredBpsPrice + | AddPrice.NewSubscriptionBpsPrice + | AddPrice.NewSubscriptionBulkBpsPrice + | AddPrice.NewSubscriptionBulkPrice + | AddPrice.NewSubscriptionThresholdTotalAmountPrice + | AddPrice.NewSubscriptionTieredPackagePrice + | AddPrice.NewSubscriptionTieredWithMinimumPrice + | AddPrice.NewSubscriptionUnitWithPercentPrice + | AddPrice.NewSubscriptionPackageWithAllocationPrice + | AddPrice.NewSubscriptionTierWithProrationPrice + | AddPrice.NewSubscriptionUnitWithProrationPrice + | AddPrice.NewSubscriptionGroupedAllocationPrice + | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice + | AddPrice.NewSubscriptionBulkWithProrationPrice + | AddPrice.NewSubscriptionScalableMatrixWithUnitPricingPrice + | AddPrice.NewSubscriptionScalableMatrixWithTieredPricingPrice + | AddPrice.NewSubscriptionCumulativeGroupedBulkPrice + | AddPrice.NewSubscriptionMaxGroupTieredPackagePrice + | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice + | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice + | AddPrice.NewSubscriptionGroupedTieredPackagePrice + | null; + + /** + * The id of the price to add to the subscription. + */ + price_id?: string | null; + + /** + * The start date of the price interval. This is the date that the price will start + * billing on the subscription. If null, billing will start when the phase or + * subscription starts. + */ + start_date?: string | null; + } + + export namespace AddPrice { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + export interface AllocationPrice { + /** + * An amount of the currency to allocate to the customer at the specified cadence. + */ + amount: string; + + /** + * The cadence at which to allocate the amount to the customer. + */ + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + /** + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. + */ + currency: string; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. + */ + expires_at_end_of_cadence: boolean; + } + + export interface Discount { + discount_type: 'percentage' | 'usage' | 'amount'; + + /** + * Only available if discount_type is `amount`. + */ + amount_discount?: string | null; + + /** + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. + */ + percentage_discount?: number | null; + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for + */ + usage_discount?: number | null; + } + + export interface NewSubscriptionUnitPrice { + /** + * 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: 'unit'; + + /** + * The name of the price. + */ + name: string; + + unit_config: NewSubscriptionUnitPrice.UnitConfig; + + /** + * 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?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionUnitPrice { + export interface UnitConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionPackagePrice { + /** + * 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: 'package'; + + /** + * The name of the price. + */ + name: string; + + package_config: NewSubscriptionPackagePrice.PackageConfig; + + /** + * 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?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionPackagePrice { + export interface PackageConfig { + /** + * A currency amount to rate usage by + */ + package_amount: string; + + /** + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating + */ + package_size: number; + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionMatrixPrice { + /** + * 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; + + matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; + + model_type: 'matrix'; + + /** + * 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?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionMatrixPrice { + export interface MatrixConfig { + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } + + export namespace MatrixConfig { + 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; + } + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionTieredPrice { + /** + * 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'; + + /** + * The name of the price. + */ + name: string; + + tiered_config: NewSubscriptionTieredPrice.TieredConfig; + + /** + * 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?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Inclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Exclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; + } + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionTieredBpsPrice { + /** + * 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_bps'; + + /** + * The name of the price. + */ + name: string; + + tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; + + /** + * 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?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionTieredBpsPrice { + export interface TieredBpsConfig { + /** + * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + * tiers + */ + tiers: Array; + } + + export namespace TieredBpsConfig { + export interface Tier { + /** + * Per-event basis point rate + */ + bps: number; + + /** + * Inclusive tier starting value + */ + minimum_amount: string; + + /** + * Exclusive tier ending value + */ + maximum_amount?: string | null; + + /** + * Per unit maximum to charge + */ + per_unit_maximum?: string | null; + } + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionBpsPrice { + bps_config: NewSubscriptionBpsPrice.BpsConfig; + + /** + * 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: 'bps'; + + /** + * 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?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionBpsPrice { + export interface BpsConfig { + /** + * Basis point take rate per event + */ + bps: number; + + /** + * Optional currency amount maximum to cap spend per event + */ + per_unit_maximum?: string | null; + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionBulkBpsPrice { + bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; + + /** + * 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: 'bulk_bps'; + + /** + * 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?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionBulkBpsPrice { + export interface BulkBpsConfig { + /** + * Tiers for a bulk BPS pricing model where all usage is aggregated to a single + * tier based on total volume + */ + tiers: Array; + } + + export namespace BulkBpsConfig { + export interface Tier { + /** + * Basis points to rate on + */ + bps: number; + + /** + * Upper bound for tier + */ + maximum_amount?: string | null; + + /** + * The maximum amount to charge for any one event + */ + per_unit_maximum?: string | null; + } + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionBulkPrice { + bulk_config: NewSubscriptionBulkPrice.BulkConfig; + + /** + * 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: 'bulk'; + + /** + * 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?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionBulkPrice { + export interface BulkConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkConfig { + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Upper bound for this tier + */ + maximum_units?: number | null; + } + } + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionThresholdTotalAmountPrice { + /** + * 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: 'threshold_total_amount'; + + /** + * The name of the price. + */ + name: string; + + threshold_total_amount_config: Record; + + /** + * 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?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionThresholdTotalAmountPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionTieredPackagePrice { + /** + * 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_package'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_config: Record; + + /** + * 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?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionTieredPackagePrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionTieredWithMinimumPrice { + /** + * 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: Record; + + /** + * 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?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionTieredWithMinimumPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionUnitWithPercentPrice { + /** + * 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: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + unit_with_percent_config: Record; + + /** + * 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?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The phase of the plan to start with - */ - initial_phase_order?: number | null; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * When this subscription's accrued usage reaches this threshold, an invoice will - * be issued for the subscription. If not specified, invoices will only be issued - * at the end of the billing period. - */ - invoicing_threshold?: string | null; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. If not provided, this defaults to the value specified in the plan. - */ - net_terms?: number | null; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - per_credit_overage_amount?: number | 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?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; - /** - * The plan that the given subscription should be switched to. Note that either - * this property or `external_plan_id` must be specified. - */ - plan_id?: string | null; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * Specifies which version of the plan to change to. If null, the default version - * will be used. - */ - plan_version_number?: number | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; + } - /** - * Optionally provide a list of overrides for prices on the plan - */ - price_overrides?: Array | null; + export namespace NewSubscriptionUnitWithPercentPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Plan adjustments to be removed from the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - remove_adjustments?: Array | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } - /** - * Plan prices to be removed from the subscription. (Only available for accounts - * that have migrated off of legacy subscription overrides) - */ - remove_prices?: Array | null; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Plan adjustments to be replaced with additional adjustments on the subscription. - * (Only available for accounts that have migrated off of legacy subscription - * overrides) - */ - replace_adjustments?: Array | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } - /** - * Plan prices to be replaced with additional prices on the subscription. (Only - * available for accounts that have migrated off of legacy subscription overrides) - */ - replace_prices?: Array | null; + export interface NewSubscriptionPackageWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The duration of the trial period in days. If not provided, this defaults to the - * value specified in the plan. If `0` is provided, the trial on the plan will be - * skipped. - */ - trial_duration_days?: number | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; -} + model_type: 'package_with_allocation'; -export namespace SubscriptionSchedulePlanChangeParams { - export interface AddAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; + /** + * The name of the price. + */ + name: string; - /** - * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. - */ - end_date?: string | null; + package_with_allocation_config: Record; - /** - * The phase to add this adjustment to. - */ - plan_phase_order?: number | null; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * The start date of the adjustment interval. This is the date that the adjustment - * will start affecting prices on the subscription. If null, the adjustment will - * start when the phase or subscription starts. - */ - start_date?: 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; - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; /** - * The set of price IDs to which this adjustment applies. + * The per unit conversion rate of the price currency to the invoicing currency. */ - applies_to_price_ids: Array; + conversion_rate?: number | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | 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?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionPackageWithAllocationPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - percentage_discount: number; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + export interface NewSubscriptionTierWithProrationPrice { /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * The cadence to bill for this price on. */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * The set of price IDs to which this adjustment applies. + * The id of the item the price will be associated with. */ - applies_to_price_ids: Array; + item_id: string; - usage_discount: number; + model_type: 'tiered_with_proration'; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * The name of the price. */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; + name: string; - amount_discount: string; + tiered_with_proration_config: Record; /** - * The set of price IDs to which this adjustment applies. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - applies_to_price_ids: Array; + billable_metric_id?: string | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * 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. */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; + billed_in_advance?: boolean | null; /** - * The set of price IDs to which this adjustment applies. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - applies_to_price_ids: Array; + billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; /** - * The item ID that revenue from this minimum will be attributed to. + * The per unit conversion rate of the price currency to the invoicing currency. */ - item_id: string; - - minimum_amount: string; + conversion_rate?: number | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; + currency?: string | null; /** - * The set of price IDs to which this adjustment applies. + * An alias for the price. */ - applies_to_price_ids: Array; - - maximum_amount: string; + external_price_id?: string | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - is_invoice_level?: boolean; - } - } - - export interface AddPrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: AddPrice.AllocationPrice | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for this price. - */ - discounts?: Array | null; - - /** - * The end date of the price interval. This is the date that the price will stop - * billing on the subscription. If null, billing will end when the phase or - * subscription ends. - */ - end_date?: string | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for this price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for this price. - */ - minimum_amount?: string | null; - - /** - * The phase to add this price to. - */ - plan_phase_order?: number | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | AddPrice.NewSubscriptionUnitPrice - | AddPrice.NewSubscriptionPackagePrice - | AddPrice.NewSubscriptionMatrixPrice - | AddPrice.NewSubscriptionTieredPrice - | AddPrice.NewSubscriptionTieredBpsPrice - | AddPrice.NewSubscriptionBpsPrice - | AddPrice.NewSubscriptionBulkBpsPrice - | AddPrice.NewSubscriptionBulkPrice - | AddPrice.NewSubscriptionThresholdTotalAmountPrice - | AddPrice.NewSubscriptionTieredPackagePrice - | AddPrice.NewSubscriptionTieredWithMinimumPrice - | AddPrice.NewSubscriptionUnitWithPercentPrice - | AddPrice.NewSubscriptionPackageWithAllocationPrice - | AddPrice.NewSubscriptionTierWithProrationPrice - | AddPrice.NewSubscriptionUnitWithProrationPrice - | AddPrice.NewSubscriptionGroupedAllocationPrice - | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice - | AddPrice.NewSubscriptionBulkWithProrationPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - - /** - * The start date of the price interval. This is the date that the price will start - * billing on the subscription. If null, billing will start when the phase or - * subscription starts. - */ - start_date?: string | null; - } + fixed_price_quantity?: number | null; - export namespace AddPrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { /** - * An amount of the currency to allocate to the customer at the specified cadence. + * The property used to group this price on an invoice */ - amount: string; + invoice_grouping_key?: string | null; /** - * The cadence at which to allocate the amount to the customer. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. + * 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`. */ - currency: string; + metadata?: Record | null; /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - expires_at_end_of_cadence: boolean; + reference_id?: string | null; } - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; - + export namespace NewSubscriptionTierWithProrationPrice { /** - * Only available if discount_type is `amount`. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - amount_discount?: string | null; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount?: number | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - usage_discount?: number | null; + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewSubscriptionUnitPrice { + export interface NewSubscriptionUnitWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -17629,14 +21153,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit'; + model_type: 'unit_with_proration'; /** * The name of the price. */ name: string; - unit_config: NewSubscriptionUnitPrice.UnitConfig; + unit_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -17654,7 +21178,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -17687,7 +21211,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17697,20 +21221,13 @@ export namespace SubscriptionSchedulePlanChangeParams { metadata?: Record | 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 NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } + * 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 NewSubscriptionUnitWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -17744,26 +21261,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackagePrice { + export interface NewSubscriptionGroupedAllocationPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + grouped_allocation_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'package'; + model_type: 'grouped_allocation'; /** * The name of the price. */ name: string; - package_config: NewSubscriptionPackagePrice.PackageConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -17780,7 +21297,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -17813,7 +21330,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17829,20 +21346,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - + export namespace NewSubscriptionGroupedAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -17876,20 +21380,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMatrixPrice { + 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: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; + model_type: 'grouped_with_prorated_minimum'; /** * The name of the price. @@ -17912,7 +21416,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -17945,7 +21449,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17961,40 +21465,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - 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 namespace NewSubscriptionGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18028,7 +21499,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPrice { + export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; + /** * The cadence to bill for this price on. */ @@ -18039,15 +21512,13 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered'; + model_type: 'bulk_with_proration'; /** * The name of the price. */ name: string; - tiered_config: NewSubscriptionTieredPrice.TieredConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -18064,7 +21535,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18097,7 +21568,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18113,33 +21584,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Inclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Exclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - + export namespace NewSubscriptionBulkWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18173,7 +21618,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredBpsPrice { + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * The cadence to bill for this price on. */ @@ -18184,14 +21629,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_bps'; + model_type: 'scalable_matrix_with_unit_pricing'; /** * The name of the price. */ name: string; - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; + scalable_matrix_with_unit_pricing_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -18209,7 +21654,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18242,7 +21687,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18258,39 +21703,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Inclusive tier starting value - */ - minimum_amount: string; - - /** - * Exclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - + export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18324,9 +21737,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * The cadence to bill for this price on. */ @@ -18337,13 +21748,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bps'; + model_type: 'scalable_matrix_with_tiered_pricing'; /** * The name of the price. */ name: string; + scalable_matrix_with_tiered_pricing_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -18360,7 +21773,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18393,7 +21806,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18409,19 +21822,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - + export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18455,20 +21856,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - + export interface NewSubscriptionCumulativeGroupedBulkPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + cumulative_grouped_bulk_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'bulk_bps'; + model_type: 'cumulative_grouped_bulk'; /** * The name of the price. @@ -18491,7 +21892,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18524,7 +21925,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18540,34 +21941,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - + export namespace NewSubscriptionCumulativeGroupedBulkPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18601,9 +21975,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - + export interface NewSubscriptionMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -18614,7 +21986,9 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bulk'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * The name of the price. @@ -18637,7 +22011,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18670,44 +22044,23 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | 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?: Record | 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 NewSubscriptionBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } + invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_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?: Record | null; - /** - * Upper bound for this tier - */ - maximum_units?: number | 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 NewSubscriptionMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18741,26 +22094,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionThresholdTotalAmountPrice { + 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: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'threshold_total_amount'; + model_type: 'grouped_with_metered_minimum'; /** * The name of the price. */ name: string; - threshold_total_amount_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -18777,7 +22130,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18810,7 +22163,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18826,7 +22179,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionThresholdTotalAmountPrice { + export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18860,7 +22213,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPackagePrice { + export interface NewSubscriptionMatrixWithDisplayNamePrice { /** * The cadence to bill for this price on. */ @@ -18871,15 +22224,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_package'; + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; /** * The name of the price. */ name: string; - tiered_package_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -18896,7 +22249,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18929,7 +22282,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18945,7 +22298,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPackagePrice { + export namespace NewSubscriptionMatrixWithDisplayNamePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18979,26 +22332,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredWithMinimumPrice { + export interface NewSubscriptionGroupedTieredPackagePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + grouped_tiered_package_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'tiered_with_minimum'; + model_type: 'grouped_tiered_package'; /** * The name of the price. */ name: string; - tiered_with_minimum_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -19015,7 +22368,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19048,7 +22401,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19064,7 +22417,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithMinimumPrice { + export namespace NewSubscriptionGroupedTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19097,127 +22450,285 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } } + } + + export interface BillingCycleAnchorConfiguration { + /** + * The day of the month on which the billing cycle is anchored. If the maximum + * number of days in a month is greater than this value, the last day of the month + * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + * period begins on the 30th. + */ + day: number; + + /** + * The month on which the billing cycle is anchored (e.g. a quarterly price + * anchored in February would have cycles starting February, May, August, and + * November). + */ + month?: number | null; + + /** + * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + */ + year?: number | null; + } + + export interface RemoveAdjustment { + /** + * The id of the adjustment to remove on the subscription. + */ + adjustment_id: string; + } + + export interface RemovePrice { + /** + * The external price id of the price to remove on the subscription. + */ + external_price_id?: string | null; + + /** + * The id of the price to remove on the subscription. + */ + price_id?: string | null; + } + + export interface ReplaceAdjustment { + /** + * The definition of a new adjustment to create and add to the subscription. + */ + adjustment: + | ReplaceAdjustment.NewPercentageDiscount + | ReplaceAdjustment.NewUsageDiscount + | ReplaceAdjustment.NewAmountDiscount + | ReplaceAdjustment.NewMinimum + | ReplaceAdjustment.NewMaximum; + + /** + * The id of the adjustment on the plan to replace in the subscription. + */ + replaces_adjustment_id: string; + } + + export namespace ReplaceAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; - export interface NewSubscriptionUnitWithPercentPrice { /** - * The cadence to bill for this price on. + * The set of price IDs to which this adjustment applies. */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + applies_to_price_ids: Array; + + percentage_discount: number; /** - * The id of the item the price will be associated with. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - item_id: string; + is_invoice_level?: boolean; + } - model_type: 'unit_with_percent'; + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; /** - * The name of the price. + * The set of price IDs to which this adjustment applies. */ - name: string; + applies_to_price_ids: Array; - unit_with_percent_config: Record; + usage_discount: number; /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - billable_metric_id?: string | null; + is_invoice_level?: boolean; + } + + export interface NewAmountDiscount { + adjustment_type: 'amount_discount'; + + amount_discount: string; /** - * 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. + * The set of price IDs to which this adjustment applies. */ - billed_in_advance?: boolean | null; + applies_to_price_ids: Array; /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; /** - * The per unit conversion rate of the price currency to the invoicing currency. + * The set of price IDs to which this adjustment applies. */ - conversion_rate?: number | null; + applies_to_price_ids: Array; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids: Array; + + maximum_amount: string; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + } + } + + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the subscription. + */ + replaces_price_id: string; + + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: ReplacePrice.AllocationPrice | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for the replacement price. + */ + discounts?: Array | null; + + /** + * The external price id of the price to add to the subscription. + */ + external_price_id?: string | null; + + /** + * The new quantity of the price, if the price is a fixed price. + */ + fixed_price_quantity?: number | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for the replacement price. + */ + maximum_amount?: string | null; + + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for the replacement price. + */ + minimum_amount?: string | null; + + /** + * The definition of a new price to create and add to the subscription. + */ + price?: + | ReplacePrice.NewSubscriptionUnitPrice + | ReplacePrice.NewSubscriptionPackagePrice + | ReplacePrice.NewSubscriptionMatrixPrice + | ReplacePrice.NewSubscriptionTieredPrice + | ReplacePrice.NewSubscriptionTieredBpsPrice + | ReplacePrice.NewSubscriptionBpsPrice + | ReplacePrice.NewSubscriptionBulkBpsPrice + | ReplacePrice.NewSubscriptionBulkPrice + | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice + | ReplacePrice.NewSubscriptionTieredPackagePrice + | ReplacePrice.NewSubscriptionTieredWithMinimumPrice + | ReplacePrice.NewSubscriptionUnitWithPercentPrice + | ReplacePrice.NewSubscriptionPackageWithAllocationPrice + | ReplacePrice.NewSubscriptionTierWithProrationPrice + | ReplacePrice.NewSubscriptionUnitWithProrationPrice + | ReplacePrice.NewSubscriptionGroupedAllocationPrice + | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice + | ReplacePrice.NewSubscriptionBulkWithProrationPrice + | ReplacePrice.NewSubscriptionScalableMatrixWithUnitPricingPrice + | ReplacePrice.NewSubscriptionScalableMatrixWithTieredPricingPrice + | ReplacePrice.NewSubscriptionCumulativeGroupedBulkPrice + | ReplacePrice.NewSubscriptionMaxGroupTieredPackagePrice + | ReplacePrice.NewSubscriptionGroupedWithMeteredMinimumPrice + | ReplacePrice.NewSubscriptionMatrixWithDisplayNamePrice + | ReplacePrice.NewSubscriptionGroupedTieredPackagePrice + | null; - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; + /** + * The id of the price to add to the subscription. + */ + price_id?: string | null; + } + export namespace ReplacePrice { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + export interface AllocationPrice { /** - * An alias for the price. + * An amount of the currency to allocate to the customer at the specified cadence. */ - external_price_id?: string | null; + amount: string; /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. + * The cadence at which to allocate the amount to the customer. */ - fixed_price_quantity?: number | null; + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; /** - * The property used to group this price on an invoice + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. */ - invoice_grouping_key?: string | null; + currency: string; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; + expires_at_end_of_cadence: boolean; + } - /** - * 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?: Record | null; + export interface Discount { + discount_type: 'percentage' | 'usage' | 'amount'; /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. + * Only available if discount_type is `amount`. */ - reference_id?: string | null; - } + amount_discount?: string | null; - export namespace NewSubscriptionUnitWithPercentPrice { /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + percentage_discount?: number | null; /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + usage_discount?: number | null; } - export interface NewSubscriptionPackageWithAllocationPrice { + export interface NewSubscriptionUnitPrice { /** * The cadence to bill for this price on. */ @@ -19228,14 +22739,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'package_with_allocation'; + model_type: 'unit'; /** * The name of the price. */ name: string; - package_with_allocation_config: Record; + unit_config: NewSubscriptionUnitPrice.UnitConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -19253,7 +22764,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19286,7 +22797,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19302,7 +22813,14 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionPackageWithAllocationPrice { + export namespace NewSubscriptionUnitPrice { + export interface UnitConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19336,7 +22854,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTierWithProrationPrice { + export interface NewSubscriptionPackagePrice { /** * The cadence to bill for this price on. */ @@ -19347,14 +22865,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_with_proration'; + model_type: 'package'; /** * The name of the price. */ name: string; - tiered_with_proration_config: Record; + package_config: NewSubscriptionPackagePrice.PackageConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -19372,7 +22890,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19405,7 +22923,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19421,7 +22939,20 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTierWithProrationPrice { + export namespace NewSubscriptionPackagePrice { + export interface PackageConfig { + /** + * A currency amount to rate usage by + */ + package_amount: string; + + /** + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating + */ + package_size: number; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19455,7 +22986,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithProrationPrice { + export interface NewSubscriptionMatrixPrice { /** * The cadence to bill for this price on. */ @@ -19466,15 +22997,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit_with_proration'; + matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; + + model_type: 'matrix'; /** * The name of the price. */ name: string; - unit_with_proration_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -19491,7 +23022,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19524,7 +23055,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19540,7 +23071,40 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithProrationPrice { + export namespace NewSubscriptionMatrixPrice { + export interface MatrixConfig { + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } + + export namespace MatrixConfig { + 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; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19574,26 +23138,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedAllocationPrice { + export interface NewSubscriptionTieredPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_allocation_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_allocation'; + model_type: 'tiered'; /** * The name of the price. */ name: string; + tiered_config: NewSubscriptionTieredPrice.TieredConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -19610,7 +23174,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19643,7 +23207,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19659,7 +23223,33 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedAllocationPrice { + export namespace NewSubscriptionTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Inclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Exclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; + } + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19693,26 +23283,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedWithProratedMinimumPrice { + export interface NewSubscriptionTieredBpsPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_prorated_minimum_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_with_prorated_minimum'; + model_type: 'tiered_bps'; /** * The name of the price. */ name: string; + tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -19729,7 +23319,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19762,7 +23352,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19771,14 +23361,46 @@ export namespace SubscriptionSchedulePlanChangeParams { */ metadata?: Record | null; - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | 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 NewSubscriptionTieredBpsPrice { + export interface TieredBpsConfig { + /** + * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + * tiers + */ + tiers: Array; + } + + export namespace TieredBpsConfig { + export interface Tier { + /** + * Per-event basis point rate + */ + bps: number; + + /** + * Inclusive tier starting value + */ + minimum_amount: string; + + /** + * Exclusive tier ending value + */ + maximum_amount?: string | null; + + /** + * Per unit maximum to charge + */ + per_unit_maximum?: string | null; + } + } - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19812,8 +23434,8 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; + export interface NewSubscriptionBpsPrice { + bps_config: NewSubscriptionBpsPrice.BpsConfig; /** * The cadence to bill for this price on. @@ -19825,7 +23447,7 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bulk_with_proration'; + model_type: 'bps'; /** * The name of the price. @@ -19848,7 +23470,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -19881,7 +23503,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19897,7 +23519,19 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkWithProrationPrice { + export namespace NewSubscriptionBpsPrice { + export interface BpsConfig { + /** + * Basis point take rate per event + */ + bps: number; + + /** + * Optional currency amount maximum to cap spend per event + */ + per_unit_maximum?: string | null; + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19930,278 +23564,156 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove on the subscription. - */ - adjustment_id: string; - } - - export interface RemovePrice { - /** - * The external price id of the price to remove on the subscription. - */ - external_price_id?: string | null; - - /** - * The id of the price to remove on the subscription. - */ - price_id?: string | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | ReplaceAdjustment.NewPercentageDiscount - | ReplaceAdjustment.NewUsageDiscount - | ReplaceAdjustment.NewAmountDiscount - | ReplaceAdjustment.NewMinimum - | ReplaceAdjustment.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the subscription. - */ - replaces_adjustment_id: string; - } - - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids: Array; - - percentage_discount: number; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids: Array; - - usage_discount: number; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - amount_discount: string; + export interface NewSubscriptionBulkBpsPrice { + bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; /** - * The set of price IDs to which this adjustment applies. + * The cadence to bill for this price on. */ - applies_to_price_ids: Array; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * The id of the item the price will be associated with. */ - is_invoice_level?: boolean; - } + item_id: string; - export interface NewMinimum { - adjustment_type: 'minimum'; + model_type: 'bulk_bps'; /** - * The set of price IDs to which this adjustment applies. + * The name of the price. */ - applies_to_price_ids: Array; + name: string; /** - * The item ID that revenue from this minimum will be attributed to. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - item_id: string; - - minimum_amount: string; + billable_metric_id?: string | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * 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. */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; + billed_in_advance?: boolean | null; /** - * The set of price IDs to which this adjustment applies. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - applies_to_price_ids: Array; - - maximum_amount: string; + billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. + * The per unit conversion rate of the price currency to the invoicing currency. */ - is_invoice_level?: boolean; - } - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the subscription. - */ - replaces_price_id: string; - - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: ReplacePrice.AllocationPrice | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for the replacement price. - */ - discounts?: Array | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * The new quantity of the price, if the price is a fixed price. - */ - fixed_price_quantity?: number | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for the replacement price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for the replacement price. - */ - minimum_amount?: string | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | ReplacePrice.NewSubscriptionUnitPrice - | ReplacePrice.NewSubscriptionPackagePrice - | ReplacePrice.NewSubscriptionMatrixPrice - | ReplacePrice.NewSubscriptionTieredPrice - | ReplacePrice.NewSubscriptionTieredBpsPrice - | ReplacePrice.NewSubscriptionBpsPrice - | ReplacePrice.NewSubscriptionBulkBpsPrice - | ReplacePrice.NewSubscriptionBulkPrice - | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice - | ReplacePrice.NewSubscriptionTieredPackagePrice - | ReplacePrice.NewSubscriptionTieredWithMinimumPrice - | ReplacePrice.NewSubscriptionUnitWithPercentPrice - | ReplacePrice.NewSubscriptionPackageWithAllocationPrice - | ReplacePrice.NewSubscriptionTierWithProrationPrice - | ReplacePrice.NewSubscriptionUnitWithProrationPrice - | ReplacePrice.NewSubscriptionGroupedAllocationPrice - | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice - | ReplacePrice.NewSubscriptionBulkWithProrationPrice - | null; + conversion_rate?: number | null; - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace ReplacePrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { /** - * An amount of the currency to allocate to the customer at the specified cadence. + * An alias for the price. */ - amount: string; + external_price_id?: string | null; /** - * The cadence at which to allocate the amount to the customer. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + fixed_price_quantity?: number | null; /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. + * The property used to group this price on an invoice */ - currency: string; + invoice_grouping_key?: string | null; /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - expires_at_end_of_cadence: boolean; - } + invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; + /** + * 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?: Record | null; /** - * Only available if discount_type is `amount`. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - amount_discount?: string | null; + reference_id?: string | null; + } + + export namespace NewSubscriptionBulkBpsPrice { + export interface BulkBpsConfig { + /** + * Tiers for a bulk BPS pricing model where all usage is aggregated to a single + * tier based on total volume + */ + tiers: Array; + } + + export namespace BulkBpsConfig { + export interface Tier { + /** + * Basis points to rate on + */ + bps: number; + + /** + * Upper bound for tier + */ + maximum_amount?: string | null; + + /** + * The maximum amount to charge for any one event + */ + per_unit_maximum?: string | null; + } + } /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - percentage_discount?: number | null; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - usage_discount?: number | null; + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewSubscriptionUnitPrice { + export interface NewSubscriptionBulkPrice { + bulk_config: NewSubscriptionBulkPrice.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -20212,15 +23724,13 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit'; + model_type: 'bulk'; /** * The name of the price. */ name: string; - unit_config: NewSubscriptionUnitPrice.UnitConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -20237,7 +23747,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20270,7 +23780,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20286,12 +23796,26 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { + export namespace NewSubscriptionBulkPrice { + export interface BulkConfig { /** - * Rate per unit of usage + * Bulk tiers for rating based on total usage volume */ - unit_amount: string; + tiers: Array; + } + + export namespace BulkConfig { + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Upper bound for this tier + */ + maximum_units?: number | null; + } } /** @@ -20327,7 +23851,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackagePrice { + export interface NewSubscriptionThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ @@ -20338,14 +23862,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'package'; + model_type: 'threshold_total_amount'; /** * The name of the price. */ name: string; - package_config: NewSubscriptionPackagePrice.PackageConfig; + threshold_total_amount_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -20363,7 +23887,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20396,7 +23920,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20412,20 +23936,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - + export namespace NewSubscriptionThresholdTotalAmountPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -20459,7 +23970,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMatrixPrice { + export interface NewSubscriptionTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -20470,15 +23981,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; + model_type: 'tiered_package'; /** * The name of the price. */ name: string; + tiered_package_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -20495,7 +24006,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20528,7 +24039,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20544,40 +24055,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - 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 namespace NewSubscriptionTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -20611,7 +24089,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPrice { + export interface NewSubscriptionTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -20622,14 +24100,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered'; + model_type: 'tiered_with_minimum'; /** * The name of the price. */ name: string; - tiered_config: NewSubscriptionTieredPrice.TieredConfig; + tiered_with_minimum_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -20647,7 +24125,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20680,7 +24158,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20692,37 +24170,11 @@ export namespace SubscriptionSchedulePlanChangeParams { /** * 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 NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Inclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Exclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } + */ + reference_id?: string | null; + } + export namespace NewSubscriptionTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -20756,7 +24208,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredBpsPrice { + export interface NewSubscriptionUnitWithPercentPrice { /** * The cadence to bill for this price on. */ @@ -20767,14 +24219,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_bps'; + model_type: 'unit_with_percent'; /** * The name of the price. */ name: string; - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; + unit_with_percent_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -20792,7 +24244,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20825,7 +24277,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20841,39 +24293,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Inclusive tier starting value - */ - minimum_amount: string; - - /** - * Exclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - + export namespace NewSubscriptionUnitWithPercentPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -20907,9 +24327,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - + export interface NewSubscriptionPackageWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -20920,13 +24338,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bps'; + model_type: 'package_with_allocation'; /** * The name of the price. */ name: string; + package_with_allocation_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -20943,7 +24363,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20976,7 +24396,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20992,19 +24412,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - + export namespace NewSubscriptionPackageWithAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21038,9 +24446,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - + export interface NewSubscriptionTierWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -21051,13 +24457,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bulk_bps'; + model_type: 'tiered_with_proration'; /** * The name of the price. */ name: string; + tiered_with_proration_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21074,7 +24482,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21107,7 +24515,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21123,34 +24531,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - + export namespace NewSubscriptionTierWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21184,9 +24565,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - + export interface NewSubscriptionUnitWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -21197,13 +24576,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bulk'; + model_type: 'unit_with_proration'; /** * The name of the price. */ name: string; + unit_with_proration_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21220,7 +24601,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21253,7 +24634,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21269,28 +24650,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - + export namespace NewSubscriptionUnitWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21324,26 +24684,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionThresholdTotalAmountPrice { + export interface NewSubscriptionGroupedAllocationPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + grouped_allocation_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'threshold_total_amount'; + model_type: 'grouped_allocation'; /** * The name of the price. */ name: string; - threshold_total_amount_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21360,7 +24720,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21393,7 +24753,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21409,7 +24769,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionThresholdTotalAmountPrice { + export namespace NewSubscriptionGroupedAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21443,26 +24803,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPackagePrice { + 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: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'tiered_package'; + model_type: 'grouped_with_prorated_minimum'; /** * The name of the price. */ name: string; - tiered_package_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21479,7 +24839,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21512,7 +24872,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21528,7 +24888,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPackagePrice { + export namespace NewSubscriptionGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21562,7 +24922,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredWithMinimumPrice { + export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; + /** * The cadence to bill for this price on. */ @@ -21573,15 +24935,13 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_with_minimum'; + model_type: 'bulk_with_proration'; /** * The name of the price. */ name: string; - tiered_with_minimum_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21598,7 +24958,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21631,7 +24991,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21647,7 +25007,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithMinimumPrice { + export namespace NewSubscriptionBulkWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21681,7 +25041,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithPercentPrice { + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * The cadence to bill for this price on. */ @@ -21692,14 +25052,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit_with_percent'; + model_type: 'scalable_matrix_with_unit_pricing'; /** * The name of the price. */ name: string; - unit_with_percent_config: Record; + scalable_matrix_with_unit_pricing_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -21717,7 +25077,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21750,7 +25110,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21766,7 +25126,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithPercentPrice { + export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21800,7 +25160,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackageWithAllocationPrice { + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * The cadence to bill for this price on. */ @@ -21811,14 +25171,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'package_with_allocation'; + model_type: 'scalable_matrix_with_tiered_pricing'; /** * The name of the price. */ name: string; - package_with_allocation_config: Record; + scalable_matrix_with_tiered_pricing_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -21836,7 +25196,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21869,7 +25229,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21885,7 +25245,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionPackageWithAllocationPrice { + export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -21919,26 +25279,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTierWithProrationPrice { + export interface NewSubscriptionCumulativeGroupedBulkPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + cumulative_grouped_bulk_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'tiered_with_proration'; + model_type: 'cumulative_grouped_bulk'; /** * The name of the price. */ name: string; - tiered_with_proration_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21955,7 +25315,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -21988,7 +25348,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22004,7 +25364,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTierWithProrationPrice { + export namespace NewSubscriptionCumulativeGroupedBulkPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -22038,7 +25398,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithProrationPrice { + export interface NewSubscriptionMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -22049,15 +25409,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit_with_proration'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * The name of the price. */ name: string; - unit_with_proration_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -22074,7 +25434,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22107,7 +25467,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22123,7 +25483,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithProrationPrice { + export namespace NewSubscriptionMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -22157,20 +25517,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedAllocationPrice { + export interface NewSubscriptionGroupedWithMeteredMinimumPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_allocation_config: Record; + grouped_with_metered_minimum_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_allocation'; + model_type: 'grouped_with_metered_minimum'; /** * The name of the price. @@ -22193,7 +25553,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22226,7 +25586,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22242,7 +25602,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedAllocationPrice { + export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -22276,20 +25636,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedWithProratedMinimumPrice { + export interface NewSubscriptionMatrixWithDisplayNamePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_prorated_minimum_config: Record; - /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_with_prorated_minimum'; + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; /** * The name of the price. @@ -22312,7 +25672,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22345,7 +25705,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22361,7 +25721,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { + export namespace NewSubscriptionMatrixWithDisplayNamePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -22395,20 +25755,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - + export interface NewSubscriptionGroupedTieredPackagePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + grouped_tiered_package_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'bulk_with_proration'; + model_type: 'grouped_tiered_package'; /** * The name of the price. @@ -22431,7 +25791,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22464,7 +25824,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * 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?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22480,7 +25840,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkWithProrationPrice { + export namespace NewSubscriptionGroupedTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. diff --git a/src/version.ts b/src/version.ts index ebc183c4..db5c3bcf 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.64.0'; // x-release-please-version +export const VERSION = '4.65.0'; // x-release-please-version diff --git a/yarn.lock b/yarn.lock index efd2a961..3c8278a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1183,13 +1183,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - braces@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"