diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ce4dacbf..d3e84862 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.72.3" + ".": "4.73.0" } diff --git a/.stats.yml b/.stats.yml index c71a786b..605226f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e8dad7eee5621fe2ba948dfd00dabf170d9d92ce615a9f04b0f546f4d8bf39ba.yml -openapi_spec_hash: 3f6a98e3a1b3a47acebd67a960090ebf -config_hash: f6da12790e8f46d93592def474d41c69 +configured_endpoints: 114 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6d2a5b5d2cfb485e1a548aa15e1e36844e1f14f42553033822e1c570c8aa0825.yml +openapi_spec_hash: 0266a5aaced5e768bcf6a70924d69799 +config_hash: e63f2d098e5d12f63ae4cd8270aa5c3c diff --git a/CHANGELOG.md b/CHANGELOG.md index e9f70403..13462250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 4.73.0 (2025-05-28) + +Full Changelog: [v4.72.3...v4.73.0](https://github.com/orbcorp/orb-node/compare/v4.72.3...v4.73.0) + +### Features + +* **api:** api update ([e7c0e9b](https://github.com/orbcorp/orb-node/commit/e7c0e9ba2894fe00871aff9d542402aefdb514fe)) +* **api:** api update ([6314aab](https://github.com/orbcorp/orb-node/commit/6314aab469494941759c2c4ca9dd40951411c143)) +* **api:** manual updates ([1148ae8](https://github.com/orbcorp/orb-node/commit/1148ae84a3dccdc9a0f7f16582457b01842bc303)) + + +### Chores + +* **docs:** grammar improvements ([7734e2c](https://github.com/orbcorp/orb-node/commit/7734e2c2d52411326b3ae2eb1fbed42d63ba4c08)) +* improve publish-npm script --latest tag logic ([642fae3](https://github.com/orbcorp/orb-node/commit/642fae3d1d137b24687643c0f700a5637162584b)) + ## 4.72.3 (2025-05-18) Full Changelog: [v4.72.2...v4.72.3](https://github.com/orbcorp/orb-node/compare/v4.72.2...v4.72.3) diff --git a/SECURITY.md b/SECURITY.md index 6f64d22c..3011c342 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Orb please follow the respective company's security reporting guidelines. +or products provided by Orb, please follow the respective company's security reporting guidelines. ### Orb Terms and Policies -Please contact team@withorb.com for any questions or concerns regarding security of our services. +Please contact team@withorb.com for any questions or concerns regarding the security of our services. --- diff --git a/api.md b/api.md index 65c62733..6002814d 100644 --- a/api.md +++ b/api.md @@ -22,6 +22,27 @@ Methods: - client.topLevel.ping() -> TopLevelPingResponse +# Beta + +Types: + +- PlanVersion +- PlanVersionPhase + +Methods: + +- client.beta.createPlanVersion(planId, { ...params }) -> PlanVersion +- client.beta.fetchPlanVersion(planId, version) -> PlanVersion +- client.beta.setDefaultPlanVersion(planId, { ...params }) -> Plan + +## ExternalPlanID + +Methods: + +- client.beta.externalPlanId.createPlanVersion(externalPlanId, { ...params }) -> PlanVersion +- client.beta.externalPlanId.fetchPlanVersion(externalPlanId, version) -> PlanVersion +- client.beta.externalPlanId.setDefaultPlanVersion(externalPlanId, { ...params }) -> Plan + # Coupons Types: @@ -225,6 +246,7 @@ Methods: - client.items.create({ ...params }) -> Item - client.items.update(itemId, { ...params }) -> Item - client.items.list({ ...params }) -> ItemsPage +- client.items.archive(itemId) -> Item - client.items.fetch(itemId) -> Item # Metrics @@ -267,6 +289,7 @@ Types: - EvaluatePriceGroup - Price - PriceEvaluateResponse +- PriceEvaluateMultipleResponse Methods: @@ -274,6 +297,7 @@ Methods: - client.prices.update(priceId, { ...params }) -> Price - client.prices.list({ ...params }) -> PricesPage - client.prices.evaluate(priceId, { ...params }) -> PriceEvaluateResponse +- client.prices.evaluateMultiple({ ...params }) -> PriceEvaluateMultipleResponse - client.prices.fetch(priceId) -> Price ## ExternalPriceID diff --git a/bin/publish-npm b/bin/publish-npm index 4c21181b..2505deca 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -4,19 +4,35 @@ set -eux npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" -# Build the project yarn build - -# Navigate to the dist directory cd dist -# Get the version from package.json +# Get latest version from npm +# +# If the package doesn't exist, yarn will return +# {"type":"error","data":"Received invalid response from npm."} +# where .data.version doesn't exist so LAST_VERSION will be an empty string. +LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" + +# Get current version from package.json VERSION="$(node -p "require('./package.json').version")" -# Extract the pre-release tag if it exists +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then - # Extract the part before any dot in the pre-release identifier - TAG="${BASH_REMATCH[1]}" + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" else TAG="latest" fi diff --git a/package.json b/package.json index c6368a1e..6bc80b7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "4.72.3", + "version": "4.73.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index ea1589b0..266b9b50 100644 --- a/src/index.ts +++ b/src/index.ts @@ -100,6 +100,13 @@ import { SubscriptionsPage, } from './resources/subscriptions'; import { TopLevel, TopLevelPingResponse } from './resources/top-level'; +import { + Beta, + BetaCreatePlanVersionParams, + BetaSetDefaultPlanVersionParams, + PlanVersion, + PlanVersionPhase, +} from './resources/beta/beta'; import { Coupon, CouponCreateParams, @@ -145,6 +152,8 @@ import { EvaluatePriceGroup, Price, PriceCreateParams, + PriceEvaluateMultipleParams, + PriceEvaluateMultipleResponse, PriceEvaluateParams, PriceEvaluateResponse, PriceListParams, @@ -278,6 +287,7 @@ export class Orb extends Core.APIClient { } topLevel: API.TopLevel = new API.TopLevel(this); + beta: API.Beta = new API.Beta(this); coupons: API.Coupons = new API.Coupons(this); creditNotes: API.CreditNotes = new API.CreditNotes(this); customers: API.Customers = new API.Customers(this); @@ -347,6 +357,7 @@ export class Orb extends Core.APIClient { } Orb.TopLevel = TopLevel; +Orb.Beta = Beta; Orb.Coupons = Coupons; Orb.CouponsPage = CouponsPage; Orb.CreditNotes = CreditNotes; @@ -379,6 +390,14 @@ export declare namespace Orb { export { TopLevel as TopLevel, type TopLevelPingResponse as TopLevelPingResponse }; + export { + Beta as Beta, + type PlanVersion as PlanVersion, + type PlanVersionPhase as PlanVersionPhase, + type BetaCreatePlanVersionParams as BetaCreatePlanVersionParams, + type BetaSetDefaultPlanVersionParams as BetaSetDefaultPlanVersionParams, + }; + export { Coupons as Coupons, type Coupon as Coupon, @@ -467,11 +486,13 @@ export declare namespace Orb { type EvaluatePriceGroup as EvaluatePriceGroup, type Price as Price, type PriceEvaluateResponse as PriceEvaluateResponse, + type PriceEvaluateMultipleResponse as PriceEvaluateMultipleResponse, PricesPage as PricesPage, type PriceCreateParams as PriceCreateParams, type PriceUpdateParams as PriceUpdateParams, type PriceListParams as PriceListParams, type PriceEvaluateParams as PriceEvaluateParams, + type PriceEvaluateMultipleParams as PriceEvaluateMultipleParams, }; export { diff --git a/src/resources/alerts.ts b/src/resources/alerts.ts index e6e37a99..c0df1076 100644 --- a/src/resources/alerts.ts +++ b/src/resources/alerts.ts @@ -224,6 +224,12 @@ export interface Alert { | 'credit_balance_recovered' | 'usage_exceeded' | 'cost_exceeded'; + + /** + * The current status of the alert. This field is only present for credit balance + * alerts. + */ + balance_alert_status?: Array | null; } export namespace Alert { @@ -280,6 +286,21 @@ export namespace Alert { */ value: number; } + + /** + * Alert status is used to determine if an alert is currently in-alert or not. + */ + export interface BalanceAlertStatus { + /** + * Whether the alert is currently in-alert or not. + */ + in_alert: boolean; + + /** + * The value of the threshold that defines the alert status. + */ + threshold_value: number; + } } export interface AlertUpdateParams { diff --git a/src/resources/beta.ts b/src/resources/beta.ts new file mode 100644 index 00000000..1542e942 --- /dev/null +++ b/src/resources/beta.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './beta/index'; diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts new file mode 100644 index 00000000..9d49fe4a --- /dev/null +++ b/src/resources/beta/beta.ts @@ -0,0 +1,9106 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as ExternalPlanIDAPI from './external-plan-id'; +import { + ExternalPlanID, + ExternalPlanIDCreatePlanVersionParams, + ExternalPlanIDSetDefaultPlanVersionParams, +} from './external-plan-id'; +import * as PlansAPI from '../plans/plans'; +import * as PricesAPI from '../prices/prices'; + +export class Beta extends APIResource { + externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client); + + /** + * This API endpoint is in beta and its interface may change. It is recommended for + * use only in test mode. + * + * This endpoint allows the creation of a new plan version for an existing plan. + */ + createPlanVersion( + planId: string, + body: BetaCreatePlanVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/plans/${planId}/versions`, { body, ...options }); + } + + /** + * This API endpoint is in beta and its interface may change. It is recommended for + * use only in test mode. + * + * This endpoint is used to fetch a plan version. It returns the phases, prices, + * and adjustments present on this version of the plan. + */ + fetchPlanVersion( + planId: string, + version: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get(`/plans/${planId}/versions/${version}`, options); + } + + /** + * This API endpoint is in beta and its interface may change. It is recommended for + * use only in test mode. + * + * This endpoint allows setting the default version of a plan. + */ + setDefaultPlanVersion( + planId: string, + body: BetaSetDefaultPlanVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/plans/${planId}/set_default_version`, { body, ...options }); + } +} + +/** + * The PlanVersion resource represents the prices and adjustments present on a + * specific version of a plan. + */ +export interface PlanVersion { + /** + * Adjustments for this plan. If the plan has phases, this includes adjustments + * across all phases of the plan. + */ + adjustments: Array< + | PlanVersion.PlanPhaseUsageDiscountAdjustment + | PlanVersion.PlanPhaseAmountDiscountAdjustment + | PlanVersion.PlanPhasePercentageDiscountAdjustment + | PlanVersion.PlanPhaseMinimumAdjustment + | PlanVersion.PlanPhaseMaximumAdjustment + >; + + created_at: string; + + plan_phases: Array | null; + + /** + * Prices for this plan. If the plan has phases, this includes prices across all + * phases of the plan. + */ + prices: Array; + + version: number; +} + +export namespace PlanVersion { + export interface PlanPhaseUsageDiscountAdjustment { + id: string; + + adjustment_type: 'usage_discount'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; + } + + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PlanPhaseAmountDiscountAdjustment { + id: string; + + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; + } + + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PlanPhasePercentageDiscountAdjustment { + id: string; + + adjustment_type: 'percentage_discount'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; + } + + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PlanPhaseMinimumAdjustment { + id: string; + + adjustment_type: 'minimum'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + minimum_amount: string; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; + } + + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PlanPhaseMaximumAdjustment { + id: string; + + adjustment_type: 'maximum'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + maximum_amount: string; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; + } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } +} + +export interface PlanVersionPhase { + id: string; + + description: string | null; + + /** + * How many terms of length `duration_unit` this phase is active for. If null, this + * phase is evergreen and active indefinitely + */ + duration: number | null; + + duration_unit: 'daily' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | null; + + name: string; + + /** + * Determines the ordering of the phase in a plan's lifecycle. 1 = first phase. + */ + order: number; +} + +export interface BetaCreatePlanVersionParams { + /** + * New version number. + */ + version: number; + + /** + * Additional adjustments to be added to the plan. + */ + add_adjustments?: Array | null; + + /** + * Additional prices to be added to the plan. + */ + add_prices?: Array | null; + + /** + * Adjustments to be removed from the plan. + */ + remove_adjustments?: Array | null; + + /** + * Prices to be removed from the plan. + */ + remove_prices?: Array | null; + + /** + * Adjustments to be replaced with additional adjustments on the plan. + */ + replace_adjustments?: Array | null; + + /** + * Prices to be replaced with additional prices on the plan. + */ + replace_prices?: Array | null; + + /** + * Set this new plan version as the default + */ + set_as_default?: boolean | null; +} + +export namespace BetaCreatePlanVersionParams { + export interface AddAdjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | AddAdjustment.NewPercentageDiscount + | AddAdjustment.NewUsageDiscount + | AddAdjustment.NewAmountDiscount + | AddAdjustment.NewMinimum + | AddAdjustment.NewMaximum; + + /** + * The phase to add this adjustment to. + */ + plan_phase_order?: number | null; + } + + export namespace AddAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + percentage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + } + + export interface AddPrice { + /** + * The allocation price to add to the plan. + */ + allocation_price?: AddPrice.AllocationPrice | null; + + /** + * The phase to add this price to. + */ + plan_phase_order?: number | null; + + /** + * The price to add to the plan + */ + price?: + | AddPrice.NewPlanUnitPrice + | AddPrice.NewPlanPackagePrice + | AddPrice.NewPlanMatrixPrice + | AddPrice.NewPlanTieredPrice + | AddPrice.NewPlanTieredBpsPrice + | AddPrice.NewPlanBpsPrice + | AddPrice.NewPlanBulkBpsPrice + | AddPrice.NewPlanBulkPrice + | AddPrice.NewPlanThresholdTotalAmountPrice + | AddPrice.NewPlanTieredPackagePrice + | AddPrice.NewPlanTieredWithMinimumPrice + | AddPrice.NewPlanUnitWithPercentPrice + | AddPrice.NewPlanPackageWithAllocationPrice + | AddPrice.NewPlanTierWithProrationPrice + | AddPrice.NewPlanUnitWithProrationPrice + | AddPrice.NewPlanGroupedAllocationPrice + | AddPrice.NewPlanGroupedWithProratedMinimumPrice + | AddPrice.NewPlanGroupedWithMeteredMinimumPrice + | AddPrice.NewPlanMatrixWithDisplayNamePrice + | AddPrice.NewPlanBulkWithProrationPrice + | AddPrice.NewPlanGroupedTieredPackagePrice + | AddPrice.NewPlanMaxGroupTieredPackagePrice + | AddPrice.NewPlanScalableMatrixWithUnitPricingPrice + | AddPrice.NewPlanScalableMatrixWithTieredPricingPrice + | AddPrice.NewPlanCumulativeGroupedBulkPrice + | AddPrice.NewPlanTieredPackageWithMinimumPrice + | AddPrice.NewPlanMatrixWithAllocationPrice + | AddPrice.NewPlanGroupedTieredPrice + | null; + } + + export namespace AddPrice { + /** + * The allocation price to add to the plan. + */ + 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; + + /** + * The custom expiration for the allocation. + */ + custom_expiration?: AllocationPrice.CustomExpiration | null; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; + } + + export namespace AllocationPrice { + /** + * The custom expiration for the allocation. + */ + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitPrice { + /** + * 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: NewPlanUnitPrice.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?: NewPlanUnitPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitPrice.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 NewPlanUnitPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackagePrice { + /** + * 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: NewPlanPackagePrice.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?: NewPlanPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanPackagePrice.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 NewPlanPackagePrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixPrice { + /** + * 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: NewPlanMatrixPrice.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?: NewPlanMatrixPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixPrice.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 NewPlanMatrixPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPrice { + /** + * 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: NewPlanTieredPrice.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?: NewPlanTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPrice.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 NewPlanTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredBpsPrice { + /** + * 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: NewPlanTieredBpsPrice.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?: NewPlanTieredBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredBpsPrice.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 NewPlanTieredBpsPrice { + 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBpsPrice { + bps_config: NewPlanBpsPrice.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?: NewPlanBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBpsPrice.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 NewPlanBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkBpsPrice { + bulk_bps_config: NewPlanBulkBpsPrice.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?: NewPlanBulkBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkBpsPrice.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 NewPlanBulkBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkPrice { + bulk_config: NewPlanBulkPrice.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?: NewPlanBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkPrice.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 NewPlanBulkPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanThresholdTotalAmountPrice { + /** + * 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?: NewPlanThresholdTotalAmountPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | 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?: NewPlanThresholdTotalAmountPrice.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 NewPlanThresholdTotalAmountPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackagePrice { + /** + * 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?: NewPlanTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackagePrice.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 NewPlanTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_minimum_config: 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?: NewPlanTieredWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredWithMinimumPrice.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 NewPlanTieredWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithPercentPrice { + /** + * 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?: NewPlanUnitWithPercentPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithPercentPrice.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 NewPlanUnitWithPercentPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackageWithAllocationPrice { + /** + * 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_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. + */ + 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?: NewPlanPackageWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanPackageWithAllocationPrice.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 NewPlanPackageWithAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTierWithProrationPrice { + /** + * 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_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?: NewPlanTierWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanTierWithProrationPrice.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 NewPlanTierWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithProrationPrice { + /** + * 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_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?: NewPlanUnitWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithProrationPrice.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 NewPlanUnitWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedAllocationPrice { + /** + * 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'; + + /** + * 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?: NewPlanGroupedAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedAllocationPrice.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 NewPlanGroupedAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_prorated_minimum_config: 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?: NewPlanGroupedWithProratedMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithProratedMinimumPrice.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 NewPlanGroupedWithProratedMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_metered_minimum_config: 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?: NewPlanGroupedWithMeteredMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithMeteredMinimumPrice.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 NewPlanGroupedWithMeteredMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithDisplayNamePrice { + /** + * 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_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?: NewPlanMatrixWithDisplayNamePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithDisplayNamePrice.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 NewPlanMatrixWithDisplayNamePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * 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_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?: NewPlanBulkWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkWithProrationPrice.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 NewPlanBulkWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPackagePrice { + /** + * 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: '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?: NewPlanGroupedTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPackagePrice.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 NewPlanGroupedTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_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?: NewPlanMaxGroupTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanMaxGroupTieredPackagePrice.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 NewPlanMaxGroupTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithUnitPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithUnitPricingPrice.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 NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithTieredPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithTieredPricingPrice.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 NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanCumulativeGroupedBulkPrice { + /** + * 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: '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?: NewPlanCumulativeGroupedBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanCumulativeGroupedBulkPrice.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 NewPlanCumulativeGroupedBulkPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackageWithMinimumPrice { + /** + * 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_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_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?: NewPlanTieredPackageWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackageWithMinimumPrice.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 NewPlanTieredPackageWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithAllocationPrice { + /** + * 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_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_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?: NewPlanMatrixWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithAllocationPrice.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 NewPlanMatrixWithAllocationPrice { + 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * 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?: NewPlanGroupedTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPrice.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 NewPlanGroupedTieredPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + } + + export interface RemoveAdjustment { + /** + * The id of the adjustment to remove from on the plan. + */ + adjustment_id: string; + + /** + * The phase to remove this adjustment from. + */ + plan_phase_order?: number | null; + } + + export interface RemovePrice { + /** + * The id of the price to remove from the plan. + */ + price_id: string; + + /** + * The phase to remove this price from. + */ + plan_phase_order?: number | null; + } + + export interface ReplaceAdjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | ReplaceAdjustment.NewPercentageDiscount + | ReplaceAdjustment.NewUsageDiscount + | ReplaceAdjustment.NewAmountDiscount + | ReplaceAdjustment.NewMinimum + | ReplaceAdjustment.NewMaximum; + + /** + * The id of the adjustment on the plan to replace in the plan. + */ + replaces_adjustment_id: string; + + /** + * The phase to replace this adjustment from. + */ + plan_phase_order?: number | null; + } + + export namespace ReplaceAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + percentage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + } + + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the plan. + */ + replaces_price_id: string; + + /** + * The allocation price to add to the plan. + */ + allocation_price?: ReplacePrice.AllocationPrice | null; + + /** + * The phase to replace this price from. + */ + plan_phase_order?: number | null; + + /** + * The price to add to the plan + */ + price?: + | ReplacePrice.NewPlanUnitPrice + | ReplacePrice.NewPlanPackagePrice + | ReplacePrice.NewPlanMatrixPrice + | ReplacePrice.NewPlanTieredPrice + | ReplacePrice.NewPlanTieredBpsPrice + | ReplacePrice.NewPlanBpsPrice + | ReplacePrice.NewPlanBulkBpsPrice + | ReplacePrice.NewPlanBulkPrice + | ReplacePrice.NewPlanThresholdTotalAmountPrice + | ReplacePrice.NewPlanTieredPackagePrice + | ReplacePrice.NewPlanTieredWithMinimumPrice + | ReplacePrice.NewPlanUnitWithPercentPrice + | ReplacePrice.NewPlanPackageWithAllocationPrice + | ReplacePrice.NewPlanTierWithProrationPrice + | ReplacePrice.NewPlanUnitWithProrationPrice + | ReplacePrice.NewPlanGroupedAllocationPrice + | ReplacePrice.NewPlanGroupedWithProratedMinimumPrice + | ReplacePrice.NewPlanGroupedWithMeteredMinimumPrice + | ReplacePrice.NewPlanMatrixWithDisplayNamePrice + | ReplacePrice.NewPlanBulkWithProrationPrice + | ReplacePrice.NewPlanGroupedTieredPackagePrice + | ReplacePrice.NewPlanMaxGroupTieredPackagePrice + | ReplacePrice.NewPlanScalableMatrixWithUnitPricingPrice + | ReplacePrice.NewPlanScalableMatrixWithTieredPricingPrice + | ReplacePrice.NewPlanCumulativeGroupedBulkPrice + | ReplacePrice.NewPlanTieredPackageWithMinimumPrice + | ReplacePrice.NewPlanMatrixWithAllocationPrice + | ReplacePrice.NewPlanGroupedTieredPrice + | null; + } + + export namespace ReplacePrice { + /** + * The allocation price to add to the plan. + */ + 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; + + /** + * The custom expiration for the allocation. + */ + custom_expiration?: AllocationPrice.CustomExpiration | null; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; + } + + export namespace AllocationPrice { + /** + * The custom expiration for the allocation. + */ + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitPrice { + /** + * 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: NewPlanUnitPrice.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?: NewPlanUnitPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitPrice.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 NewPlanUnitPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackagePrice { + /** + * 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: NewPlanPackagePrice.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?: NewPlanPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanPackagePrice.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 NewPlanPackagePrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixPrice { + /** + * 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: NewPlanMatrixPrice.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?: NewPlanMatrixPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixPrice.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 NewPlanMatrixPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPrice { + /** + * 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: NewPlanTieredPrice.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?: NewPlanTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPrice.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 NewPlanTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredBpsPrice { + /** + * 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: NewPlanTieredBpsPrice.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?: NewPlanTieredBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredBpsPrice.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 NewPlanTieredBpsPrice { + 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBpsPrice { + bps_config: NewPlanBpsPrice.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?: NewPlanBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBpsPrice.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 NewPlanBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkBpsPrice { + bulk_bps_config: NewPlanBulkBpsPrice.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?: NewPlanBulkBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkBpsPrice.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 NewPlanBulkBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkPrice { + bulk_config: NewPlanBulkPrice.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?: NewPlanBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkPrice.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 NewPlanBulkPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanThresholdTotalAmountPrice { + /** + * 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?: NewPlanThresholdTotalAmountPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | 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?: NewPlanThresholdTotalAmountPrice.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 NewPlanThresholdTotalAmountPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackagePrice { + /** + * 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?: NewPlanTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackagePrice.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 NewPlanTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_minimum_config: 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?: NewPlanTieredWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredWithMinimumPrice.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 NewPlanTieredWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithPercentPrice { + /** + * 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?: NewPlanUnitWithPercentPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithPercentPrice.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 NewPlanUnitWithPercentPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackageWithAllocationPrice { + /** + * 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_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. + */ + 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?: NewPlanPackageWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanPackageWithAllocationPrice.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 NewPlanPackageWithAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTierWithProrationPrice { + /** + * 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_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?: NewPlanTierWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanTierWithProrationPrice.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 NewPlanTierWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithProrationPrice { + /** + * 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_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?: NewPlanUnitWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithProrationPrice.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 NewPlanUnitWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedAllocationPrice { + /** + * 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'; + + /** + * 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?: NewPlanGroupedAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedAllocationPrice.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 NewPlanGroupedAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_prorated_minimum_config: 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?: NewPlanGroupedWithProratedMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithProratedMinimumPrice.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 NewPlanGroupedWithProratedMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_metered_minimum_config: 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?: NewPlanGroupedWithMeteredMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithMeteredMinimumPrice.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 NewPlanGroupedWithMeteredMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithDisplayNamePrice { + /** + * 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_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?: NewPlanMatrixWithDisplayNamePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithDisplayNamePrice.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 NewPlanMatrixWithDisplayNamePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * 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_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?: NewPlanBulkWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkWithProrationPrice.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 NewPlanBulkWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPackagePrice { + /** + * 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: '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?: NewPlanGroupedTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPackagePrice.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 NewPlanGroupedTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_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?: NewPlanMaxGroupTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanMaxGroupTieredPackagePrice.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 NewPlanMaxGroupTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithUnitPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithUnitPricingPrice.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 NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithTieredPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithTieredPricingPrice.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 NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanCumulativeGroupedBulkPrice { + /** + * 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: '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?: NewPlanCumulativeGroupedBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanCumulativeGroupedBulkPrice.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 NewPlanCumulativeGroupedBulkPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackageWithMinimumPrice { + /** + * 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_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_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?: NewPlanTieredPackageWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackageWithMinimumPrice.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 NewPlanTieredPackageWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithAllocationPrice { + /** + * 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_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_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?: NewPlanMatrixWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithAllocationPrice.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 NewPlanMatrixWithAllocationPrice { + 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * 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?: NewPlanGroupedTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPrice.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 NewPlanGroupedTieredPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + } +} + +export interface BetaSetDefaultPlanVersionParams { + /** + * Plan version to set as the default. + */ + version: number; +} + +Beta.ExternalPlanID = ExternalPlanID; + +export declare namespace Beta { + export { + type PlanVersion as PlanVersion, + type PlanVersionPhase as PlanVersionPhase, + type BetaCreatePlanVersionParams as BetaCreatePlanVersionParams, + type BetaSetDefaultPlanVersionParams as BetaSetDefaultPlanVersionParams, + }; + + export { + ExternalPlanID as ExternalPlanID, + type ExternalPlanIDCreatePlanVersionParams as ExternalPlanIDCreatePlanVersionParams, + type ExternalPlanIDSetDefaultPlanVersionParams as ExternalPlanIDSetDefaultPlanVersionParams, + }; +} diff --git a/src/resources/beta/external-plan-id.ts b/src/resources/beta/external-plan-id.ts new file mode 100644 index 00000000..9bd9e353 --- /dev/null +++ b/src/resources/beta/external-plan-id.ts @@ -0,0 +1,8748 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as BetaAPI from './beta'; +import * as PlansAPI from '../plans/plans'; + +export class ExternalPlanID extends APIResource { + /** + * This API endpoint is in beta and its interface may change. It is recommended for + * use only in test mode. + * + * This endpoint allows the creation of a new plan version for an existing plan. + */ + createPlanVersion( + externalPlanId: string, + body: ExternalPlanIDCreatePlanVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/plans/external_plan_id/${externalPlanId}/versions`, { body, ...options }); + } + + /** + * This API endpoint is in beta and its interface may change. It is recommended for + * use only in test mode. + * + * This endpoint is used to fetch a plan version. It returns the phases, prices, + * and adjustments present on this version of the plan. + */ + fetchPlanVersion( + externalPlanId: string, + version: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get(`/plans/external_plan_id/${externalPlanId}/versions/${version}`, options); + } + + /** + * This API endpoint is in beta and its interface may change. It is recommended for + * use only in test mode. + * + * This endpoint allows setting the default version of a plan. + */ + setDefaultPlanVersion( + externalPlanId: string, + body: ExternalPlanIDSetDefaultPlanVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/plans/external_plan_id/${externalPlanId}/set_default_version`, { + body, + ...options, + }); + } +} + +export interface ExternalPlanIDCreatePlanVersionParams { + /** + * New version number. + */ + version: number; + + /** + * Additional adjustments to be added to the plan. + */ + add_adjustments?: Array | null; + + /** + * Additional prices to be added to the plan. + */ + add_prices?: Array | null; + + /** + * Adjustments to be removed from the plan. + */ + remove_adjustments?: Array | null; + + /** + * Prices to be removed from the plan. + */ + remove_prices?: Array | null; + + /** + * Adjustments to be replaced with additional adjustments on the plan. + */ + replace_adjustments?: Array | null; + + /** + * Prices to be replaced with additional prices on the plan. + */ + replace_prices?: Array | null; + + /** + * Set this new plan version as the default + */ + set_as_default?: boolean | null; +} + +export namespace ExternalPlanIDCreatePlanVersionParams { + export interface AddAdjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | AddAdjustment.NewPercentageDiscount + | AddAdjustment.NewUsageDiscount + | AddAdjustment.NewAmountDiscount + | AddAdjustment.NewMinimum + | AddAdjustment.NewMaximum; + + /** + * The phase to add this adjustment to. + */ + plan_phase_order?: number | null; + } + + export namespace AddAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + percentage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + } + + export interface AddPrice { + /** + * The allocation price to add to the plan. + */ + allocation_price?: AddPrice.AllocationPrice | null; + + /** + * The phase to add this price to. + */ + plan_phase_order?: number | null; + + /** + * The price to add to the plan + */ + price?: + | AddPrice.NewPlanUnitPrice + | AddPrice.NewPlanPackagePrice + | AddPrice.NewPlanMatrixPrice + | AddPrice.NewPlanTieredPrice + | AddPrice.NewPlanTieredBpsPrice + | AddPrice.NewPlanBpsPrice + | AddPrice.NewPlanBulkBpsPrice + | AddPrice.NewPlanBulkPrice + | AddPrice.NewPlanThresholdTotalAmountPrice + | AddPrice.NewPlanTieredPackagePrice + | AddPrice.NewPlanTieredWithMinimumPrice + | AddPrice.NewPlanUnitWithPercentPrice + | AddPrice.NewPlanPackageWithAllocationPrice + | AddPrice.NewPlanTierWithProrationPrice + | AddPrice.NewPlanUnitWithProrationPrice + | AddPrice.NewPlanGroupedAllocationPrice + | AddPrice.NewPlanGroupedWithProratedMinimumPrice + | AddPrice.NewPlanGroupedWithMeteredMinimumPrice + | AddPrice.NewPlanMatrixWithDisplayNamePrice + | AddPrice.NewPlanBulkWithProrationPrice + | AddPrice.NewPlanGroupedTieredPackagePrice + | AddPrice.NewPlanMaxGroupTieredPackagePrice + | AddPrice.NewPlanScalableMatrixWithUnitPricingPrice + | AddPrice.NewPlanScalableMatrixWithTieredPricingPrice + | AddPrice.NewPlanCumulativeGroupedBulkPrice + | AddPrice.NewPlanTieredPackageWithMinimumPrice + | AddPrice.NewPlanMatrixWithAllocationPrice + | AddPrice.NewPlanGroupedTieredPrice + | null; + } + + export namespace AddPrice { + /** + * The allocation price to add to the plan. + */ + 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; + + /** + * The custom expiration for the allocation. + */ + custom_expiration?: AllocationPrice.CustomExpiration | null; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; + } + + export namespace AllocationPrice { + /** + * The custom expiration for the allocation. + */ + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitPrice { + /** + * 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: NewPlanUnitPrice.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?: NewPlanUnitPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitPrice.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 NewPlanUnitPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackagePrice { + /** + * 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: NewPlanPackagePrice.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?: NewPlanPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanPackagePrice.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 NewPlanPackagePrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixPrice { + /** + * 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: NewPlanMatrixPrice.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?: NewPlanMatrixPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixPrice.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 NewPlanMatrixPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPrice { + /** + * 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: NewPlanTieredPrice.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?: NewPlanTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPrice.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 NewPlanTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredBpsPrice { + /** + * 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: NewPlanTieredBpsPrice.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?: NewPlanTieredBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredBpsPrice.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 NewPlanTieredBpsPrice { + 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBpsPrice { + bps_config: NewPlanBpsPrice.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?: NewPlanBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBpsPrice.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 NewPlanBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkBpsPrice { + bulk_bps_config: NewPlanBulkBpsPrice.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?: NewPlanBulkBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkBpsPrice.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 NewPlanBulkBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkPrice { + bulk_config: NewPlanBulkPrice.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?: NewPlanBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkPrice.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 NewPlanBulkPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanThresholdTotalAmountPrice { + /** + * 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?: NewPlanThresholdTotalAmountPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | 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?: NewPlanThresholdTotalAmountPrice.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 NewPlanThresholdTotalAmountPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackagePrice { + /** + * 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?: NewPlanTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackagePrice.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 NewPlanTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_minimum_config: 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?: NewPlanTieredWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredWithMinimumPrice.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 NewPlanTieredWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithPercentPrice { + /** + * 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?: NewPlanUnitWithPercentPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithPercentPrice.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 NewPlanUnitWithPercentPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackageWithAllocationPrice { + /** + * 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_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. + */ + 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?: NewPlanPackageWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanPackageWithAllocationPrice.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 NewPlanPackageWithAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTierWithProrationPrice { + /** + * 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_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?: NewPlanTierWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanTierWithProrationPrice.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 NewPlanTierWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithProrationPrice { + /** + * 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_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?: NewPlanUnitWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithProrationPrice.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 NewPlanUnitWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedAllocationPrice { + /** + * 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'; + + /** + * 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?: NewPlanGroupedAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedAllocationPrice.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 NewPlanGroupedAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_prorated_minimum_config: 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?: NewPlanGroupedWithProratedMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithProratedMinimumPrice.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 NewPlanGroupedWithProratedMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_metered_minimum_config: 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?: NewPlanGroupedWithMeteredMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithMeteredMinimumPrice.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 NewPlanGroupedWithMeteredMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithDisplayNamePrice { + /** + * 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_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?: NewPlanMatrixWithDisplayNamePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithDisplayNamePrice.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 NewPlanMatrixWithDisplayNamePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * 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_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?: NewPlanBulkWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkWithProrationPrice.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 NewPlanBulkWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPackagePrice { + /** + * 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: '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?: NewPlanGroupedTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPackagePrice.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 NewPlanGroupedTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_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?: NewPlanMaxGroupTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanMaxGroupTieredPackagePrice.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 NewPlanMaxGroupTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithUnitPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithUnitPricingPrice.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 NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithTieredPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithTieredPricingPrice.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 NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanCumulativeGroupedBulkPrice { + /** + * 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: '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?: NewPlanCumulativeGroupedBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanCumulativeGroupedBulkPrice.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 NewPlanCumulativeGroupedBulkPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackageWithMinimumPrice { + /** + * 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_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_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?: NewPlanTieredPackageWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackageWithMinimumPrice.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 NewPlanTieredPackageWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithAllocationPrice { + /** + * 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_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_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?: NewPlanMatrixWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithAllocationPrice.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 NewPlanMatrixWithAllocationPrice { + 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * 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?: NewPlanGroupedTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPrice.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 NewPlanGroupedTieredPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + } + + export interface RemoveAdjustment { + /** + * The id of the adjustment to remove from on the plan. + */ + adjustment_id: string; + + /** + * The phase to remove this adjustment from. + */ + plan_phase_order?: number | null; + } + + export interface RemovePrice { + /** + * The id of the price to remove from the plan. + */ + price_id: string; + + /** + * The phase to remove this price from. + */ + plan_phase_order?: number | null; + } + + export interface ReplaceAdjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | ReplaceAdjustment.NewPercentageDiscount + | ReplaceAdjustment.NewUsageDiscount + | ReplaceAdjustment.NewAmountDiscount + | ReplaceAdjustment.NewMinimum + | ReplaceAdjustment.NewMaximum; + + /** + * The id of the adjustment on the plan to replace in the plan. + */ + replaces_adjustment_id: string; + + /** + * The phase to replace this adjustment from. + */ + plan_phase_order?: number | null; + } + + export namespace ReplaceAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + percentage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + } + + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the plan. + */ + replaces_price_id: string; + + /** + * The allocation price to add to the plan. + */ + allocation_price?: ReplacePrice.AllocationPrice | null; + + /** + * The phase to replace this price from. + */ + plan_phase_order?: number | null; + + /** + * The price to add to the plan + */ + price?: + | ReplacePrice.NewPlanUnitPrice + | ReplacePrice.NewPlanPackagePrice + | ReplacePrice.NewPlanMatrixPrice + | ReplacePrice.NewPlanTieredPrice + | ReplacePrice.NewPlanTieredBpsPrice + | ReplacePrice.NewPlanBpsPrice + | ReplacePrice.NewPlanBulkBpsPrice + | ReplacePrice.NewPlanBulkPrice + | ReplacePrice.NewPlanThresholdTotalAmountPrice + | ReplacePrice.NewPlanTieredPackagePrice + | ReplacePrice.NewPlanTieredWithMinimumPrice + | ReplacePrice.NewPlanUnitWithPercentPrice + | ReplacePrice.NewPlanPackageWithAllocationPrice + | ReplacePrice.NewPlanTierWithProrationPrice + | ReplacePrice.NewPlanUnitWithProrationPrice + | ReplacePrice.NewPlanGroupedAllocationPrice + | ReplacePrice.NewPlanGroupedWithProratedMinimumPrice + | ReplacePrice.NewPlanGroupedWithMeteredMinimumPrice + | ReplacePrice.NewPlanMatrixWithDisplayNamePrice + | ReplacePrice.NewPlanBulkWithProrationPrice + | ReplacePrice.NewPlanGroupedTieredPackagePrice + | ReplacePrice.NewPlanMaxGroupTieredPackagePrice + | ReplacePrice.NewPlanScalableMatrixWithUnitPricingPrice + | ReplacePrice.NewPlanScalableMatrixWithTieredPricingPrice + | ReplacePrice.NewPlanCumulativeGroupedBulkPrice + | ReplacePrice.NewPlanTieredPackageWithMinimumPrice + | ReplacePrice.NewPlanMatrixWithAllocationPrice + | ReplacePrice.NewPlanGroupedTieredPrice + | null; + } + + export namespace ReplacePrice { + /** + * The allocation price to add to the plan. + */ + 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; + + /** + * The custom expiration for the allocation. + */ + custom_expiration?: AllocationPrice.CustomExpiration | null; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; + } + + export namespace AllocationPrice { + /** + * The custom expiration for the allocation. + */ + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitPrice { + /** + * 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: NewPlanUnitPrice.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?: NewPlanUnitPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitPrice.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 NewPlanUnitPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackagePrice { + /** + * 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: NewPlanPackagePrice.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?: NewPlanPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanPackagePrice.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 NewPlanPackagePrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixPrice { + /** + * 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: NewPlanMatrixPrice.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?: NewPlanMatrixPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixPrice.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 NewPlanMatrixPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPrice { + /** + * 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: NewPlanTieredPrice.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?: NewPlanTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPrice.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 NewPlanTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredBpsPrice { + /** + * 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: NewPlanTieredBpsPrice.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?: NewPlanTieredBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredBpsPrice.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 NewPlanTieredBpsPrice { + 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBpsPrice { + bps_config: NewPlanBpsPrice.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?: NewPlanBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBpsPrice.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 NewPlanBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkBpsPrice { + bulk_bps_config: NewPlanBulkBpsPrice.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?: NewPlanBulkBpsPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkBpsPrice.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 NewPlanBulkBpsPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkPrice { + bulk_config: NewPlanBulkPrice.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?: NewPlanBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkPrice.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 NewPlanBulkPrice { + 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanThresholdTotalAmountPrice { + /** + * 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?: NewPlanThresholdTotalAmountPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | 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?: NewPlanThresholdTotalAmountPrice.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 NewPlanThresholdTotalAmountPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackagePrice { + /** + * 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?: NewPlanTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackagePrice.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 NewPlanTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_minimum_config: 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?: NewPlanTieredWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredWithMinimumPrice.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 NewPlanTieredWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithPercentPrice { + /** + * 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?: NewPlanUnitWithPercentPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithPercentPrice.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 NewPlanUnitWithPercentPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanPackageWithAllocationPrice { + /** + * 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_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. + */ + 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?: NewPlanPackageWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanPackageWithAllocationPrice.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 NewPlanPackageWithAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTierWithProrationPrice { + /** + * 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_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?: NewPlanTierWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanTierWithProrationPrice.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 NewPlanTierWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanUnitWithProrationPrice { + /** + * 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_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?: NewPlanUnitWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanUnitWithProrationPrice.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 NewPlanUnitWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedAllocationPrice { + /** + * 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'; + + /** + * 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?: NewPlanGroupedAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedAllocationPrice.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 NewPlanGroupedAllocationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_prorated_minimum_config: 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?: NewPlanGroupedWithProratedMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithProratedMinimumPrice.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 NewPlanGroupedWithProratedMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_metered_minimum_config: 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?: NewPlanGroupedWithMeteredMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedWithMeteredMinimumPrice.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 NewPlanGroupedWithMeteredMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithDisplayNamePrice { + /** + * 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_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?: NewPlanMatrixWithDisplayNamePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithDisplayNamePrice.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 NewPlanMatrixWithDisplayNamePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * 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_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?: NewPlanBulkWithProrationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | 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?: NewPlanBulkWithProrationPrice.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 NewPlanBulkWithProrationPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPackagePrice { + /** + * 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: '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?: NewPlanGroupedTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPackagePrice.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 NewPlanGroupedTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_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?: NewPlanMaxGroupTieredPackagePrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewPlanMaxGroupTieredPackagePrice.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 NewPlanMaxGroupTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithUnitPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithUnitPricingPrice.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 NewPlanScalableMatrixWithUnitPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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: '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?: NewPlanScalableMatrixWithTieredPricingPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | 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?: NewPlanScalableMatrixWithTieredPricingPrice.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 NewPlanScalableMatrixWithTieredPricingPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanCumulativeGroupedBulkPrice { + /** + * 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: '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?: NewPlanCumulativeGroupedBulkPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | 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?: NewPlanCumulativeGroupedBulkPrice.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 NewPlanCumulativeGroupedBulkPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackageWithMinimumPrice { + /** + * 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_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_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?: NewPlanTieredPackageWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackageWithMinimumPrice.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 NewPlanTieredPackageWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithAllocationPrice { + /** + * 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_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_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?: NewPlanMatrixWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithAllocationPrice.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 NewPlanMatrixWithAllocationPrice { + 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * 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?: NewPlanGroupedTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPrice.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 NewPlanGroupedTieredPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + } +} + +export interface ExternalPlanIDSetDefaultPlanVersionParams { + /** + * Plan version to set as the default. + */ + version: number; +} + +export declare namespace ExternalPlanID { + export { + type ExternalPlanIDCreatePlanVersionParams as ExternalPlanIDCreatePlanVersionParams, + type ExternalPlanIDSetDefaultPlanVersionParams as ExternalPlanIDSetDefaultPlanVersionParams, + }; +} diff --git a/src/resources/beta/index.ts b/src/resources/beta/index.ts new file mode 100644 index 00000000..0b1be48c --- /dev/null +++ b/src/resources/beta/index.ts @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Beta, + type PlanVersion, + type PlanVersionPhase, + type BetaCreatePlanVersionParams, + type BetaSetDefaultPlanVersionParams, +} from './beta'; +export { + ExternalPlanID, + type ExternalPlanIDCreatePlanVersionParams, + type ExternalPlanIDSetDefaultPlanVersionParams, +} from './external-plan-id'; diff --git a/src/resources/credit-notes.ts b/src/resources/credit-notes.ts index 8a583e76..145c5cd0 100644 --- a/src/resources/credit-notes.ts +++ b/src/resources/credit-notes.ts @@ -254,14 +254,14 @@ export interface CreditNoteCreateParams { line_items: Array; /** - * An optional memo to attach to the credit note. + * An optional reason for the credit note. */ - memo?: string | null; + reason: 'duplicate' | 'fraudulent' | 'order_change' | 'product_unsatisfactory'; /** - * An optional reason for the credit note. + * An optional memo to attach to the credit note. */ - reason?: 'duplicate' | 'fraudulent' | 'order_change' | 'product_unsatisfactory' | null; + memo?: string | null; } export namespace CreditNoteCreateParams { diff --git a/src/resources/customers/balance-transactions.ts b/src/resources/customers/balance-transactions.ts index c01d87fd..6ce16de1 100644 --- a/src/resources/customers/balance-transactions.ts +++ b/src/resources/customers/balance-transactions.ts @@ -40,13 +40,6 @@ export class BalanceTransactions extends APIResource { * This endpoint retrieves all customer balance transactions in reverse * chronological order for a single customer, providing a complete audit trail of * all adjustments and invoice applications. - * - * ## Eligibility - * - * The customer balance can only be applied to invoices or adjusted manually if - * invoices are not synced to a separate invoicing provider. If a payment gateway - * such as Stripe is used, the balance will be applied to the invoice before - * forwarding payment to the gateway. */ list( customerId: string, diff --git a/src/resources/customers/credits/ledger.ts b/src/resources/customers/credits/ledger.ts index 6a4483e6..7b8589f3 100644 --- a/src/resources/customers/credits/ledger.ts +++ b/src/resources/customers/credits/ledger.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; +import * as InvoicesAPI from '../../invoices'; import { Page, type PageParams } from '../../../pagination'; export class Ledger extends APIResource { @@ -513,6 +514,11 @@ export namespace LedgerListResponse { metadata: Record; starting_balance: number; + + /** + * If the increment resulted in invoice creation, the list of created invoices + */ + created_invoices?: Array | null; } export namespace IncrementLedgerEntry { @@ -896,6 +902,11 @@ export namespace LedgerCreateEntryResponse { metadata: Record; starting_balance: number; + + /** + * If the increment resulted in invoice creation, the list of created invoices + */ + created_invoices?: Array | null; } export namespace IncrementLedgerEntry { @@ -1279,6 +1290,11 @@ export namespace LedgerCreateEntryByExternalIDResponse { metadata: Record; starting_balance: number; + + /** + * If the increment resulted in invoice creation, the list of created invoices + */ + created_invoices?: Array | null; } export namespace IncrementLedgerEntry { @@ -1662,6 +1678,11 @@ export namespace LedgerListByExternalIDResponse { metadata: Record; starting_balance: number; + + /** + * If the increment resulted in invoice creation, the list of created invoices + */ + created_invoices?: Array | null; } export namespace IncrementLedgerEntry { diff --git a/src/resources/customers/credits/top-ups.ts b/src/resources/customers/credits/top-ups.ts index f5302f53..d0d80f8a 100644 --- a/src/resources/customers/credits/top-ups.ts +++ b/src/resources/customers/credits/top-ups.ts @@ -449,7 +449,7 @@ export interface TopUpCreateParams { /** * The date from which the top-up is active. If unspecified, the top-up is active - * immediately. + * immediately. This should not be more than 10 days in the past. */ active_from?: string | null; @@ -528,7 +528,7 @@ export interface TopUpCreateByExternalIDParams { /** * The date from which the top-up is active. If unspecified, the top-up is active - * immediately. + * immediately. This should not be more than 10 days in the past. */ active_from?: string | null; diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts index 0a8f4f27..f6ab6570 100644 --- a/src/resources/customers/customers.ts +++ b/src/resources/customers/customers.ts @@ -103,10 +103,7 @@ export class Customers extends APIResource { * **Note**: This operation happens asynchronously and can be expected to take a * few minutes to propagate to related resources. However, querying for the * customer on subsequent GET requests while deletion is in process will reflect - * its deletion with a `deleted: true` property. Once the customer deletion has - * been fully processed, the customer will not be returned in the API. - * - * On successful processing, this returns an empty dictionary (`{}`) in the API. + * its deletion. */ delete(customerId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.delete(`/customers/${customerId}`, { @@ -812,6 +809,7 @@ export interface CustomerCreateParams { tax_configuration?: | CustomerCreateParams.NewAvalaraTaxConfiguration | CustomerCreateParams.NewTaxJarConfiguration + | CustomerCreateParams.NewSphereConfiguration | null; /** @@ -1009,6 +1007,12 @@ export namespace CustomerCreateParams { tax_provider: 'taxjar'; } + export interface NewSphereConfiguration { + tax_exempt: boolean; + + tax_provider: 'sphere'; + } + /** * Tax IDs are commonly required to be displayed on customer invoices, which are * added to the headers of invoices. @@ -1352,6 +1356,7 @@ export interface CustomerUpdateParams { tax_configuration?: | CustomerUpdateParams.NewAvalaraTaxConfiguration | CustomerUpdateParams.NewTaxJarConfiguration + | CustomerUpdateParams.NewSphereConfiguration | null; /** @@ -1542,6 +1547,12 @@ export namespace CustomerUpdateParams { tax_provider: 'taxjar'; } + export interface NewSphereConfiguration { + tax_exempt: boolean; + + tax_provider: 'sphere'; + } + /** * Tax IDs are commonly required to be displayed on customer invoices, which are * added to the headers of invoices. @@ -1895,6 +1906,7 @@ export interface CustomerUpdateByExternalIDParams { tax_configuration?: | CustomerUpdateByExternalIDParams.NewAvalaraTaxConfiguration | CustomerUpdateByExternalIDParams.NewTaxJarConfiguration + | CustomerUpdateByExternalIDParams.NewSphereConfiguration | null; /** @@ -2085,6 +2097,12 @@ export namespace CustomerUpdateByExternalIDParams { tax_provider: 'taxjar'; } + export interface NewSphereConfiguration { + tax_exempt: boolean; + + tax_provider: 'sphere'; + } + /** * Tax IDs are commonly required to be displayed on customer invoices, which are * added to the headers of invoices. diff --git a/src/resources/dimensional-price-groups/dimensional-price-groups.ts b/src/resources/dimensional-price-groups/dimensional-price-groups.ts index c70a89cb..aca2e1fa 100644 --- a/src/resources/dimensional-price-groups/dimensional-price-groups.ts +++ b/src/resources/dimensional-price-groups/dimensional-price-groups.ts @@ -20,7 +20,7 @@ export class DimensionalPriceGroups extends APIResource { * For example, suppose we have a billable metric that measures the number of * widgets used and we want to charge differently depending on the color of the * widget. We can create a price group with a dimension "color" and two prices: one - * that charges $10 per red widget and one that charges $20 per blue widget. + * that charges \$10 per red widget and one that charges \$20 per blue widget. */ create( body: DimensionalPriceGroupCreateParams, diff --git a/src/resources/index.ts b/src/resources/index.ts index bc3d1c96..514b42ef 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -13,6 +13,13 @@ export { type AlertDisableParams, type AlertEnableParams, } from './alerts'; +export { + Beta, + type PlanVersion, + type PlanVersionPhase, + type BetaCreatePlanVersionParams, + type BetaSetDefaultPlanVersionParams, +} from './beta/beta'; export { BillableMetricsPage, Metrics, @@ -100,10 +107,12 @@ export { type EvaluatePriceGroup, type Price, type PriceEvaluateResponse, + type PriceEvaluateMultipleResponse, type PriceCreateParams, type PriceUpdateParams, type PriceListParams, type PriceEvaluateParams, + type PriceEvaluateMultipleParams, } from './prices/prices'; export { SubscriptionChanges, diff --git a/src/resources/invoice-line-items.ts b/src/resources/invoice-line-items.ts index aa34129d..1217586d 100644 --- a/src/resources/invoice-line-items.ts +++ b/src/resources/invoice-line-items.ts @@ -166,10 +166,15 @@ export namespace InvoiceLineItemCreateResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -188,6 +193,25 @@ export namespace InvoiceLineItemCreateResponse { usage_discount: number; } + export namespace MonetaryUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryAmountDiscountAdjustment { id: string; @@ -205,10 +229,15 @@ export namespace InvoiceLineItemCreateResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -221,6 +250,25 @@ export namespace InvoiceLineItemCreateResponse { reason: string | null; } + export namespace MonetaryAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryPercentageDiscountAdjustment { id: string; @@ -232,10 +280,15 @@ export namespace InvoiceLineItemCreateResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -254,6 +307,25 @@ export namespace InvoiceLineItemCreateResponse { reason: string | null; } + export namespace MonetaryPercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryMinimumAdjustment { id: string; @@ -265,10 +337,15 @@ export namespace InvoiceLineItemCreateResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -292,6 +369,25 @@ export namespace InvoiceLineItemCreateResponse { reason: string | null; } + export namespace MonetaryMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryMaximumAdjustment { id: string; @@ -303,10 +399,15 @@ export namespace InvoiceLineItemCreateResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -325,38 +426,105 @@ export namespace InvoiceLineItemCreateResponse { reason: string | null; } + export namespace MonetaryMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * @deprecated This field is deprecated in favor of `adjustments`. */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * @deprecated This field is deprecated in favor of `adjustments`. */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MatrixSubLineItem { /** * The total amount for this sub line item. diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts index a5c46012..7fdf0780 100644 --- a/src/resources/invoices.ts +++ b/src/resources/invoices.ts @@ -989,10 +989,15 @@ export namespace Invoice { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1011,6 +1016,25 @@ export namespace Invoice { usage_discount: number; } + export namespace MonetaryUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryAmountDiscountAdjustment { id: string; @@ -1028,10 +1052,15 @@ export namespace Invoice { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1044,6 +1073,25 @@ export namespace Invoice { reason: string | null; } + export namespace MonetaryAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryPercentageDiscountAdjustment { id: string; @@ -1055,10 +1103,15 @@ export namespace Invoice { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1077,6 +1130,25 @@ export namespace Invoice { reason: string | null; } + export namespace MonetaryPercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryMinimumAdjustment { id: string; @@ -1088,10 +1160,15 @@ export namespace Invoice { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1115,6 +1192,25 @@ export namespace Invoice { reason: string | null; } + export namespace MonetaryMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryMaximumAdjustment { id: string; @@ -1126,10 +1222,15 @@ export namespace Invoice { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1148,38 +1249,105 @@ export namespace Invoice { reason: string | null; } + export namespace MonetaryMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * @deprecated This field is deprecated in favor of `adjustments`. */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * @deprecated This field is deprecated in favor of `adjustments`. */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MatrixSubLineItem { /** * The total amount for this sub line item. @@ -1297,30 +1465,78 @@ export namespace Invoice { export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PaymentAttempt { /** * The ID of the payment attempt. @@ -2212,10 +2428,15 @@ export namespace InvoiceFetchUpcomingResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2234,6 +2455,25 @@ export namespace InvoiceFetchUpcomingResponse { usage_discount: number; } + export namespace MonetaryUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryAmountDiscountAdjustment { id: string; @@ -2251,10 +2491,15 @@ export namespace InvoiceFetchUpcomingResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2267,6 +2512,25 @@ export namespace InvoiceFetchUpcomingResponse { reason: string | null; } + export namespace MonetaryAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryPercentageDiscountAdjustment { id: string; @@ -2278,10 +2542,15 @@ export namespace InvoiceFetchUpcomingResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2300,6 +2569,25 @@ export namespace InvoiceFetchUpcomingResponse { reason: string | null; } + export namespace MonetaryPercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryMinimumAdjustment { id: string; @@ -2311,10 +2599,15 @@ export namespace InvoiceFetchUpcomingResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2338,6 +2631,25 @@ export namespace InvoiceFetchUpcomingResponse { reason: string | null; } + export namespace MonetaryMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MonetaryMaximumAdjustment { id: string; @@ -2349,10 +2661,15 @@ export namespace InvoiceFetchUpcomingResponse { amount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2371,38 +2688,105 @@ export namespace InvoiceFetchUpcomingResponse { reason: string | null; } + export namespace MonetaryMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * @deprecated This field is deprecated in favor of `adjustments`. */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * @deprecated This field is deprecated in favor of `adjustments`. */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MatrixSubLineItem { /** * The total amount for this sub line item. @@ -2520,30 +2904,78 @@ export namespace InvoiceFetchUpcomingResponse { export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PaymentAttempt { /** * The ID of the payment attempt. diff --git a/src/resources/items.ts b/src/resources/items.ts index eb351563..dd90085c 100644 --- a/src/resources/items.ts +++ b/src/resources/items.ts @@ -36,6 +36,13 @@ export class Items extends APIResource { return this._client.getAPIList('/items', ItemsPage, { query, ...options }); } + /** + * Archive item + */ + archive(itemId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.post(`/items/${itemId}/archive`, options); + } + /** * This endpoint returns an item identified by its item_id. */ @@ -58,6 +65,14 @@ export interface Item { external_connections: Array; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + name: string; } @@ -81,11 +96,25 @@ export interface ItemCreateParams { * The name of the item. */ name: 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; } export interface ItemUpdateParams { external_connections?: Array | 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; + name?: string | null; } diff --git a/src/resources/plans/external-plan-id.ts b/src/resources/plans/external-plan-id.ts index 53a4671e..395a2044 100644 --- a/src/resources/plans/external-plan-id.ts +++ b/src/resources/plans/external-plan-id.ts @@ -9,7 +9,7 @@ export class ExternalPlanID extends APIResource { * This endpoint can be used to update the `external_plan_id`, and `metadata` of an * existing plan. * - * Other fields on a customer are currently immutable. + * Other fields on a plan are currently immutable. */ update( otherExternalPlanId: string, diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index 6dd1204d..c215c916 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -23,7 +23,7 @@ export class Plans extends APIResource { * This endpoint can be used to update the `external_plan_id`, and `metadata` of an * existing plan. * - * Other fields on a customer are currently immutable. + * Other fields on a plan are currently immutable. */ update(planId: string, body: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.put(`/plans/${planId}`, { body, ...options }); @@ -119,6 +119,9 @@ export interface Plan { description: string; + /** + * @deprecated + */ discount: Shared.Discount | null; /** @@ -134,8 +137,14 @@ export interface Plan { */ invoicing_currency: string; + /** + * @deprecated + */ maximum: Plan.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -146,8 +155,14 @@ export interface Plan { */ metadata: Record; + /** + * @deprecated + */ minimum: Plan.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; name: string; @@ -185,10 +200,15 @@ export namespace Plan { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -212,6 +232,25 @@ export namespace Plan { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -224,10 +263,15 @@ export namespace Plan { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -245,16 +289,40 @@ export namespace Plan { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -278,16 +346,40 @@ export namespace Plan { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -316,16 +408,40 @@ export namespace Plan { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -349,6 +465,25 @@ export namespace Plan { reason: string | null; } + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface BasePlan { id: string | null; @@ -362,32 +497,86 @@ export namespace Plan { name: string | null; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhase { id: string; @@ -422,29 +611,77 @@ export namespace Plan { export namespace PlanPhase { export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface Product { @@ -501,6 +738,9 @@ export interface PlanCreateParams { | PlanCreateParams.NewPlanScalableMatrixWithUnitPricingPrice | PlanCreateParams.NewPlanScalableMatrixWithTieredPricingPrice | PlanCreateParams.NewPlanCumulativeGroupedBulkPrice + | PlanCreateParams.NewPlanTieredPackageWithMinimumPrice + | PlanCreateParams.NewPlanMatrixWithAllocationPrice + | PlanCreateParams.NewPlanGroupedTieredPrice >; /** @@ -581,6 +821,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -635,6 +880,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -701,6 +967,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -761,6 +1032,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -827,6 +1119,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -907,6 +1204,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -973,6 +1291,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1046,6 +1369,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1112,6 +1456,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1191,6 +1540,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1257,6 +1627,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1316,6 +1691,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1382,6 +1778,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1456,6 +1857,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1522,6 +1944,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1591,20 +2018,41 @@ export namespace PlanCreateParams { } /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; - } + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } export interface NewPlanThresholdTotalAmountPrice { @@ -1656,6 +2104,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1703,6 +2156,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1769,6 +2243,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1816,6 +2295,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1882,6 +2382,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -1929,6 +2434,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -1995,6 +2521,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2042,6 +2573,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2108,6 +2660,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2155,6 +2712,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2221,6 +2799,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2268,6 +2851,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2334,6 +2938,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2381,6 +2990,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2447,6 +3077,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2494,6 +3129,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2560,6 +3216,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2607,6 +3268,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2673,6 +3355,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2720,6 +3407,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2786,6 +3494,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2833,6 +3546,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -2899,6 +3633,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -2946,6 +3685,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -3012,6 +3772,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3059,6 +3824,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -3125,6 +3911,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3172,6 +3963,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -3238,6 +4050,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3285,6 +4102,27 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -3351,6 +4189,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3399,20 +4242,41 @@ export namespace PlanCreateParams { } /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; - } + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } export interface NewPlanCumulativeGroupedBulkPrice { @@ -3464,6 +4328,11 @@ export namespace PlanCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3511,6 +4380,482 @@ export namespace PlanCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanTieredPackageWithMinimumPrice { + /** + * 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_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_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?: NewPlanTieredPackageWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewPlanTieredPackageWithMinimumPrice.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 NewPlanTieredPackageWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanMatrixWithAllocationPrice { + /** + * 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_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_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?: NewPlanMatrixWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewPlanMatrixWithAllocationPrice.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 NewPlanMatrixWithAllocationPrice { + 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewPlanGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * 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?: NewPlanGroupedTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | 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?: NewPlanGroupedTieredPrice.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 NewPlanGroupedTieredPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. diff --git a/src/resources/prices/index.ts b/src/resources/prices/index.ts index bba41937..d04fff48 100644 --- a/src/resources/prices/index.ts +++ b/src/resources/prices/index.ts @@ -7,8 +7,10 @@ export { type EvaluatePriceGroup, type Price, type PriceEvaluateResponse, + type PriceEvaluateMultipleResponse, type PriceCreateParams, type PriceUpdateParams, type PriceListParams, type PriceEvaluateParams, + type PriceEvaluateMultipleParams, } from './prices'; diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index a6f6c617..b91d51cd 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; +import * as PricesAPI from './prices'; import * as Shared from '../shared'; import * as ExternalPriceIDAPI from './external-price-id'; import { ExternalPriceID, ExternalPriceIDUpdateParams } from './external-price-id'; @@ -13,7 +14,7 @@ export class Prices extends APIResource { /** * This endpoint is used to create a [price](/product-catalog/price-configuration). - * A price created using this endpoint is always an add-on, meaning that it’s not + * A price created using this endpoint is always an add-on, meaning that it's not * associated with a specific plan and can instead be individually added to * subscriptions, including subscriptions on different plans. * @@ -53,6 +54,10 @@ export class Prices extends APIResource { } /** + * [NOTE] It is recommended to use the `/v1/prices/evaluate` which offers further + * functionality, such as multiple prices, inline price definitions, and querying + * over preview events. + * * This endpoint is used to evaluate the output of a price for a given customer and * time range. It enables filtering and grouping the output using * [computed properties](/extensibility/advanced-metrics#computed-properties), @@ -83,6 +88,45 @@ export class Prices extends APIResource { return this._client.post(`/prices/${priceId}/evaluate`, { body, ...options }); } + /** + * This endpoint is used to evaluate the output of price(s) for a given customer + * and time range over either ingested events or preview events. It enables + * filtering and grouping the output using + * [computed properties](/extensibility/advanced-metrics#computed-properties), + * supporting the following workflows: + * + * 1. Showing detailed usage and costs to the end customer. + * 2. Auditing subtotals on invoice line items. + * + * Prices may either reference existing prices in your Orb account or be defined + * inline in the request body. Up to 100 prices can be evaluated in a single + * request. + * + * Price evaluation by default uses ingested events, but you can also provide a + * list of preview events to use instead. Up to 500 preview events can be provided + * in a single request. When using ingested events, the start of the time range + * must be no more than 100 days ago. + * + * For these workflows, the expressiveness of computed properties in both the + * filters and grouping is critical. For example, if you'd like to show your + * customer their usage grouped by hour and another property, you can do so with + * the following `grouping_keys`: + * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd + * like to examine a customer's usage for a specific property value, you can do so + * with the following `filter`: + * `my_property = 'foo' AND my_other_property = 'bar'`. + * + * The length of the results must be no greater than 1000. Note that this is a POST + * endpoint rather than a GET endpoint because it employs a JSON body rather than + * query parameters. + */ + evaluateMultiple( + body: PriceEvaluateMultipleParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post('/prices/evaluate', { body, ...options }); + } + /** * This endpoint returns a price given an identifier. */ @@ -170,6 +214,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -180,8 +227,14 @@ export namespace Price { item: UnitPrice.Item; + /** + * @deprecated + */ maximum: UnitPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -192,8 +245,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: UnitPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'unit'; @@ -224,6 +283,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -238,32 +307,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UnitConfig { /** * Rate per unit of usage @@ -295,6 +418,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -305,8 +431,14 @@ export namespace Price { item: PackagePrice.Item; + /** + * @deprecated + */ maximum: PackagePrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -317,8 +449,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: PackagePrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'package'; @@ -349,6 +487,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -363,32 +511,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PackageConfig { /** * A currency amount to rate usage by @@ -426,6 +628,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -438,8 +643,14 @@ export namespace Price { matrix_config: MatrixPrice.MatrixConfig; + /** + * @deprecated + */ maximum: MatrixPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -450,8 +661,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: MatrixPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'matrix'; @@ -480,6 +697,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -527,32 +754,86 @@ export namespace Price { } } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -577,6 +858,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -587,8 +871,14 @@ export namespace Price { item: TieredPrice.Item; + /** + * @deprecated + */ maximum: TieredPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -599,8 +889,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: TieredPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'tiered'; @@ -631,6 +927,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -645,32 +951,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface TieredConfig { /** * Tiers for rating based on total usage quantities into the specified tier @@ -721,6 +1081,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -731,8 +1094,14 @@ export namespace Price { item: TieredBpsPrice.Item; + /** + * @deprecated + */ maximum: TieredBpsPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -743,8 +1112,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: TieredBpsPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'tiered_bps'; @@ -775,6 +1150,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -789,41 +1174,95 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; /** - * Minimum amount applied + * The filters that determine which prices to apply this minimum to. */ - minimum_amount: string; - } + filters: Array; - export interface TieredBpsConfig { /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers + * Minimum amount applied */ - tiers: Array; + minimum_amount: string; } - export namespace TieredBpsConfig { + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + 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 @@ -873,6 +1312,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -883,8 +1325,14 @@ export namespace Price { item: BpsPrice.Item; + /** + * @deprecated + */ maximum: BpsPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -895,8 +1343,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: BpsPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'bps'; @@ -937,6 +1391,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -951,32 +1415,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1003,6 +1521,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1013,8 +1534,14 @@ export namespace Price { item: BulkBpsPrice.Item; + /** + * @deprecated + */ maximum: BulkBpsPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1025,8 +1552,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: BulkBpsPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'bulk_bps'; @@ -1082,6 +1615,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1096,32 +1639,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1148,6 +1745,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1158,8 +1758,14 @@ export namespace Price { item: BulkPrice.Item; + /** + * @deprecated + */ maximum: BulkPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1170,8 +1776,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: BulkPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'bulk'; @@ -1221,6 +1833,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1235,32 +1857,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1285,6 +1961,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1295,8 +1974,14 @@ export namespace Price { item: ThresholdTotalAmountPrice.Item; + /** + * @deprecated + */ maximum: ThresholdTotalAmountPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1307,8 +1992,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: ThresholdTotalAmountPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'threshold_total_amount'; @@ -1339,6 +2030,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1353,32 +2054,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1403,6 +2158,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1413,8 +2171,14 @@ export namespace Price { item: TieredPackagePrice.Item; + /** + * @deprecated + */ maximum: TieredPackagePrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1425,8 +2189,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: TieredPackagePrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'tiered_package'; @@ -1457,6 +2227,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1471,32 +2251,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1521,7 +2355,10 @@ export namespace Price { currency: string; - discount: Shared.Discount | null; + /** + * @deprecated + */ + discount: Shared.Discount | null; external_price_id: string | null; @@ -1533,8 +2370,14 @@ export namespace Price { item: GroupedTieredPrice.Item; + /** + * @deprecated + */ maximum: GroupedTieredPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1545,8 +2388,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: GroupedTieredPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'grouped_tiered'; @@ -1575,6 +2424,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1589,32 +2448,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1639,6 +2552,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1649,8 +2565,14 @@ export namespace Price { item: TieredWithMinimumPrice.Item; + /** + * @deprecated + */ maximum: TieredWithMinimumPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1661,8 +2583,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: TieredWithMinimumPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'tiered_with_minimum'; @@ -1693,6 +2621,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1707,32 +2645,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1757,6 +2749,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1767,8 +2762,14 @@ export namespace Price { item: TieredPackageWithMinimumPrice.Item; + /** + * @deprecated + */ maximum: TieredPackageWithMinimumPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1779,8 +2780,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: TieredPackageWithMinimumPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'tiered_package_with_minimum'; @@ -1811,6 +2818,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1825,32 +2842,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1875,6 +2946,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -1885,8 +2959,14 @@ export namespace Price { item: PackageWithAllocationPrice.Item; + /** + * @deprecated + */ maximum: PackageWithAllocationPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -1897,8 +2977,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: PackageWithAllocationPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'package_with_allocation'; @@ -1929,6 +3015,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -1943,32 +3039,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -1993,6 +3143,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2003,8 +3156,14 @@ export namespace Price { item: UnitWithPercentPrice.Item; + /** + * @deprecated + */ maximum: UnitWithPercentPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2015,8 +3174,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: UnitWithPercentPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'unit_with_percent'; @@ -2047,6 +3212,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2061,32 +3236,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2111,6 +3340,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2123,8 +3355,14 @@ export namespace Price { matrix_with_allocation_config: MatrixWithAllocationPrice.MatrixWithAllocationConfig; + /** + * @deprecated + */ maximum: MatrixWithAllocationPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2135,8 +3373,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: MatrixWithAllocationPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'matrix_with_allocation'; @@ -2165,6 +3409,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2217,32 +3471,86 @@ export namespace Price { } } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2267,6 +3575,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2277,8 +3588,14 @@ export namespace Price { item: TieredWithProrationPrice.Item; + /** + * @deprecated + */ maximum: TieredWithProrationPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2289,8 +3606,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: TieredWithProrationPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'tiered_with_proration'; @@ -2321,6 +3644,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2335,32 +3668,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2385,6 +3772,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2395,8 +3785,14 @@ export namespace Price { item: UnitWithProrationPrice.Item; + /** + * @deprecated + */ maximum: UnitWithProrationPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2407,8 +3803,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: UnitWithProrationPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'unit_with_proration'; @@ -2439,6 +3841,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2453,32 +3865,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2503,6 +3969,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2515,8 +3984,14 @@ export namespace Price { item: GroupedAllocationPrice.Item; + /** + * @deprecated + */ maximum: GroupedAllocationPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2527,8 +4002,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: GroupedAllocationPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'grouped_allocation'; @@ -2557,6 +4038,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2571,32 +4062,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2621,6 +4166,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2633,8 +4181,14 @@ export namespace Price { item: GroupedWithProratedMinimumPrice.Item; + /** + * @deprecated + */ maximum: GroupedWithProratedMinimumPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2645,8 +4199,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: GroupedWithProratedMinimumPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'grouped_with_prorated_minimum'; @@ -2675,6 +4235,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2689,32 +4259,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2739,6 +4363,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2751,8 +4378,14 @@ export namespace Price { item: GroupedWithMeteredMinimumPrice.Item; + /** + * @deprecated + */ maximum: GroupedWithMeteredMinimumPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2763,8 +4396,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: GroupedWithMeteredMinimumPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'grouped_with_metered_minimum'; @@ -2793,6 +4432,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2807,36 +4456,90 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } - export interface DimensionalPriceConfiguration { - dimension_values: Array; + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - dimensional_price_group_id: string; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface DimensionalPriceConfiguration { + dimension_values: Array; + + dimensional_price_group_id: string; } } @@ -2857,6 +4560,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2869,8 +4575,14 @@ export namespace Price { matrix_with_display_name_config: Record; + /** + * @deprecated + */ maximum: MatrixWithDisplayNamePrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2881,8 +4593,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: MatrixWithDisplayNamePrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'matrix_with_display_name'; @@ -2911,6 +4629,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -2925,32 +4653,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -2977,6 +4759,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -2987,8 +4772,14 @@ export namespace Price { item: BulkWithProrationPrice.Item; + /** + * @deprecated + */ maximum: BulkWithProrationPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -2999,8 +4790,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: BulkWithProrationPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'bulk_with_proration'; @@ -3029,6 +4826,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -3043,32 +4850,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -3093,6 +4954,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -3105,8 +4969,14 @@ export namespace Price { item: GroupedTieredPackagePrice.Item; + /** + * @deprecated + */ maximum: GroupedTieredPackagePrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -3117,8 +4987,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: GroupedTieredPackagePrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'grouped_tiered_package'; @@ -3147,6 +5023,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -3161,32 +5047,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -3211,6 +5151,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -3223,8 +5166,14 @@ export namespace Price { max_group_tiered_package_config: Record; + /** + * @deprecated + */ maximum: MaxGroupTieredPackagePrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -3235,8 +5184,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: MaxGroupTieredPackagePrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'max_group_tiered_package'; @@ -3265,6 +5220,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -3279,32 +5244,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -3329,6 +5348,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -3339,8 +5361,14 @@ export namespace Price { item: ScalableMatrixWithUnitPricingPrice.Item; + /** + * @deprecated + */ maximum: ScalableMatrixWithUnitPricingPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -3351,8 +5379,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: ScalableMatrixWithUnitPricingPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'scalable_matrix_with_unit_pricing'; @@ -3383,6 +5417,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -3397,32 +5441,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -3447,6 +5545,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -3457,8 +5558,14 @@ export namespace Price { item: ScalableMatrixWithTieredPricingPrice.Item; + /** + * @deprecated + */ maximum: ScalableMatrixWithTieredPricingPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -3469,9 +5576,15 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: ScalableMatrixWithTieredPricingPrice.Minimum | null; - minimum_amount: string | null; + /** + * @deprecated + */ + minimum_amount: string | null; model_type: 'scalable_matrix_with_tiered_pricing'; @@ -3501,6 +5614,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -3515,32 +5638,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -3567,6 +5744,9 @@ export namespace Price { currency: string; + /** + * @deprecated + */ discount: Shared.Discount | null; external_price_id: string | null; @@ -3577,8 +5757,14 @@ export namespace Price { item: CumulativeGroupedBulkPrice.Item; + /** + * @deprecated + */ maximum: CumulativeGroupedBulkPrice.Maximum | null; + /** + * @deprecated + */ maximum_amount: string | null; /** @@ -3589,8 +5775,14 @@ export namespace Price { */ metadata: Record; + /** + * @deprecated + */ minimum: CumulativeGroupedBulkPrice.Minimum | null; + /** + * @deprecated + */ minimum_amount: string | null; model_type: 'cumulative_grouped_bulk'; @@ -3619,6 +5811,16 @@ export namespace Price { allows_rollover: boolean; currency: string; + + custom_expiration: CreditAllocation.CustomExpiration | null; + } + + export namespace CreditAllocation { + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface InvoicingCycleConfiguration { @@ -3633,32 +5835,86 @@ export namespace Price { name: string; } + /** + * @deprecated + */ export interface Maximum { /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + /** * Maximum amount applied */ maximum_amount: string; } + export namespace Maximum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * @deprecated + */ export interface Minimum { /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + /** * Minimum amount applied */ minimum_amount: string; } + export namespace Minimum { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface DimensionalPriceConfiguration { dimension_values: Array; @@ -3671,6 +5927,34 @@ export interface PriceEvaluateResponse { data: Array; } +export interface PriceEvaluateMultipleResponse { + data: Array; +} + +export namespace PriceEvaluateMultipleResponse { + export interface Data { + /** + * The currency of the price + */ + currency: string; + + /** + * The computed price groups associated with input price. + */ + price_groups: Array; + + /** + * The index of the inline price + */ + inline_price_index?: number | null; + + /** + * The ID of the price + */ + price_id?: string | null; + } +} + export type PriceCreateParams = | PriceCreateParams.NewFloatingUnitPrice | PriceCreateParams.NewFloatingPackagePrice @@ -3750,6 +6034,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3804,6 +6093,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -3869,6 +6179,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -3929,6 +6244,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -3994,6 +6330,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4074,6 +6415,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -4139,6 +6501,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4224,6 +6591,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -4289,6 +6677,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4362,6 +6755,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -4427,6 +6841,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4506,6 +6925,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -4571,6 +7011,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4630,6 +7075,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -4695,6 +7161,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4769,6 +7240,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -4834,6 +7326,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -4903,21 +7400,42 @@ export declare namespace PriceCreateParams { } /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } export interface NewFloatingThresholdTotalAmountPrice { /** @@ -4967,6 +7485,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5014,6 +7537,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5079,6 +7623,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5126,6 +7675,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5191,6 +7761,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5238,6 +7813,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5303,6 +7899,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5350,6 +7951,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5415,6 +8037,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5462,6 +8089,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5527,6 +8175,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5574,6 +8227,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5639,6 +8313,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5686,6 +8365,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5751,6 +8451,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5798,6 +8503,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5863,6 +8589,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -5910,6 +8641,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -5975,6 +8727,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6022,6 +8779,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6087,6 +8865,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6134,6 +8917,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6199,6 +9003,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6246,6 +9055,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6311,6 +9141,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6358,6 +9193,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6423,6 +9279,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6470,6 +9331,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6536,7 +9418,12 @@ export declare namespace PriceCreateParams { conversion_rate?: number | null; /** - * An alias for the price. + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkWithProrationPrice.DimensionalPriceConfiguration | null; + + /** + * An alias for the price. */ external_price_id?: string | null; @@ -6582,6 +9469,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6647,6 +9555,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6694,6 +9607,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6759,6 +9693,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6806,6 +9745,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6871,6 +9831,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -6918,6 +9883,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -6983,6 +9969,11 @@ export declare namespace PriceCreateParams { */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -7030,6 +10021,27 @@ export declare namespace PriceCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -7095,6 +10107,4202 @@ export interface PriceEvaluateParams { grouping_keys?: Array; } +export interface PriceEvaluateMultipleParams { + /** + * The exclusive upper bound for event timestamps + */ + timeframe_end: string; + + /** + * The inclusive lower bound for event timestamps + */ + timeframe_start: string; + + /** + * The ID of the customer to which this evaluation is scoped. + */ + customer_id?: string | null; + + /** + * Optional list of preview events to use instead of actual usage data (max 500) + */ + events?: Array | null; + + /** + * The external customer ID of the customer to which this evaluation is scoped. + */ + external_customer_id?: string | null; + + /** + * List of prices to evaluate (max 100) + */ + price_evaluations?: Array; +} + +export namespace PriceEvaluateMultipleParams { + export interface Event { + /** + * A name to meaningfully identify the action or event type. + */ + event_name: string; + + /** + * A dictionary of custom properties. Values in this dictionary must be numeric, + * boolean, or strings. Nested dictionaries are disallowed. + */ + properties: unknown; + + /** + * An ISO 8601 format date with no timezone offset (i.e. UTC). This should + * represent the time that usage was recorded, and is particularly important to + * attribute usage to a given billing period. + */ + timestamp: string; + + /** + * The Orb Customer identifier + */ + customer_id?: string | null; + + /** + * An alias for the Orb customer, whose mapping is specified when creating the + * customer + */ + external_customer_id?: string | null; + } + + export interface PriceEvaluation { + /** + * A boolean + * [computed property](/extensibility/advanced-metrics#computed-properties) used to + * filter the underlying billable metric + */ + filter?: string | null; + + /** + * Properties (or + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used + * to group the underlying billable metric + */ + grouping_keys?: Array; + + /** + * An inline price definition to evaluate, allowing you to test price + * configurations before adding them to Orb. + */ + price?: + | PriceEvaluation.NewFloatingUnitPrice + | PriceEvaluation.NewFloatingPackagePrice + | PriceEvaluation.NewFloatingMatrixPrice + | PriceEvaluation.NewFloatingMatrixWithAllocationPrice + | PriceEvaluation.NewFloatingTieredPrice + | PriceEvaluation.NewFloatingTieredBpsPrice + | PriceEvaluation.NewFloatingBpsPrice + | PriceEvaluation.NewFloatingBulkBpsPrice + | PriceEvaluation.NewFloatingBulkPrice + | PriceEvaluation.NewFloatingThresholdTotalAmountPrice + | PriceEvaluation.NewFloatingTieredPackagePrice + | PriceEvaluation.NewFloatingGroupedTieredPrice + | PriceEvaluation.NewFloatingMaxGroupTieredPackagePrice + | PriceEvaluation.NewFloatingTieredWithMinimumPrice + | PriceEvaluation.NewFloatingPackageWithAllocationPrice + | PriceEvaluation.NewFloatingTieredPackageWithMinimumPrice + | PriceEvaluation.NewFloatingUnitWithPercentPrice + | PriceEvaluation.NewFloatingTieredWithProrationPrice + | PriceEvaluation.NewFloatingUnitWithProrationPrice + | PriceEvaluation.NewFloatingGroupedAllocationPrice + | PriceEvaluation.NewFloatingGroupedWithProratedMinimumPrice + | PriceEvaluation.NewFloatingGroupedWithMeteredMinimumPrice + | PriceEvaluation.NewFloatingMatrixWithDisplayNamePrice + | PriceEvaluation.NewFloatingBulkWithProrationPrice + | PriceEvaluation.NewFloatingGroupedTieredPackagePrice + | PriceEvaluation.NewFloatingScalableMatrixWithUnitPricingPrice + | PriceEvaluation.NewFloatingScalableMatrixWithTieredPricingPrice + | PriceEvaluation.NewFloatingCumulativeGroupedBulkPrice + | null; + + /** + * The ID of a price to evaluate that exists in your Orb account. + */ + price_id?: string | null; + } + + export namespace PriceEvaluation { + export interface NewFloatingUnitPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * 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: NewFloatingUnitPrice.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?: NewFloatingUnitPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitPrice.DimensionalPriceConfiguration | 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?: NewFloatingUnitPrice.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 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. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingPackagePrice { + /** + * 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'; + + /** + * The name of the price. + */ + name: string; + + package_config: NewFloatingPackagePrice.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?: NewFloatingPackagePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingPackagePrice.DimensionalPriceConfiguration | 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?: NewFloatingPackagePrice.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 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingMatrixPrice { + /** + * 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_config: NewFloatingMatrixPrice.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?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixPrice.DimensionalPriceConfiguration | 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?: NewFloatingMatrixPrice.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 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingMatrixWithAllocationPrice { + /** + * 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_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_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?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewFloatingMatrixWithAllocationPrice.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 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingTieredPrice { + /** + * 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'; + + /** + * 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. + */ + 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?: NewFloatingTieredPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPrice.DimensionalPriceConfiguration | 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?: NewFloatingTieredPrice.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 NewFloatingTieredPrice { + export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingTieredBpsPrice { + /** + * 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'; + + /** + * 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. + */ + 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?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredBpsPrice.DimensionalPriceConfiguration | 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?: NewFloatingTieredBpsPrice.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 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingBpsPrice { + bps_config: NewFloatingBpsPrice.BpsConfig; + + /** + * 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'; + + /** + * 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?: NewFloatingBpsPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBpsPrice.DimensionalPriceConfiguration | 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?: NewFloatingBpsPrice.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 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingBulkBpsPrice { + bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; + + /** + * 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_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?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkBpsPrice.DimensionalPriceConfiguration | 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?: NewFloatingBulkBpsPrice.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 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingBulkPrice { + bulk_config: NewFloatingBulkPrice.BulkConfig; + + /** + * 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'; + + /** + * 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?: NewFloatingBulkPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkPrice.DimensionalPriceConfiguration | 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?: NewFloatingBulkPrice.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 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. + */ + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingThresholdTotalAmountPrice { + /** + * 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: '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?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingThresholdTotalAmountPrice.DimensionalPriceConfiguration | 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?: NewFloatingThresholdTotalAmountPrice.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 NewFloatingThresholdTotalAmountPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingTieredPackagePrice { + /** + * 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'; + + /** + * 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?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewFloatingTieredPackagePrice.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 NewFloatingTieredPackagePrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingGroupedTieredPrice { + /** + * 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; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * 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?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedTieredPrice.DimensionalPriceConfiguration | 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?: NewFloatingGroupedTieredPrice.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 NewFloatingGroupedTieredPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + 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; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_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?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | 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?: NewFloatingMaxGroupTieredPackagePrice.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 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 unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingTieredWithMinimumPrice { + /** + * 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_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?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewFloatingTieredWithMinimumPrice.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 NewFloatingTieredWithMinimumPrice { + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingPackageWithAllocationPrice { + /** + * 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_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. + */ + 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?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingPackageWithAllocationPrice.DimensionalPriceConfiguration | 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?: NewFloatingPackageWithAllocationPrice.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 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 unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingTieredPackageWithMinimumPrice { + /** + * 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_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_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?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | 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?: NewFloatingTieredPackageWithMinimumPrice.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 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewFloatingUnitWithPercentPrice { + /** + * 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_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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitWithPercentPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredWithProrationPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitWithProrationPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedAllocationPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkWithProrationPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedTieredPackagePrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + } +} + Prices.PricesPage = PricesPage; Prices.ExternalPriceID = ExternalPriceID; @@ -7103,11 +14311,13 @@ export declare namespace Prices { type EvaluatePriceGroup as EvaluatePriceGroup, type Price as Price, type PriceEvaluateResponse as PriceEvaluateResponse, + type PriceEvaluateMultipleResponse as PriceEvaluateMultipleResponse, PricesPage as PricesPage, type PriceCreateParams as PriceCreateParams, type PriceUpdateParams as PriceUpdateParams, type PriceListParams as PriceListParams, type PriceEvaluateParams as PriceEvaluateParams, + type PriceEvaluateMultipleParams as PriceEvaluateMultipleParams, }; export { diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 1c9387b6..4086be64 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -6,13 +6,13 @@ export interface AmountDiscount { */ amount_discount: string; + discount_type: 'amount'; + /** * 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: 'amount'; + applies_to_price_ids?: Array | null; reason?: string | null; } @@ -30,12 +30,6 @@ export interface PaginationMetadata { } export interface PercentageDiscount { - /** - * 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: 'percentage'; /** @@ -44,17 +38,23 @@ export interface PercentageDiscount { */ percentage_discount: number; + /** + * 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 | null; + reason?: string | null; } export interface TrialDiscount { + discount_type: 'trial'; + /** * 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: 'trial'; + applies_to_price_ids?: Array | null; reason?: string | null; @@ -70,12 +70,6 @@ export interface TrialDiscount { } 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'; /** @@ -84,5 +78,11 @@ export interface UsageDiscount { */ usage_discount: number; + /** + * 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 | null; + reason?: string | null; } diff --git a/src/resources/subscription-changes.ts b/src/resources/subscription-changes.ts index 180a5562..ad1bc4cb 100644 --- a/src/resources/subscription-changes.ts +++ b/src/resources/subscription-changes.ts @@ -173,7 +173,8 @@ export namespace SubscriptionChangeRetrieveResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | Subscription.AmountDiscountInterval @@ -191,7 +192,8 @@ export namespace SubscriptionChangeRetrieveResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -204,10 +206,16 @@ export namespace SubscriptionChangeRetrieveResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -227,7 +235,7 @@ export namespace SubscriptionChangeRetrieveResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -287,10 +295,15 @@ export namespace SubscriptionChangeRetrieveResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -314,6 +327,25 @@ export namespace SubscriptionChangeRetrieveResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -326,10 +358,15 @@ export namespace SubscriptionChangeRetrieveResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -347,16 +384,40 @@ export namespace SubscriptionChangeRetrieveResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -380,16 +441,40 @@ export namespace SubscriptionChangeRetrieveResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -418,16 +503,40 @@ export namespace SubscriptionChangeRetrieveResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -450,6 +559,25 @@ export namespace SubscriptionChangeRetrieveResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -481,11 +609,6 @@ export namespace SubscriptionChangeRetrieveResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -498,18 +621,37 @@ export namespace SubscriptionChangeRetrieveResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -522,6 +664,11 @@ export namespace SubscriptionChangeRetrieveResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -534,12 +681,26 @@ export namespace SubscriptionChangeRetrieveResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -552,6 +713,11 @@ export namespace SubscriptionChangeRetrieveResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -564,6 +730,25 @@ export namespace SubscriptionChangeRetrieveResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -575,11 +760,6 @@ export namespace SubscriptionChangeRetrieveResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -590,6 +770,11 @@ export namespace SubscriptionChangeRetrieveResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -602,12 +787,26 @@ export namespace SubscriptionChangeRetrieveResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -618,6 +817,11 @@ export namespace SubscriptionChangeRetrieveResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -630,6 +834,25 @@ export namespace SubscriptionChangeRetrieveResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -866,7 +1089,8 @@ export namespace SubscriptionChangeApplyResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | Subscription.AmountDiscountInterval @@ -884,7 +1108,8 @@ export namespace SubscriptionChangeApplyResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -897,10 +1122,16 @@ export namespace SubscriptionChangeApplyResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -920,7 +1151,7 @@ export namespace SubscriptionChangeApplyResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -980,10 +1211,15 @@ export namespace SubscriptionChangeApplyResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1007,6 +1243,25 @@ export namespace SubscriptionChangeApplyResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -1019,10 +1274,15 @@ export namespace SubscriptionChangeApplyResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1040,16 +1300,40 @@ export namespace SubscriptionChangeApplyResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1073,16 +1357,40 @@ export namespace SubscriptionChangeApplyResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1111,16 +1419,40 @@ export namespace SubscriptionChangeApplyResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1143,6 +1475,25 @@ export namespace SubscriptionChangeApplyResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -1174,11 +1525,6 @@ export namespace SubscriptionChangeApplyResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -1191,18 +1537,37 @@ export namespace SubscriptionChangeApplyResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -1215,6 +1580,11 @@ export namespace SubscriptionChangeApplyResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -1227,12 +1597,26 @@ export namespace SubscriptionChangeApplyResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -1245,6 +1629,11 @@ export namespace SubscriptionChangeApplyResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -1257,6 +1646,25 @@ export namespace SubscriptionChangeApplyResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -1268,11 +1676,6 @@ export namespace SubscriptionChangeApplyResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -1283,6 +1686,11 @@ export namespace SubscriptionChangeApplyResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -1295,12 +1703,26 @@ export namespace SubscriptionChangeApplyResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -1311,6 +1733,11 @@ export namespace SubscriptionChangeApplyResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -1323,6 +1750,25 @@ export namespace SubscriptionChangeApplyResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -1559,7 +2005,8 @@ export namespace SubscriptionChangeCancelResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | Subscription.AmountDiscountInterval @@ -1577,7 +2024,8 @@ export namespace SubscriptionChangeCancelResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -1590,10 +2038,16 @@ export namespace SubscriptionChangeCancelResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -1613,7 +2067,7 @@ export namespace SubscriptionChangeCancelResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -1673,10 +2127,15 @@ export namespace SubscriptionChangeCancelResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1700,6 +2159,25 @@ export namespace SubscriptionChangeCancelResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -1712,10 +2190,15 @@ export namespace SubscriptionChangeCancelResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1733,16 +2216,40 @@ export namespace SubscriptionChangeCancelResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1766,16 +2273,40 @@ export namespace SubscriptionChangeCancelResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1804,16 +2335,40 @@ export namespace SubscriptionChangeCancelResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1836,6 +2391,25 @@ export namespace SubscriptionChangeCancelResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -1867,11 +2441,6 @@ export namespace SubscriptionChangeCancelResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -1884,18 +2453,37 @@ export namespace SubscriptionChangeCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -1908,6 +2496,11 @@ export namespace SubscriptionChangeCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -1920,12 +2513,26 @@ export namespace SubscriptionChangeCancelResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -1938,6 +2545,11 @@ export namespace SubscriptionChangeCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -1950,6 +2562,25 @@ export namespace SubscriptionChangeCancelResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -1961,11 +2592,6 @@ export namespace SubscriptionChangeCancelResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -1976,6 +2602,11 @@ export namespace SubscriptionChangeCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -1988,12 +2619,26 @@ export namespace SubscriptionChangeCancelResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -2004,6 +2649,11 @@ export namespace SubscriptionChangeCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -2016,6 +2666,25 @@ export namespace SubscriptionChangeCancelResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index e43319ba..f79610d6 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -1159,7 +1159,8 @@ export interface Subscription { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | Subscription.AmountDiscountInterval @@ -1177,7 +1178,8 @@ export interface Subscription { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -1190,10 +1192,16 @@ export interface Subscription { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -1213,7 +1221,7 @@ export interface Subscription { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -1266,10 +1274,15 @@ export namespace Subscription { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1293,6 +1306,25 @@ export namespace Subscription { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -1305,10 +1337,15 @@ export namespace Subscription { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1326,16 +1363,40 @@ export namespace Subscription { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1359,16 +1420,40 @@ export namespace Subscription { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1397,16 +1482,40 @@ export namespace Subscription { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -1429,6 +1538,25 @@ export namespace Subscription { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -1460,11 +1588,6 @@ export namespace Subscription { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -1477,18 +1600,37 @@ export namespace Subscription { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -1501,6 +1643,11 @@ export namespace Subscription { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -1513,12 +1660,26 @@ export namespace Subscription { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -1531,6 +1692,11 @@ export namespace Subscription { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -1543,6 +1709,25 @@ export namespace Subscription { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -1554,11 +1739,6 @@ export namespace Subscription { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -1569,6 +1749,11 @@ export namespace Subscription { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -1581,12 +1766,26 @@ export namespace Subscription { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -1597,6 +1796,11 @@ export namespace Subscription { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -1609,6 +1813,25 @@ export namespace Subscription { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -1869,7 +2092,8 @@ export interface SubscriptionCreateResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionCreateResponse.AmountDiscountInterval @@ -1887,7 +2111,8 @@ export interface SubscriptionCreateResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -1900,10 +2125,16 @@ export interface SubscriptionCreateResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -1923,7 +2154,7 @@ export interface SubscriptionCreateResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -1983,10 +2214,15 @@ export namespace SubscriptionCreateResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2010,6 +2246,25 @@ export namespace SubscriptionCreateResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -2022,10 +2277,15 @@ export namespace SubscriptionCreateResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2043,16 +2303,40 @@ export namespace SubscriptionCreateResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2076,16 +2360,40 @@ export namespace SubscriptionCreateResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2114,16 +2422,40 @@ export namespace SubscriptionCreateResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2146,6 +2478,25 @@ export namespace SubscriptionCreateResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -2177,11 +2528,6 @@ export namespace SubscriptionCreateResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -2194,18 +2540,37 @@ export namespace SubscriptionCreateResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -2218,6 +2583,11 @@ export namespace SubscriptionCreateResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -2230,12 +2600,26 @@ export namespace SubscriptionCreateResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -2248,6 +2632,11 @@ export namespace SubscriptionCreateResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -2260,6 +2649,25 @@ export namespace SubscriptionCreateResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -2271,11 +2679,6 @@ export namespace SubscriptionCreateResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -2286,6 +2689,11 @@ export namespace SubscriptionCreateResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -2298,12 +2706,26 @@ export namespace SubscriptionCreateResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -2314,6 +2736,11 @@ export namespace SubscriptionCreateResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -2326,6 +2753,25 @@ export namespace SubscriptionCreateResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -2531,7 +2977,8 @@ export interface SubscriptionCancelResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionCancelResponse.AmountDiscountInterval @@ -2549,7 +2996,8 @@ export interface SubscriptionCancelResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -2562,10 +3010,16 @@ export interface SubscriptionCancelResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -2585,7 +3039,7 @@ export interface SubscriptionCancelResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -2645,10 +3099,15 @@ export namespace SubscriptionCancelResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2672,6 +3131,25 @@ export namespace SubscriptionCancelResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -2684,10 +3162,15 @@ export namespace SubscriptionCancelResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2705,16 +3188,40 @@ export namespace SubscriptionCancelResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2738,16 +3245,40 @@ export namespace SubscriptionCancelResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2776,16 +3307,40 @@ export namespace SubscriptionCancelResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -2808,6 +3363,25 @@ export namespace SubscriptionCancelResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -2839,11 +3413,6 @@ export namespace SubscriptionCancelResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -2856,18 +3425,37 @@ export namespace SubscriptionCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -2880,6 +3468,11 @@ export namespace SubscriptionCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -2892,12 +3485,26 @@ export namespace SubscriptionCancelResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -2910,6 +3517,11 @@ export namespace SubscriptionCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -2922,6 +3534,25 @@ export namespace SubscriptionCancelResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -2933,11 +3564,6 @@ export namespace SubscriptionCancelResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -2948,6 +3574,11 @@ export namespace SubscriptionCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -2960,12 +3591,26 @@ export namespace SubscriptionCancelResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -2976,6 +3621,11 @@ export namespace SubscriptionCancelResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -2988,6 +3638,25 @@ export namespace SubscriptionCancelResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -3174,7 +3843,7 @@ export interface SubscriptionFetchScheduleResponse { end_date: string | null; - plan: SubscriptionFetchScheduleResponse.Plan; + plan: SubscriptionFetchScheduleResponse.Plan | null; start_date: string; } @@ -3271,7 +3940,8 @@ export interface SubscriptionPriceIntervalsResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionPriceIntervalsResponse.AmountDiscountInterval @@ -3289,7 +3959,8 @@ export interface SubscriptionPriceIntervalsResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -3302,10 +3973,16 @@ export interface SubscriptionPriceIntervalsResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -3325,7 +4002,7 @@ export interface SubscriptionPriceIntervalsResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -3385,10 +4062,15 @@ export namespace SubscriptionPriceIntervalsResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -3412,6 +4094,25 @@ export namespace SubscriptionPriceIntervalsResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -3424,10 +4125,15 @@ export namespace SubscriptionPriceIntervalsResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -3445,16 +4151,40 @@ export namespace SubscriptionPriceIntervalsResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -3478,16 +4208,40 @@ export namespace SubscriptionPriceIntervalsResponse { reason: string | null; } - export interface PlanPhaseMinimumAdjustment { - id: string; + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PlanPhaseMinimumAdjustment { + id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -3516,16 +4270,40 @@ export namespace SubscriptionPriceIntervalsResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -3548,6 +4326,25 @@ export namespace SubscriptionPriceIntervalsResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -3579,11 +4376,6 @@ export namespace SubscriptionPriceIntervalsResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -3596,18 +4388,37 @@ export namespace SubscriptionPriceIntervalsResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -3620,6 +4431,11 @@ export namespace SubscriptionPriceIntervalsResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -3632,12 +4448,26 @@ export namespace SubscriptionPriceIntervalsResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -3650,6 +4480,11 @@ export namespace SubscriptionPriceIntervalsResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -3662,6 +4497,25 @@ export namespace SubscriptionPriceIntervalsResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -3673,11 +4527,6 @@ export namespace SubscriptionPriceIntervalsResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -3688,6 +4537,11 @@ export namespace SubscriptionPriceIntervalsResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -3700,12 +4554,26 @@ export namespace SubscriptionPriceIntervalsResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -3716,6 +4584,11 @@ export namespace SubscriptionPriceIntervalsResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -3728,6 +4601,25 @@ export namespace SubscriptionPriceIntervalsResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -3933,7 +4825,8 @@ export interface SubscriptionSchedulePlanChangeResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionSchedulePlanChangeResponse.AmountDiscountInterval @@ -3951,7 +4844,8 @@ export interface SubscriptionSchedulePlanChangeResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -3964,10 +4858,16 @@ export interface SubscriptionSchedulePlanChangeResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -3987,7 +4887,7 @@ export interface SubscriptionSchedulePlanChangeResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -4047,10 +4947,15 @@ export namespace SubscriptionSchedulePlanChangeResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4074,6 +4979,25 @@ export namespace SubscriptionSchedulePlanChangeResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -4086,10 +5010,15 @@ export namespace SubscriptionSchedulePlanChangeResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4107,16 +5036,40 @@ export namespace SubscriptionSchedulePlanChangeResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4140,16 +5093,40 @@ export namespace SubscriptionSchedulePlanChangeResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4178,16 +5155,40 @@ export namespace SubscriptionSchedulePlanChangeResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4210,6 +5211,25 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -4241,11 +5261,6 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -4258,18 +5273,37 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -4282,6 +5316,11 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -4294,12 +5333,26 @@ export namespace SubscriptionSchedulePlanChangeResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -4312,6 +5365,11 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -4324,6 +5382,25 @@ export namespace SubscriptionSchedulePlanChangeResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -4335,11 +5412,6 @@ export namespace SubscriptionSchedulePlanChangeResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -4350,6 +5422,11 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -4362,12 +5439,26 @@ export namespace SubscriptionSchedulePlanChangeResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -4378,6 +5469,11 @@ export namespace SubscriptionSchedulePlanChangeResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -4390,6 +5486,25 @@ export namespace SubscriptionSchedulePlanChangeResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -4595,7 +5710,8 @@ export interface SubscriptionTriggerPhaseResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionTriggerPhaseResponse.AmountDiscountInterval @@ -4613,7 +5729,8 @@ export interface SubscriptionTriggerPhaseResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -4626,10 +5743,16 @@ export interface SubscriptionTriggerPhaseResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -4649,7 +5772,7 @@ export interface SubscriptionTriggerPhaseResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -4709,10 +5832,15 @@ export namespace SubscriptionTriggerPhaseResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4736,6 +5864,25 @@ export namespace SubscriptionTriggerPhaseResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -4748,10 +5895,15 @@ export namespace SubscriptionTriggerPhaseResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4769,16 +5921,40 @@ export namespace SubscriptionTriggerPhaseResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4802,16 +5978,40 @@ export namespace SubscriptionTriggerPhaseResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4840,16 +6040,40 @@ export namespace SubscriptionTriggerPhaseResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -4872,6 +6096,25 @@ export namespace SubscriptionTriggerPhaseResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -4903,11 +6146,6 @@ export namespace SubscriptionTriggerPhaseResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -4920,18 +6158,37 @@ export namespace SubscriptionTriggerPhaseResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -4944,6 +6201,11 @@ export namespace SubscriptionTriggerPhaseResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -4956,12 +6218,26 @@ export namespace SubscriptionTriggerPhaseResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -4974,6 +6250,11 @@ export namespace SubscriptionTriggerPhaseResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -4986,6 +6267,25 @@ export namespace SubscriptionTriggerPhaseResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -4997,11 +6297,6 @@ export namespace SubscriptionTriggerPhaseResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -5012,6 +6307,11 @@ export namespace SubscriptionTriggerPhaseResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -5024,12 +6324,26 @@ export namespace SubscriptionTriggerPhaseResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -5040,6 +6354,11 @@ export namespace SubscriptionTriggerPhaseResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -5052,6 +6371,25 @@ export namespace SubscriptionTriggerPhaseResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -5257,7 +6595,8 @@ export interface SubscriptionUnscheduleCancellationResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionUnscheduleCancellationResponse.AmountDiscountInterval @@ -5275,7 +6614,8 @@ export interface SubscriptionUnscheduleCancellationResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -5288,10 +6628,16 @@ export interface SubscriptionUnscheduleCancellationResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -5311,7 +6657,7 @@ export interface SubscriptionUnscheduleCancellationResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -5371,10 +6717,15 @@ export namespace SubscriptionUnscheduleCancellationResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -5398,6 +6749,25 @@ export namespace SubscriptionUnscheduleCancellationResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -5410,10 +6780,15 @@ export namespace SubscriptionUnscheduleCancellationResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -5431,16 +6806,40 @@ export namespace SubscriptionUnscheduleCancellationResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -5464,16 +6863,40 @@ export namespace SubscriptionUnscheduleCancellationResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -5502,16 +6925,40 @@ export namespace SubscriptionUnscheduleCancellationResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -5534,16 +6981,35 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ reason: string | null; } - } - - 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 namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + } + + 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 @@ -5565,11 +7031,6 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -5582,18 +7043,37 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -5606,6 +7086,11 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -5618,12 +7103,26 @@ export namespace SubscriptionUnscheduleCancellationResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -5636,6 +7135,11 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -5648,6 +7152,25 @@ export namespace SubscriptionUnscheduleCancellationResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -5659,11 +7182,6 @@ export namespace SubscriptionUnscheduleCancellationResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -5674,6 +7192,11 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -5686,12 +7209,26 @@ export namespace SubscriptionUnscheduleCancellationResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -5702,6 +7239,11 @@ export namespace SubscriptionUnscheduleCancellationResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -5714,6 +7256,25 @@ export namespace SubscriptionUnscheduleCancellationResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -5919,7 +7480,8 @@ export interface SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.AmountDiscountInterval @@ -5937,7 +7499,8 @@ export interface SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -5950,10 +7513,16 @@ export interface SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -5973,7 +7542,7 @@ export interface SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -6033,10 +7602,15 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6060,6 +7634,25 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -6072,10 +7665,15 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6093,16 +7691,40 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6126,16 +7748,40 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6164,16 +7810,40 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6196,6 +7866,25 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -6227,11 +7916,6 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -6244,18 +7928,37 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -6268,6 +7971,11 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -6280,12 +7988,26 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -6298,6 +8020,11 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -6310,6 +8037,25 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -6321,11 +8067,6 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -6336,6 +8077,11 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -6348,12 +8094,26 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -6364,6 +8124,11 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -6376,9 +8141,28 @@ export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { start_date: string; } - /** - * A pending subscription change if one exists on this subscription. - */ + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + /** + * A pending subscription change if one exists on this subscription. + */ export interface PendingSubscriptionChange { id: string; } @@ -6581,7 +8365,8 @@ export interface SubscriptionUnschedulePendingPlanChangesResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionUnschedulePendingPlanChangesResponse.AmountDiscountInterval @@ -6599,7 +8384,8 @@ export interface SubscriptionUnschedulePendingPlanChangesResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -6612,10 +8398,16 @@ export interface SubscriptionUnschedulePendingPlanChangesResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -6635,7 +8427,7 @@ export interface SubscriptionUnschedulePendingPlanChangesResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -6695,10 +8487,15 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6722,6 +8519,25 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -6734,10 +8550,15 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6755,16 +8576,40 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6788,16 +8633,40 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6826,16 +8695,40 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -6858,6 +8751,25 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -6889,11 +8801,6 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -6906,18 +8813,37 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -6930,6 +8856,11 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -6942,12 +8873,26 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -6960,6 +8905,11 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -6972,6 +8922,25 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -6983,11 +8952,6 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -6998,6 +8962,11 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -7010,12 +8979,26 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -7026,6 +9009,11 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -7038,6 +9026,25 @@ export namespace SubscriptionUnschedulePendingPlanChangesResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -7243,7 +9250,8 @@ export interface SubscriptionUpdateFixedFeeQuantityResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionUpdateFixedFeeQuantityResponse.AmountDiscountInterval @@ -7261,7 +9269,8 @@ export interface SubscriptionUpdateFixedFeeQuantityResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -7274,10 +9283,16 @@ export interface SubscriptionUpdateFixedFeeQuantityResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -7297,7 +9312,7 @@ export interface SubscriptionUpdateFixedFeeQuantityResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -7357,10 +9372,15 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -7384,6 +9404,25 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -7396,10 +9435,15 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -7417,16 +9461,40 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -7450,16 +9518,40 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -7488,16 +9580,40 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -7520,6 +9636,25 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -7551,11 +9686,6 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -7568,18 +9698,37 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -7592,6 +9741,11 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -7604,12 +9758,26 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -7622,6 +9790,11 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -7634,6 +9807,25 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -7645,11 +9837,6 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -7660,6 +9847,11 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -7672,12 +9864,26 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -7688,6 +9894,11 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -7700,6 +9911,25 @@ export namespace SubscriptionUpdateFixedFeeQuantityResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -7905,7 +10135,8 @@ export interface SubscriptionUpdateTrialResponse { default_invoice_memo: string | null; /** - * The discount intervals for this subscription sorted by the start_date. + * @deprecated The discount intervals for this subscription sorted by the + * start_date. */ discount_intervals: Array< | SubscriptionUpdateTrialResponse.AmountDiscountInterval @@ -7923,7 +10154,8 @@ export interface SubscriptionUpdateTrialResponse { invoicing_threshold: string | null; /** - * The maximum intervals for this subscription sorted by the start_date. + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. */ maximum_intervals: Array; @@ -7936,10 +10168,16 @@ export interface SubscriptionUpdateTrialResponse { metadata: Record; /** - * The minimum intervals for this subscription sorted by the start_date. + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. */ minimum_intervals: Array; + /** + * The name of the subscription. + */ + 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 @@ -7959,7 +10197,7 @@ export interface SubscriptionUpdateTrialResponse { * subscription. You can see more about how to configure prices in the * [Price resource](/reference/price). */ - plan: PlansAPI.Plan; + plan: PlansAPI.Plan | null; /** * The price intervals for this subscription. @@ -8019,10 +10257,15 @@ export namespace SubscriptionUpdateTrialResponse { adjustment_type: 'usage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -8046,6 +10289,25 @@ export namespace SubscriptionUpdateTrialResponse { usage_discount: number; } + export namespace PlanPhaseUsageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseAmountDiscountAdjustment { id: string; @@ -8058,10 +10320,15 @@ export namespace SubscriptionUpdateTrialResponse { amount_discount: string; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -8079,16 +10346,40 @@ export namespace SubscriptionUpdateTrialResponse { reason: string | null; } + export namespace PlanPhaseAmountDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhasePercentageDiscountAdjustment { id: string; adjustment_type: 'percentage_discount'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -8112,16 +10403,40 @@ export namespace SubscriptionUpdateTrialResponse { reason: string | null; } + export namespace PlanPhasePercentageDiscountAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMinimumAdjustment { id: string; adjustment_type: 'minimum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -8150,16 +10465,40 @@ export namespace SubscriptionUpdateTrialResponse { reason: string | null; } + export namespace PlanPhaseMinimumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PlanPhaseMaximumAdjustment { id: string; adjustment_type: 'maximum'; /** - * The price IDs that this adjustment applies to. + * @deprecated The price IDs that this adjustment applies to. */ applies_to_price_ids: Array; + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + /** * True for adjustments that apply to an entire invocice, false for adjustments * that apply to only one price. @@ -8182,6 +10521,25 @@ export namespace SubscriptionUpdateTrialResponse { */ reason: string | null; } + + export namespace PlanPhaseMaximumAdjustment { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } } export interface BillingCycleAnchorConfiguration { @@ -8213,11 +10571,6 @@ export namespace SubscriptionUpdateTrialResponse { */ amount_discount: string; - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this discount interval applies to. */ @@ -8230,18 +10583,37 @@ export namespace SubscriptionUpdateTrialResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ start_date: string; } - export interface PercentageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace AmountDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface PercentageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -8254,6 +10626,11 @@ export namespace SubscriptionUpdateTrialResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * Only available if discount_type is `percentage`.This is a number between 0 * and 1. @@ -8266,12 +10643,26 @@ export namespace SubscriptionUpdateTrialResponse { start_date: string; } - export interface UsageDiscountInterval { - /** - * The price ids that this discount interval applies to. - */ - applies_to_price_ids: Array; + export namespace PercentageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface UsageDiscountInterval { /** * The price interval ids that this discount interval applies to. */ @@ -8284,6 +10675,11 @@ export namespace SubscriptionUpdateTrialResponse { */ end_date: string | null; + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + /** * The start date of the discount interval. */ @@ -8296,6 +10692,25 @@ export namespace SubscriptionUpdateTrialResponse { usage_discount: number; } + export namespace UsageDiscountInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface FixedFeeQuantitySchedule { end_date: string | null; @@ -8307,11 +10722,6 @@ export namespace SubscriptionUpdateTrialResponse { } export interface MaximumInterval { - /** - * The price ids that this maximum interval applies to. - */ - applies_to_price_ids: Array; - /** * The price interval ids that this maximum interval applies to. */ @@ -8322,6 +10732,11 @@ export namespace SubscriptionUpdateTrialResponse { */ end_date: string | null; + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + /** * The maximum amount to charge in a given billing period for the price intervals * this transform applies to. @@ -8334,12 +10749,26 @@ export namespace SubscriptionUpdateTrialResponse { start_date: string; } - export interface MinimumInterval { - /** - * The price ids that this minimum interval applies to. - */ - applies_to_price_ids: Array; + export namespace MaximumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + export interface MinimumInterval { /** * The price interval ids that this minimum interval applies to. */ @@ -8350,6 +10779,11 @@ export namespace SubscriptionUpdateTrialResponse { */ end_date: string | null; + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + /** * The minimum amount to charge in a given billing period for the price intervals * this minimum applies to. @@ -8362,6 +10796,25 @@ export namespace SubscriptionUpdateTrialResponse { start_date: string; } + export namespace MinimumInterval { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + /** * A pending subscription change if one exists on this subscription. */ @@ -8531,6 +10984,12 @@ export interface SubscriptionCreateParams { */ credits_overage_rate?: number | null; + /** + * The currency to use for the subscription. If not specified, the invoicing + * currency for the plan will be used. + */ + currency?: string | null; + customer_id?: string | null; /** @@ -8586,6 +11045,12 @@ export interface SubscriptionCreateParams { */ metadata?: Record | null; + /** + * The name to use for the subscription. If not specified, the plan name will be + * used. + */ + name?: 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 @@ -8695,12 +11160,12 @@ export namespace SubscriptionCreateParams { export interface NewPercentageDiscount { adjustment_type: 'percentage_discount'; + percentage_discount: number; + /** * The set of price IDs to which this adjustment applies. */ - applies_to_price_ids: Array; - - percentage_discount: number; + applies_to_price_ids?: Array | null; /** * When false, this adjustment will be applied to a single price. Otherwise, it @@ -8712,12 +11177,12 @@ export namespace SubscriptionCreateParams { export interface NewUsageDiscount { adjustment_type: 'usage_discount'; + usage_discount: number; + /** * The set of price IDs to which this adjustment applies. */ - applies_to_price_ids: Array; - - usage_discount: number; + applies_to_price_ids?: Array | null; /** * When false, this adjustment will be applied to a single price. Otherwise, it @@ -8734,7 +11199,7 @@ export namespace SubscriptionCreateParams { /** * The set of price IDs to which this adjustment applies. */ - applies_to_price_ids: Array; + applies_to_price_ids?: Array | null; /** * When false, this adjustment will be applied to a single price. Otherwise, it @@ -8746,11 +11211,6 @@ export namespace SubscriptionCreateParams { 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. */ @@ -8759,7 +11219,12 @@ export namespace SubscriptionCreateParams { minimum_amount: string; /** - * When false, this adjustment will be applied to a single price. Otherwise, it + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. */ is_invoice_level?: boolean; @@ -8768,12 +11233,12 @@ export namespace SubscriptionCreateParams { export interface NewMaximum { adjustment_type: 'maximum'; + maximum_amount: string; + /** * The set of price IDs to which this adjustment applies. */ - applies_to_price_ids: Array; - - maximum_amount: string; + applies_to_price_ids?: Array | null; /** * When false, this adjustment will be applied to a single price. Otherwise, it @@ -8853,6 +11318,9 @@ export namespace SubscriptionCreateParams { | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice | AddPrice.NewSubscriptionGroupedTieredPackagePrice + | AddPrice.NewSubscriptionMatrixWithAllocationPrice + | AddPrice.NewSubscriptionTieredPackageWithMinimumPrice + | AddPrice.NewSubscriptionGroupedTieredPrice | null; /** @@ -8889,11 +11357,27 @@ export namespace SubscriptionCreateParams { */ currency: string; + /** + * The custom expiration for the allocation. + */ + custom_expiration?: AllocationPrice.CustomExpiration | null; + /** * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; + } + + export namespace AllocationPrice { + /** + * The custom expiration for the allocation. */ - expires_at_end_of_cadence: boolean; + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } } export interface Discount { @@ -8966,6 +11450,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9026,6 +11515,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9092,6 +11602,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9158,6 +11673,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9224,6 +11760,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9310,6 +11851,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9376,6 +11938,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9455,6 +12022,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9521,6 +12109,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9606,6 +12199,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9672,6 +12286,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9737,6 +12356,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9803,6 +12443,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -9883,6 +12528,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -9949,6 +12615,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10023,6 +12694,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10089,6 +12781,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10142,6 +12839,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10208,6 +12926,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10261,6 +12984,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10327,6 +13071,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10380,6 +13129,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10446,6 +13216,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10499,6 +13274,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10565,6 +13361,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10618,6 +13419,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10684,6 +13506,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10737,6 +13564,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10803,6 +13651,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10856,6 +13709,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -10922,6 +13796,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -10976,19 +13855,40 @@ 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. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; } } @@ -11041,6 +13941,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11094,6 +13999,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11160,6 +14086,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11213,6 +14144,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11279,6 +14231,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11332,6 +14289,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11398,6 +14376,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11451,6 +14434,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11517,6 +14521,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11570,6 +14579,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11636,6 +14666,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11689,6 +14724,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11755,6 +14811,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11808,6 +14869,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11874,6 +14956,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -11927,6 +15014,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -11993,6 +15101,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -12046,6 +15159,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -12062,285 +15196,191 @@ 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; - - /** - * 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 NewSubscriptionMatrixWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - 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 item the price will be associated with. + */ + item_id: string; - /** - * The id of the adjustment on the plan to replace in the subscription. - */ - replaces_adjustment_id: string; - } + matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + model_type: 'matrix_with_allocation'; /** - * The set of price IDs to which this adjustment applies. + * The name of the price. */ - applies_to_price_ids: Array; - - percentage_discount: number; + name: 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. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + billable_metric_id?: string | null; /** - * The set of price IDs to which this adjustment applies. + * 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. */ - applies_to_price_ids: Array; + billed_in_advance?: boolean | null; - usage_discount: number; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.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 NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; + 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; /** - * 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 dimensional price: specifies a price group and dimension values */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; + dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; /** - * The set of price IDs to which this adjustment applies. + * An alias for the price. */ - applies_to_price_ids: Array; + external_price_id?: string | null; /** - * The item ID that revenue from this minimum will be attributed to. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - item_id: string; - - minimum_amount: string; + fixed_price_quantity?: 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. + * The property used to group this price on an invoice */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; + 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?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - maximum_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; /** - * 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 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; + export namespace NewSubscriptionMatrixWithAllocationPrice { + export interface MatrixWithAllocationConfig { + /** + * Allocation to be used to calculate the price + */ + allocation: number; - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for the replacement price. - */ - maximum_amount?: string | null; + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for the replacement price. - */ - minimum_amount?: string | null; + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; - /** - * 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; + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - } + 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; - 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; + /** + * Unit price for the specified dimension_values + */ + unit_amount: string; + } + } /** - * The cadence at which to allocate the amount to the customer. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * For dimensional price: specifies a price group and dimension values */ - expires_at_end_of_cadence: boolean; - } + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; - /** - * Only available if discount_type is `amount`. - */ - amount_discount?: string | null; + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - percentage_discount?: number | null; + export interface InvoicingCycleConfiguration { + /** + * 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 | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewSubscriptionUnitPrice { + export interface NewSubscriptionTieredPackageWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -12351,14 +15391,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'unit'; + model_type: 'tiered_package_with_minimum'; /** * The name of the price. */ name: string; - unit_config: NewSubscriptionUnitPrice.UnitConfig; + tiered_package_with_minimum_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -12376,7 +15416,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?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12389,6 +15429,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -12409,7 +15454,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?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12425,14 +15470,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - + export namespace NewSubscriptionTieredPackageWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12449,6 +15487,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -12466,26 +15525,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionPackagePrice { + export interface NewSubscriptionGroupedTieredPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + grouped_tiered_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'package'; + model_type: 'grouped_tiered'; /** * 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. @@ -12502,7 +15561,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?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12515,6 +15574,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -12535,7 +15599,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?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12551,20 +15615,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 NewSubscriptionGroupedTieredPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -12581,6 +15632,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -12597,305 +15669,304 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } } + } - export interface NewSubscriptionMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + 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 id of the item the price will be associated with. - */ - item_id: string; + /** + * 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; - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; + /** + * 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: 'matrix'; + 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?: NewSubscriptionMatrixPrice.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. - */ - currency?: string | null; + percentage_discount: number; /** - * An alias for the price. + * The set of price IDs to which this adjustment applies. */ - external_price_id?: string | null; + applies_to_price_ids?: Array | null; /** - * 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. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.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`. + * The set of price IDs to which this adjustment applies. */ - metadata?: Record | null; + applies_to_price_ids?: Array | null; /** - * 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 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; + export interface NewAmountDiscount { + adjustment_type: 'amount_discount'; - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } + 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 | null; /** - * 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 NewSubscriptionTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + export interface NewMinimum { + adjustment_type: 'minimum'; /** - * 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: 'tiered'; + minimum_amount: string; /** - * The name of the price. + * The set of price IDs to which this adjustment applies. */ - name: string; - - tiered_config: NewSubscriptionTieredPrice.TieredConfig; + applies_to_price_ids?: Array | null; /** - * 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 NewMaximum { + adjustment_type: 'maximum'; + + 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. + * The set of price IDs to which this adjustment applies. */ - billed_in_advance?: boolean | null; + applies_to_price_ids?: Array | null; /** - * 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?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; + is_invoice_level?: boolean; + } + } - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the subscription. + */ + replaces_price_id: string; - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: ReplacePrice.AllocationPrice | null; - /** - * An alias for the price. - */ - external_price_id?: string | 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 + | ReplacePrice.NewSubscriptionMatrixWithAllocationPrice + | ReplacePrice.NewSubscriptionTieredPackageWithMinimumPrice + | ReplacePrice.NewSubscriptionGroupedTieredPrice + | 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 { /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. + * An amount of the currency to allocate to the customer at the specified cadence. */ - fixed_price_quantity?: number | null; + amount: string; /** - * The property used to group this price on an invoice + * The cadence at which to allocate the amount to the customer. */ - invoice_grouping_key?: string | null; + 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. + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. */ - invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; + currency: 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`. + * The custom expiration for the allocation. */ - metadata?: Record | null; + custom_expiration?: AllocationPrice.CustomExpiration | null; /** - * 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. Set to null if using custom_expiration. */ - reference_id?: string | null; + expires_at_end_of_cadence?: boolean | 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 { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - + export namespace AllocationPrice { /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * The custom expiration for the allocation. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ + export interface CustomExpiration { duration: number; - /** - * The unit of billing period duration. - */ duration_unit: 'day' | 'month'; } + } + + export interface Discount { + discount_type: 'percentage' | 'usage' | 'amount'; /** - * 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 `amount`. */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + amount_discount?: string | null; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + /** + * 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 NewSubscriptionTieredBpsPrice { + export interface NewSubscriptionUnitPrice { /** * The cadence to bill for this price on. */ @@ -12906,14 +15977,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_bps'; + model_type: 'unit'; /** * The name of the price. */ name: string; - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; + unit_config: NewSubscriptionUnitPrice.UnitConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -12931,7 +16002,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?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -12944,6 +16015,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -12964,7 +16040,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?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12980,37 +16056,12 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { + export namespace NewSubscriptionUnitPrice { + export interface UnitConfig { /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers + * Rate per unit of usage */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } + unit_amount: string; } /** @@ -13029,6 +16080,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13046,9 +16118,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - + export interface NewSubscriptionPackagePrice { /** * The cadence to bill for this price on. */ @@ -13059,13 +16129,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'bps'; + 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. @@ -13082,7 +16154,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13095,6 +16167,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13115,7 +16192,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?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13131,17 +16208,18 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { + export namespace NewSubscriptionPackagePrice { + export interface PackageConfig { /** - * Basis point take rate per event + * A currency amount to rate usage by */ - bps: number; + package_amount: string; /** - * Optional currency amount maximum to cap spend per event + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating */ - per_unit_maximum?: string | null; + package_size: number; } /** @@ -13160,6 +16238,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13177,9 +16276,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - + export interface NewSubscriptionMatrixPrice { /** * The cadence to bill for this price on. */ @@ -13190,7 +16287,9 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'bulk_bps'; + matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; + + model_type: 'matrix'; /** * The name of the price. @@ -13213,7 +16312,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13226,6 +16325,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13246,7 +16350,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?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13262,31 +16366,37 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { + export namespace NewSubscriptionMatrixPrice { + export interface MatrixConfig { /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume + * Default per unit rate for any usage not bucketed into a specified matrix_value */ - tiers: Array; - } + default_unit_amount: string; - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; + /** + * 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 { /** - * Upper bound for tier + * 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. */ - maximum_amount?: string | null; + dimension_values: Array; /** - * The maximum amount to charge for any one event + * Unit price for the specified dimension_values */ - per_unit_maximum?: string | null; + unit_amount: string; } } @@ -13306,6 +16416,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13323,9 +16454,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - + export interface NewSubscriptionTieredPrice { /** * The cadence to bill for this price on. */ @@ -13336,13 +16465,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'bulk'; + 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. @@ -13359,7 +16490,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?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13372,6 +16503,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13392,7 +16528,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?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13408,25 +16544,30 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { + export namespace NewSubscriptionTieredPrice { + export interface TieredConfig { /** - * Bulk tiers for rating based on total usage volume + * Tiers for rating based on total usage quantities into the specified tier */ - tiers: Array; + tiers: Array; } - export namespace BulkConfig { + export namespace TieredConfig { export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + /** * Amount per unit */ unit_amount: string; /** - * Upper bound for this tier + * Inclusive tier ending value. If null, this is treated as the last tier */ - maximum_units?: number | null; + last_unit?: number | null; } } @@ -13446,6 +16587,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13463,7 +16625,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionThresholdTotalAmountPrice { + export interface NewSubscriptionTieredBpsPrice { /** * The cadence to bill for this price on. */ @@ -13474,14 +16636,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'threshold_total_amount'; + model_type: 'tiered_bps'; /** * The name of the price. */ name: string; - threshold_total_amount_config: Record; + tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -13499,7 +16661,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?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13512,6 +16674,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13532,7 +16699,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?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13548,7 +16715,39 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionThresholdTotalAmountPrice { + 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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. @@ -13565,6 +16764,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13582,7 +16802,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredPackagePrice { + export interface NewSubscriptionBpsPrice { + bps_config: NewSubscriptionBpsPrice.BpsConfig; + /** * The cadence to bill for this price on. */ @@ -13593,15 +16815,13 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_package'; + model_type: 'bps'; /** * 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. @@ -13618,7 +16838,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?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13631,6 +16851,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13651,7 +16876,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?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13667,7 +16892,19 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPackagePrice { + 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. @@ -13684,6 +16921,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13701,7 +16959,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTieredWithMinimumPrice { + export interface NewSubscriptionBulkBpsPrice { + bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; + /** * The cadence to bill for this price on. */ @@ -13712,15 +16972,13 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_with_minimum'; + model_type: 'bulk_bps'; /** * 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. @@ -13737,7 +16995,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?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13750,6 +17008,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13770,7 +17033,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?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13786,7 +17049,34 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithMinimumPrice { + 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. @@ -13803,6 +17093,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13820,7 +17131,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionUnitWithPercentPrice { + export interface NewSubscriptionBulkPrice { + bulk_config: NewSubscriptionBulkPrice.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -13831,15 +17144,13 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'unit_with_percent'; + model_type: 'bulk'; /** * 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. @@ -13856,7 +17167,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?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13869,6 +17180,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -13889,7 +17205,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?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13905,7 +17221,28 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithPercentPrice { + 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. @@ -13922,6 +17259,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -13939,7 +17297,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionPackageWithAllocationPrice { + export interface NewSubscriptionThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ @@ -13950,14 +17308,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'package_with_allocation'; + model_type: 'threshold_total_amount'; /** * The name of the price. */ name: string; - package_with_allocation_config: Record; + threshold_total_amount_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -13975,7 +17333,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?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13988,6 +17346,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14008,7 +17371,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?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14024,7 +17387,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionPackageWithAllocationPrice { + export namespace NewSubscriptionThresholdTotalAmountPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14041,6 +17404,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14058,7 +17442,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionTierWithProrationPrice { + export interface NewSubscriptionTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -14069,14 +17453,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'tiered_with_proration'; + model_type: 'tiered_package'; /** * The name of the price. */ name: string; - tiered_with_proration_config: Record; + tiered_package_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -14094,7 +17478,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?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14107,6 +17491,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14127,7 +17516,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?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14143,7 +17532,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionTierWithProrationPrice { + export namespace NewSubscriptionTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14160,6 +17549,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14177,7 +17587,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionUnitWithProrationPrice { + export interface NewSubscriptionTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -14188,14 +17598,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'unit_with_proration'; + model_type: 'tiered_with_minimum'; /** * The name of the price. */ name: string; - unit_with_proration_config: Record; + tiered_with_minimum_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -14213,7 +17623,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?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14226,6 +17636,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14246,7 +17661,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?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14262,7 +17677,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithProrationPrice { + export namespace NewSubscriptionTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14279,6 +17694,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14296,26 +17732,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionGroupedAllocationPrice { + export interface NewSubscriptionUnitWithPercentPrice { /** * 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: '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. @@ -14332,7 +17768,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?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14345,6 +17781,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14365,7 +17806,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?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14381,7 +17822,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedAllocationPrice { + export namespace NewSubscriptionUnitWithPercentPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14398,6 +17839,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14415,26 +17877,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionGroupedWithProratedMinimumPrice { + export interface NewSubscriptionPackageWithAllocationPrice { /** * 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: '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. @@ -14451,7 +17913,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?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14464,6 +17926,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14484,7 +17951,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?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14500,7 +17967,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { + export namespace NewSubscriptionPackageWithAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14517,6 +17984,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14534,9 +18022,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - + export interface NewSubscriptionTierWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -14547,13 +18033,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'bulk_with_proration'; + 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. @@ -14570,7 +18058,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?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14583,6 +18071,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14603,7 +18096,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?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14619,7 +18112,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkWithProrationPrice { + export namespace NewSubscriptionTierWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14637,23 +18130,44 @@ 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. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; - } - } + dimensional_price_group_id?: string | null; - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + + export interface NewSubscriptionUnitWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -14664,14 +18178,14 @@ export namespace SubscriptionCreateParams { */ item_id: string; - model_type: 'scalable_matrix_with_unit_pricing'; + model_type: 'unit_with_proration'; /** * The name of the price. */ name: string; - scalable_matrix_with_unit_pricing_config: Record; + unit_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -14689,7 +18203,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14702,6 +18216,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14722,7 +18241,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?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14738,7 +18257,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { + export namespace NewSubscriptionUnitWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14755,6 +18274,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14772,26 +18312,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { + 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: 'scalable_matrix_with_tiered_pricing'; + model_type: 'grouped_allocation'; /** * 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. @@ -14808,7 +18348,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14821,6 +18361,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14841,7 +18386,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?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14857,7 +18402,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { + export namespace NewSubscriptionGroupedAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14874,6 +18419,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -14891,20 +18457,20 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionCumulativeGroupedBulkPrice { + export interface NewSubscriptionGroupedWithProratedMinimumPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; + grouped_with_prorated_minimum_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'cumulative_grouped_bulk'; + model_type: 'grouped_with_prorated_minimum'; /** * The name of the price. @@ -14927,7 +18493,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14940,6 +18506,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -14960,7 +18531,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?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14976,7 +18547,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionCumulativeGroupedBulkPrice { + export namespace NewSubscriptionGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -14993,6 +18564,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -15010,7 +18602,9 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionMaxGroupTieredPackagePrice { + export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; + /** * The cadence to bill for this price on. */ @@ -15021,9 +18615,7 @@ export namespace SubscriptionCreateParams { */ item_id: string; - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; + model_type: 'bulk_with_proration'; /** * The name of the price. @@ -15046,7 +18638,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15059,6 +18651,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -15079,7 +18676,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?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15095,7 +18692,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionMaxGroupTieredPackagePrice { + export namespace NewSubscriptionBulkWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15112,6 +18709,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -15129,26 +18747,26 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionGroupedWithMeteredMinimumPrice { + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * 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: 'grouped_with_metered_minimum'; + 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. @@ -15165,7 +18783,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15178,6 +18796,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -15198,7 +18821,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?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15214,7 +18837,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { + export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15231,6 +18854,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -15248,7 +18892,7 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionMatrixWithDisplayNamePrice { + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * The cadence to bill for this price on. */ @@ -15259,15 +18903,15 @@ export namespace SubscriptionCreateParams { */ item_id: string; - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; + 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. @@ -15284,7 +18928,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15297,6 +18941,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -15317,7 +18966,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?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15333,7 +18982,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionMatrixWithDisplayNamePrice { + export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15350,6 +18999,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -15367,20 +19037,20 @@ export namespace SubscriptionCreateParams { } } - export interface NewSubscriptionGroupedTieredPackagePrice { + export interface NewSubscriptionCumulativeGroupedBulkPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_tiered_package_config: Record; + cumulative_grouped_bulk_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_tiered_package'; + model_type: 'cumulative_grouped_bulk'; /** * The name of the price. @@ -15403,7 +19073,7 @@ export namespace SubscriptionCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15416,6 +19086,11 @@ export namespace SubscriptionCreateParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -15436,7 +19111,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?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15452,7 +19127,7 @@ export namespace SubscriptionCreateParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedTieredPackagePrice { + export namespace NewSubscriptionCumulativeGroupedBulkPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15469,6 +19144,27 @@ export namespace SubscriptionCreateParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -15485,393 +19181,317 @@ 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 NewSubscriptionMaxGroupTieredPackagePrice { + /** + * 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; + max_group_tiered_package_config: Record; - /** - * 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; + model_type: 'max_group_tiered_package'; - /** - * 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 name of the price. + */ + name: string; -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?: NewSubscriptionMaxGroupTieredPackagePrice.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?: Array | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - status?: 'active' | 'ended' | 'upcoming' | null; -} + /** + * An alias for the price. + */ + external_price_id?: string | null; -export interface SubscriptionCancelParams { - /** - * Determines the timing of subscription cancellation - */ - cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | 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; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | 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; -} + /** + * 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?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; -export interface SubscriptionFetchCostsParams { - /** - * The currency or custom pricing unit to use. - */ - currency?: 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; - /** - * Costs returned are exclusive of `timeframe_end`. - */ - timeframe_end?: 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 inclusive of `timeframe_start`. - */ - timeframe_start?: string | null; + export namespace NewSubscriptionMaxGroupTieredPackagePrice { + /** + * 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; - /** - * 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; -} + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } -export interface SubscriptionFetchScheduleParams extends PageParams { - 'start_date[gt]'?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - 'start_date[gte]'?: string | null; + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; - 'start_date[lt]'?: string | null; + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } - 'start_date[lte]'?: 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; -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 unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } - first_dimension_key?: string | null; + export interface NewSubscriptionGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - first_dimension_value?: string | null; + grouped_with_metered_minimum_config: Record; - /** - * This determines the windowing of usage reporting. - */ - granularity?: 'day' | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * Groups per-price usage by the key provided. - */ - group_by?: string | null; + model_type: 'grouped_with_metered_minimum'; - second_dimension_key?: string | null; + /** + * The name of the price. + */ + name: string; - second_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; - /** - * Usage returned is exclusive of `timeframe_end`. - */ - timeframe_end?: 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; - /** - * Usage returned is inclusive of `timeframe_start`. - */ - timeframe_start?: string | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | 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; -} + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; -export interface SubscriptionPriceIntervalsParams { - /** - * A list of price intervals to add to the subscription. - */ - add?: Array; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * A list of adjustments to add to the subscription. - */ - add_adjustments?: Array; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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; + /** + * An alias for the price. + */ + external_price_id?: string | 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?: NewSubscriptionGroupedWithMeteredMinimumPrice.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 NewSubscriptionGroupedWithMeteredMinimumPrice { /** - * 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 BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; - export interface UsageDiscountCreationParams { - discount_type: 'usage'; + /** + * 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. + * For dimensional price: specifies a price group and dimension values */ - usage_discount: number; - } + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - export interface FixedFeeQuantityTransition { - /** - * The date that the fixed fee quantity transition should take effect. - */ - effective_date: string; + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } /** - * The quantity of the fixed fee quantity transition. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - quantity: number; + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewFloatingUnitPrice { + 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: 'unit'; + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; /** * The name of the price. */ name: string; - unit_config: NewFloatingUnitPrice.UnitConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -15888,13 +19508,24 @@ 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?: 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -15915,7 +19546,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?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15923,16 +19554,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 NewSubscriptionMatrixWithDisplayNamePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -15950,47 +19580,63 @@ 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. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; - } - } + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } - export interface NewFloatingPackagePrice { /** - * The cadence to bill for this price on. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + export interface InvoicingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } + export interface NewSubscriptionGroupedTieredPackagePrice { /** - * An ISO 4217 currency string for which this price is billed in. + * The cadence to bill for this price on. */ - currency: string; + 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: 'package'; + model_type: 'grouped_tiered_package'; /** * The name of the price. */ name: string; - package_config: NewFloatingPackagePrice.PackageConfig; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16007,13 +19653,24 @@ 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?: 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -16034,7 +19691,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?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16042,22 +19699,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 NewSubscriptionGroupedTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16074,6 +19724,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -16091,25 +19762,20 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMatrixPrice { + export interface NewSubscriptionMatrixWithAllocationPrice { /** * 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_config: NewFloatingMatrixPrice.MatrixConfig; + matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; - model_type: 'matrix'; + model_type: 'matrix_with_allocation'; /** * The name of the price. @@ -16132,13 +19798,24 @@ 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?: NewSubscriptionMatrixWithAllocationPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -16159,7 +19836,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?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16167,10 +19844,21 @@ 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 NewFloatingMatrixPrice { - export interface MatrixConfig { + export namespace NewSubscriptionMatrixWithAllocationPrice { + 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 */ @@ -16184,10 +19872,10 @@ export namespace SubscriptionPriceIntervalsParams { /** * Matrix values for specified matrix grouping keys */ - matrix_values: Array; + matrix_values: Array; } - export namespace MatrixConfig { + export namespace MatrixWithAllocationConfig { export interface MatrixValue { /** * One or two matrix keys to filter usage to this Matrix value by. For example, @@ -16219,6 +19907,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -16236,31 +19945,26 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMatrixWithAllocationPrice { + export interface NewSubscriptionTieredPackageWithMinimumPrice { /** * 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_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; + model_type: 'tiered_package_with_minimum'; /** * The name of the price. */ name: string; + tiered_package_with_minimum_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16277,13 +19981,24 @@ 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?: NewSubscriptionTieredPackageWithMinimumPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -16304,7 +20019,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?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16312,47 +20027,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 NewSubscriptionTieredPackageWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -16369,6 +20052,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -16386,31 +20090,26 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredPrice { + export interface NewSubscriptionGroupedTieredPrice { /** * 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; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'tiered'; + model_type: 'grouped_tiered'; /** * 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. @@ -16427,13 +20126,24 @@ 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?: NewSubscriptionGroupedTieredPrice.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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -16454,7 +20164,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?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16462,49 +20172,50 @@ 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 NewFloatingTieredPrice { - export interface TieredConfig { + export namespace NewSubscriptionGroupedTieredPrice { + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + export interface BillingCycleConfiguration { /** - * Tiers for rating based on total usage quantities into the specified tier + * The duration of the billing period. */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; } /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * For dimensional price: specifies a price group and dimension values */ - export interface BillingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; } /** @@ -16523,280 +20234,387 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } } + } +} - export interface NewFloatingTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; +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; - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: 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; - /** - * 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: 'tiered_bps'; + /** + * 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; +} - tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig; +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?: NewFloatingTieredBpsPrice.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 alias for the price. - */ - external_price_id?: string | null; + external_customer_id?: Array | null; - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; + status?: 'active' | 'ended' | 'upcoming' | null; +} - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; +export interface SubscriptionCancelParams { + /** + * Determines the timing of subscription cancellation + */ + cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date'; - /** - * 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; + /** + * 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; - /** - * 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 date that the cancellation should take effect. This parameter can only be + * passed if the `cancel_option` is `requested_date`. + */ + cancellation_date?: string | null; +} - export namespace NewFloatingTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } +export interface SubscriptionFetchCostsParams { + /** + * The currency or custom pricing unit to use. + */ + currency?: string | null; - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; + /** + * Costs returned are exclusive of `timeframe_end`. + */ + timeframe_end?: string | null; - /** - * Exclusive tier starting value - */ - minimum_amount: string; + /** + * Costs returned are inclusive of `timeframe_start`. + */ + timeframe_start?: string | null; - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; + /** + * 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; +} - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } +export interface SubscriptionFetchScheduleParams extends PageParams { + 'start_date[gt]'?: 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; + 'start_date[gte]'?: string | null; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + 'start_date[lt]'?: 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; + 'start_date[lte]'?: string | null; +} - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } +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; - export interface NewFloatingBpsPrice { - bps_config: NewFloatingBpsPrice.BpsConfig; + first_dimension_key?: string | null; - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + first_dimension_value?: string | null; - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; + /** + * This determines the windowing of usage reporting. + */ + granularity?: 'day' | null; - /** - * The id of the item the price will be associated with. - */ - item_id: string; + /** + * Groups per-price usage by the key provided. + */ + group_by?: string | null; - model_type: 'bps'; + second_dimension_key?: string | null; - /** - * The name of the price. - */ - name: string; + second_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; + /** + * Usage returned is exclusive of `timeframe_end`. + */ + timeframe_end?: 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; + /** + * Usage returned is inclusive of `timeframe_start`. + */ + timeframe_start?: string | null; - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | 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; +} - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | 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 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. + * The custom expiration for the allocation. */ - invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; + custom_expiration?: AllocationPrice.CustomExpiration | 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`. + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. */ - metadata?: Record | null; + expires_at_end_of_cadence?: boolean | 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; - } - + export namespace AllocationPrice { /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * The custom expiration for the allocation. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ + export interface CustomExpiration { duration: number; - /** - * The unit of billing period duration. - */ duration_unit: 'day' | 'month'; } + } + export interface AmountDiscountCreationParams { /** - * 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 `amount`. */ - export interface InvoicingCycleConfiguration { - /** - * 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 NewFloatingBulkBpsPrice { - bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; + export interface PercentageDiscountCreationParams { + discount_type: 'percentage'; /** - * The cadence to bill for this price on. + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. + */ + percentage_discount: number; + } + + 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 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. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; @@ -16810,13 +20628,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'bulk_bps'; + model_type: 'unit'; /** * The name of the price. */ name: string; + unit_config: NewFloatingUnitPrice.UnitConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16833,13 +20653,18 @@ 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?: NewFloatingUnitPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -16860,7 +20685,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?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -16870,32 +20695,12 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingBulkBpsPrice { - export interface BulkBpsConfig { + export namespace NewFloatingUnitPrice { + export interface UnitConfig { /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume + * Rate per unit of usage */ - 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; - } + unit_amount: string; } /** @@ -16914,6 +20719,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -16931,9 +20757,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingBulkPrice { - bulk_config: NewFloatingBulkPrice.BulkConfig; - + export interface NewFloatingPackagePrice { /** * The cadence to bill for this price on. */ @@ -16949,13 +20773,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'bulk'; + model_type: 'package'; /** * The name of the price. */ name: string; + package_config: NewFloatingPackagePrice.PackageConfig; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -16972,13 +20798,18 @@ 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?: NewFloatingPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -16999,7 +20830,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?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17009,26 +20840,18 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingBulkPrice { - export interface BulkConfig { + export namespace NewFloatingPackagePrice { + export interface PackageConfig { /** - * Bulk tiers for rating based on total usage volume + * A currency amount to rate usage by */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; + package_amount: string; - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } + /** + * 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; } /** @@ -17047,6 +20870,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17064,7 +20908,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingThresholdTotalAmountPrice { + export interface NewFloatingMatrixPrice { /** * The cadence to bill for this price on. */ @@ -17080,15 +20924,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'threshold_total_amount'; + matrix_config: NewFloatingMatrixPrice.MatrixConfig; + + model_type: 'matrix'; /** * 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. @@ -17105,13 +20949,18 @@ 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?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17132,7 +20981,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?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17142,7 +20991,40 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingThresholdTotalAmountPrice { + 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. @@ -17159,6 +21041,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17176,7 +21079,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredPackagePrice { + export interface NewFloatingMatrixWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -17192,15 +21095,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'tiered_package'; + matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_allocation'; /** * 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. @@ -17217,13 +21120,18 @@ 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?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17244,7 +21152,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?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17254,7 +21162,45 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingTieredPackagePrice { + 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. @@ -17272,23 +21218,44 @@ 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. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. */ duration_unit: 'day' | 'month'; } } - export interface NewFloatingGroupedTieredPrice { + export interface NewFloatingTieredPrice { /** * The cadence to bill for this price on. */ @@ -17299,20 +21266,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: 'grouped_tiered'; + model_type: 'tiered'; /** * 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. @@ -17329,13 +21296,18 @@ 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?: NewFloatingTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17356,7 +21328,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?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17366,7 +21338,33 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedTieredPrice { + 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 { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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. @@ -17383,6 +21381,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17400,7 +21419,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMaxGroupTieredPackagePrice { + export interface NewFloatingTieredBpsPrice { /** * The cadence to bill for this price on. */ @@ -17416,15 +21435,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; + 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. @@ -17441,13 +21460,18 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17468,7 +21492,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?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17478,7 +21502,39 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingMaxGroupTieredPackagePrice { + 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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. @@ -17495,6 +21551,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17512,7 +21589,9 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredWithMinimumPrice { + export interface NewFloatingBpsPrice { + bps_config: NewFloatingBpsPrice.BpsConfig; + /** * The cadence to bill for this price on. */ @@ -17528,15 +21607,13 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'tiered_with_minimum'; + model_type: 'bps'; /** * 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. @@ -17553,13 +21630,18 @@ export namespace SubscriptionPriceIntervalsParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17580,7 +21662,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?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17590,7 +21672,19 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingTieredWithMinimumPrice { + 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. @@ -17607,6 +21701,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17624,7 +21739,9 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingPackageWithAllocationPrice { + export interface NewFloatingBulkBpsPrice { + bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; + /** * The cadence to bill for this price on. */ @@ -17640,15 +21757,13 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'package_with_allocation'; + model_type: 'bulk_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. @@ -17665,13 +21780,18 @@ 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?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17692,7 +21812,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?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17702,7 +21822,34 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingPackageWithAllocationPrice { + 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. @@ -17719,6 +21866,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17736,7 +21904,9 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredPackageWithMinimumPrice { + export interface NewFloatingBulkPrice { + bulk_config: NewFloatingBulkPrice.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -17752,15 +21922,13 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'tiered_package_with_minimum'; + model_type: 'bulk'; /** * The name of the price. */ name: string; - tiered_package_with_minimum_config: Record; - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -17777,13 +21945,18 @@ 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?: NewFloatingBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17804,7 +21977,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?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17814,14 +21987,35 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { + export namespace NewFloatingBulkPrice { + export interface BulkConfig { /** - * The duration of the billing period. + * 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; @@ -17831,6 +22025,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17848,7 +22063,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingUnitWithPercentPrice { + export interface NewFloatingThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ @@ -17864,14 +22079,14 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'unit_with_percent'; + model_type: 'threshold_total_amount'; /** * The name of the price. */ name: string; - unit_with_percent_config: Record; + threshold_total_amount_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -17889,13 +22104,18 @@ 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?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -17916,7 +22136,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?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17926,7 +22146,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingUnitWithPercentPrice { + export namespace NewFloatingThresholdTotalAmountPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -17943,6 +22163,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -17960,7 +22201,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingTieredWithProrationPrice { + export interface NewFloatingTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -17976,14 +22217,14 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'tiered_with_proration'; + model_type: 'tiered_package'; /** * The name of the price. */ name: string; - tiered_with_proration_config: Record; + tiered_package_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -18001,13 +22242,18 @@ 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?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18028,7 +22274,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?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18038,7 +22284,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingTieredWithProrationPrice { + export namespace NewFloatingTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18055,6 +22301,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18072,7 +22339,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingUnitWithProrationPrice { + export interface NewFloatingGroupedTieredPrice { /** * The cadence to bill for this price on. */ @@ -18083,20 +22350,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: 'unit_with_proration'; + model_type: 'grouped_tiered'; /** * 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. @@ -18113,13 +22380,18 @@ 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?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18140,7 +22412,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?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18150,7 +22422,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingUnitWithProrationPrice { + export namespace NewFloatingGroupedTieredPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18167,6 +22439,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18184,7 +22477,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedAllocationPrice { + export interface NewFloatingMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -18195,14 +22488,14 @@ 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'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * The name of the price. @@ -18225,13 +22518,18 @@ 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?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18252,7 +22550,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?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18262,7 +22560,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedAllocationPrice { + export namespace NewFloatingMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18279,6 +22577,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18296,7 +22615,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedWithProratedMinimumPrice { + export interface NewFloatingTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -18307,20 +22626,20 @@ 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: '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. @@ -18337,13 +22656,18 @@ 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?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18364,7 +22688,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?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18374,7 +22698,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedWithProratedMinimumPrice { + export namespace NewFloatingTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18391,6 +22715,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18408,7 +22753,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedWithMeteredMinimumPrice { + export interface NewFloatingPackageWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -18419,20 +22764,20 @@ 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: '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. @@ -18449,13 +22794,18 @@ 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?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18476,7 +22826,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?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18486,7 +22836,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedWithMeteredMinimumPrice { + export namespace NewFloatingPackageWithAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18503,6 +22853,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18520,7 +22891,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingMatrixWithDisplayNamePrice { + export interface NewFloatingTieredPackageWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -18536,15 +22907,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; + model_type: 'tiered_package_with_minimum'; /** * The name of the price. */ name: string; + tiered_package_with_minimum_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -18561,13 +22932,18 @@ 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?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18588,7 +22964,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?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18598,7 +22974,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingMatrixWithDisplayNamePrice { + export namespace NewFloatingTieredPackageWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18615,6 +22991,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18632,9 +23029,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingBulkWithProrationPrice { - bulk_with_proration_config: Record; - + export interface NewFloatingUnitWithPercentPrice { /** * The cadence to bill for this price on. */ @@ -18650,13 +23045,15 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'bulk_with_proration'; + 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. @@ -18673,13 +23070,18 @@ 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?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18700,7 +23102,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?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18710,7 +23112,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingBulkWithProrationPrice { + export namespace NewFloatingUnitWithPercentPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18728,10 +23130,31 @@ 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. + * For dimensional price: specifies a price group and dimension values */ - export interface InvoicingCycleConfiguration { + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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. */ @@ -18744,7 +23167,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingGroupedTieredPackagePrice { + export interface NewFloatingTieredWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -18755,20 +23178,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_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. @@ -18785,13 +23208,18 @@ 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?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingTieredWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18812,7 +23240,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?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18822,7 +23250,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingGroupedTieredPackagePrice { + export namespace NewFloatingTieredWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18839,6 +23267,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18856,7 +23305,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingScalableMatrixWithUnitPricingPrice { + export interface NewFloatingUnitWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -18872,14 +23321,14 @@ export namespace SubscriptionPriceIntervalsParams { */ item_id: string; - model_type: 'scalable_matrix_with_unit_pricing'; + model_type: 'unit_with_proration'; /** * The name of the price. */ name: string; - scalable_matrix_with_unit_pricing_config: Record; + unit_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -18897,13 +23346,18 @@ 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?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -18924,7 +23378,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?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18934,7 +23388,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingScalableMatrixWithUnitPricingPrice { + export namespace NewFloatingUnitWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -18951,6 +23405,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -18968,7 +23443,7 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingScalableMatrixWithTieredPricingPrice { + export interface NewFloatingGroupedAllocationPrice { /** * The cadence to bill for this price on. */ @@ -18979,20 +23454,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: 'scalable_matrix_with_tiered_pricing'; + model_type: 'grouped_allocation'; /** * 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. @@ -19009,13 +23484,18 @@ 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?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -19036,7 +23516,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?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19046,7 +23526,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingScalableMatrixWithTieredPricingPrice { + export namespace NewFloatingGroupedAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19063,6 +23543,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -19080,25 +23581,25 @@ export namespace SubscriptionPriceIntervalsParams { } } - export interface NewFloatingCumulativeGroupedBulkPrice { + export interface NewFloatingGroupedWithProratedMinimumPrice { /** * 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; + grouped_with_prorated_minimum_config: Record; + /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'cumulative_grouped_bulk'; + model_type: 'grouped_with_prorated_minimum'; /** * The name of the price. @@ -19121,13 +23622,18 @@ 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?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ conversion_rate?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -19148,7 +23654,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?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19158,7 +23664,7 @@ export namespace SubscriptionPriceIntervalsParams { metadata?: Record | null; } - export namespace NewFloatingCumulativeGroupedBulkPrice { + export namespace NewFloatingGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -19175,6 +23681,27 @@ export namespace SubscriptionPriceIntervalsParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -19191,631 +23718,2783 @@ 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. The adjustment will apply to - * invoice dates that overlap with this `start_date`. This `start_date` is treated - * as inclusive for in-advance prices, and exclusive for in-arrears prices. - */ - 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. The adjustment will apply to - * invoice dates that overlap with this `end_date`.This `end_date` is treated as - * exclusive for in-advance prices, and inclusive for in-arrears prices. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - } - - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + export interface NewFloatingGroupedWithMeteredMinimumPrice { /** - * 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; - } + currency: string; - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + grouped_with_metered_minimum_config: Record; /** - * 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: 'grouped_with_metered_minimum'; /** - * 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'; - - amount_discount: string; + name: string; /** - * 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?: NewFloatingGroupedWithMeteredMinimumPrice.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; + conversion_rate?: number | null; - minimum_amount: string; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | 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?: NewFloatingGroupedWithMeteredMinimumPrice.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 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 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; + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - /** - * 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 id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: 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 external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } - /** - * The updated start date of this price interval. If not specified, the start date - * will not be updated. - */ - start_date?: (string & {}) | Shared.BillingCycleRelativeDate; + /** + * 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; - /** - * 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 unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + } - export namespace Edit { - export interface FixedFeeQuantityTransition { + export interface NewFloatingMatrixWithDisplayNamePrice { /** - * The date that the fixed fee quantity transition should take effect. + * The cadence to bill for this price on. */ - effective_date: string; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * The quantity of the fixed fee quantity transition. + * An ISO 4217 currency string for which this price is billed in. */ - quantity: number; - } - } + currency: string; - export interface EditAdjustment { - /** - * The id of the adjustment interval to edit. - */ - adjustment_interval_id: string; + /** + * The id of the item the price will be associated with. + */ + item_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; + matrix_with_display_name_config: Record; - /** - * The updated start date of this adjustment interval. If not specified, the start - * date will not be updated. - */ - start_date?: (string & {}) | Shared.BillingCycleRelativeDate; - } -} + model_type: 'matrix_with_display_name'; -export interface SubscriptionSchedulePlanChangeParams { - change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; + /** + * The name of the price. + */ + name: string; - /** - * Additional adjustments to be added to the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - add_adjustments?: Array | null; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | 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; + /** + * 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; - /** - * [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; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | 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; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | 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; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - billing_cycle_anchor_configuration?: SubscriptionSchedulePlanChangeParams.BillingCycleAnchorConfiguration | null; + /** + * An alias for the price. + */ + external_price_id?: string | 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; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | 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; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * @deprecated - */ - credits_overage_rate?: 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?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | 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; + /** + * 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 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; + 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; - /** - * 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'; + } - /** - * The phase of the plan to start with - */ - initial_phase_order?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - /** - * 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. + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingBulkWithProrationPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingGroupedTieredPackagePrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewFloatingCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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. The adjustment will apply to + * invoice dates that overlap with this `start_date`. This `start_date` is treated + * as inclusive for in-advance prices, and exclusive for in-arrears prices. + */ + 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. The adjustment will apply to + * invoice dates that overlap with this `end_date`.This `end_date` is treated as + * exclusive for in-advance prices, and inclusive for in-arrears prices. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + } + + export namespace AddAdjustment { + export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + percentage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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; + + /** + * @deprecated + */ + 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; + + /** + * 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; + + /** + * @deprecated + */ + 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; + + /** + * @deprecated 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) */ - invoicing_threshold?: string | null; + 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'; + + percentage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 + | AddPrice.NewSubscriptionMatrixWithAllocationPrice + | AddPrice.NewSubscriptionTieredPackageWithMinimumPrice + | AddPrice.NewSubscriptionGroupedTieredPrice + | 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; + + /** + * The custom expiration for the allocation. + */ + custom_expiration?: AllocationPrice.CustomExpiration | null; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; + } + + export namespace AllocationPrice { + /** + * The custom expiration for the allocation. + */ + export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; + } + } + + 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | 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 { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * 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; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | 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; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive 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 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 unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } - /** - * @deprecated - */ - per_credit_overage_amount?: number | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - /** - * 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; + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_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; + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } - /** - * @deprecated Optionally provide a list of overrides for prices on the plan - */ - price_overrides?: 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 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; + export interface NewSubscriptionBpsPrice { + bps_config: NewSubscriptionBpsPrice.BpsConfig; - /** - * 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 cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * 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 id of the item the price will be associated with. + */ + item_id: string; - /** - * 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; + model_type: 'bps'; - /** - * 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 name of the price. + */ + name: string; -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 id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * 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; + /** + * 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 phase to add this adjustment to. - */ - plan_phase_order?: number | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | 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; - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; /** - * The set of price IDs to which this adjustment applies. + * For dimensional price: specifies a price group and dimension values */ - applies_to_price_ids: Array; + dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | 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; + + /** + * 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'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: 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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + 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; - - usage_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. + * The id of the item the price will be associated with. */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; + item_id: string; - amount_discount: string; + 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; /** - * 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 billable metric for the price. Only needed if the price is + * usage-based. */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; + billable_metric_id?: string | null; /** - * The set of price IDs to which this adjustment applies. + * 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. */ - applies_to_price_ids: Array; + billed_in_advance?: boolean | null; /** - * The item ID that revenue from this minimum will be attributed to. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - item_id: string; - - minimum_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 NewMaximum { - adjustment_type: 'maximum'; + 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; - - maximum_amount: string; + currency?: 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. + * For dimensional price: specifies a price group and dimension values */ - 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; + dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; + /** + * An alias for the price. + */ + external_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; - } + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + 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?: NewSubscriptionBulkBpsPrice.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 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 `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; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. + * For dimensional price: specifies a price group and dimension values */ - percentage_discount?: number | null; + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } /** - * 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. */ @@ -19826,15 +26505,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. @@ -19851,7 +26528,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. @@ -19864,6 +26541,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -19884,7 +26566,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 @@ -19900,12 +26582,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; + } } /** @@ -19924,6 +26620,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -19941,7 +26658,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackagePrice { + export interface NewSubscriptionThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ @@ -19952,14 +26669,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 @@ -19977,7 +26694,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. @@ -19990,6 +26707,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20010,7 +26732,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 @@ -20026,20 +26748,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. @@ -20056,6 +26765,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20073,7 +26803,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMatrixPrice { + export interface NewSubscriptionTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -20084,15 +26814,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. @@ -20109,7 +26839,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. @@ -20122,6 +26852,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20142,7 +26877,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 @@ -20158,40 +26893,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. @@ -20208,6 +26910,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20225,7 +26948,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPrice { + export interface NewSubscriptionTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -20236,14 +26959,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 @@ -20261,7 +26984,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. @@ -20274,6 +26997,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20294,7 +27022,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 @@ -20310,33 +27038,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 { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - + export namespace NewSubscriptionTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -20353,6 +27055,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20370,7 +27093,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredBpsPrice { + export interface NewSubscriptionUnitWithPercentPrice { /** * The cadence to bill for this price on. */ @@ -20381,14 +27104,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 @@ -20406,7 +27129,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. @@ -20419,6 +27142,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20439,7 +27167,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 @@ -20450,44 +27178,12 @@ 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 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; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } + * in the same API call. + */ + reference_id?: string | null; + } + export namespace NewSubscriptionUnitWithPercentPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -20504,6 +27200,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20521,9 +27238,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - + export interface NewSubscriptionPackageWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -20534,13 +27249,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. @@ -20557,7 +27274,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. @@ -20570,6 +27287,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20590,7 +27312,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 @@ -20606,19 +27328,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. @@ -20635,6 +27345,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20652,9 +27383,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - + export interface NewSubscriptionTierWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -20665,13 +27394,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. @@ -20688,7 +27419,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. @@ -20701,6 +27432,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20721,7 +27457,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 @@ -20737,34 +27473,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. @@ -20781,6 +27490,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20798,9 +27528,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - + export interface NewSubscriptionUnitWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -20811,13 +27539,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. @@ -20834,7 +27564,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. @@ -20847,6 +27577,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -20867,7 +27602,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 @@ -20883,28 +27618,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. @@ -20921,6 +27635,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -20938,26 +27673,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. @@ -20974,7 +27709,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. @@ -20987,6 +27722,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21007,7 +27747,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 @@ -21023,7 +27763,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. @@ -21040,6 +27780,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21057,26 +27818,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. @@ -21093,7 +27854,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. @@ -21106,6 +27867,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21126,7 +27892,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 @@ -21142,7 +27908,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. @@ -21159,6 +27925,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21176,7 +27963,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredWithMinimumPrice { + export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; + /** * The cadence to bill for this price on. */ @@ -21187,15 +27976,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. @@ -21212,7 +27999,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. @@ -21225,6 +28012,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21245,7 +28037,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 @@ -21261,7 +28053,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. @@ -21278,6 +28070,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21295,7 +28108,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithPercentPrice { + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * The cadence to bill for this price on. */ @@ -21306,14 +28119,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 @@ -21331,7 +28144,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. @@ -21344,6 +28157,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21364,7 +28182,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 @@ -21380,7 +28198,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. @@ -21397,6 +28215,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21414,7 +28253,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackageWithAllocationPrice { + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * The cadence to bill for this price on. */ @@ -21425,14 +28264,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 @@ -21450,7 +28289,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. @@ -21463,6 +28302,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21483,7 +28327,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 @@ -21499,7 +28343,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. @@ -21516,6 +28360,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21533,26 +28398,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. @@ -21569,7 +28434,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. @@ -21582,6 +28447,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21602,7 +28472,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 @@ -21618,7 +28488,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. @@ -21635,6 +28505,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21652,7 +28543,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithProrationPrice { + export interface NewSubscriptionMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -21663,15 +28554,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. @@ -21688,7 +28579,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. @@ -21701,6 +28592,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21721,7 +28617,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 @@ -21737,7 +28633,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. @@ -21754,6 +28650,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21771,20 +28688,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. @@ -21807,7 +28724,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. @@ -21820,6 +28737,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21840,7 +28762,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 @@ -21856,7 +28778,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. @@ -21873,6 +28795,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -21890,20 +28833,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. @@ -21926,7 +28869,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. @@ -21939,6 +28882,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -21959,7 +28907,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 @@ -21975,7 +28923,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. @@ -21992,6 +28940,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -22009,20 +28978,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. @@ -22045,7 +29014,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. @@ -22058,6 +29027,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -22078,7 +29052,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 @@ -22094,7 +29068,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. @@ -22111,6 +29085,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -22128,7 +29123,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { + export interface NewSubscriptionMatrixWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -22139,15 +29134,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'scalable_matrix_with_unit_pricing'; + matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_allocation'; /** * 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. @@ -22164,7 +29159,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22177,6 +29172,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -22197,7 +29197,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?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22213,7 +29213,45 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { + export namespace NewSubscriptionMatrixWithAllocationPrice { + 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. @@ -22230,6 +29268,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -22247,7 +29306,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { + export interface NewSubscriptionTieredPackageWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -22258,14 +29317,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'scalable_matrix_with_tiered_pricing'; + model_type: 'tiered_package_with_minimum'; /** * The name of the price. */ name: string; - scalable_matrix_with_tiered_pricing_config: Record; + tiered_package_with_minimum_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -22283,7 +29342,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22296,6 +29355,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -22316,7 +29380,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?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22332,7 +29396,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { + export namespace NewSubscriptionTieredPackageWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -22349,6 +29413,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -22366,20 +29451,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionCumulativeGroupedBulkPrice { + export interface NewSubscriptionGroupedTieredPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; + grouped_tiered_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'cumulative_grouped_bulk'; + model_type: 'grouped_tiered'; /** * The name of the price. @@ -22402,7 +29487,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22415,6 +29500,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -22435,7 +29525,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?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22451,7 +29541,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionCumulativeGroupedBulkPrice { + export namespace NewSubscriptionGroupedTieredPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -22468,6 +29558,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -22484,146 +29595,323 @@ 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'; + + percentage_discount: number; - export interface NewSubscriptionMaxGroupTieredPackagePrice { /** - * 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 | null; /** - * 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. + */ + is_invoice_level?: boolean; + } + + export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | 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. + */ + 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 | 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. + */ + is_invoice_level?: boolean; + } + + export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. */ item_id: string; - max_group_tiered_package_config: Record; + minimum_amount: string; - model_type: 'max_group_tiered_package'; + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | null; /** - * The name of the price. + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. */ - name: string; + is_invoice_level?: boolean; + } + + export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. + * The set of price IDs to which this adjustment applies. */ - billable_metric_id?: string | null; + applies_to_price_ids?: Array | 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. + */ + 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 + | ReplacePrice.NewSubscriptionMatrixWithAllocationPrice + | ReplacePrice.NewSubscriptionTieredPackageWithMinimumPrice + | ReplacePrice.NewSubscriptionGroupedTieredPrice + | 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; + /** + * 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 { /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * An amount of the currency to allocate to the customer at the specified cadence. */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + amount: string; /** - * The per unit conversion rate of the price currency to the invoicing currency. + * The cadence at which to allocate the amount to the customer. */ - conversion_rate?: number | null; + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. */ - currency?: string | null; + currency: string; /** - * An alias for the price. + * The custom expiration for the allocation. */ - external_price_id?: string | null; + custom_expiration?: AllocationPrice.CustomExpiration | null; /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. */ - fixed_price_quantity?: number | null; + expires_at_end_of_cadence?: boolean | null; + } + export namespace AllocationPrice { /** - * The property used to group this price on an invoice + * The custom expiration for the allocation. */ - invoice_grouping_key?: string | null; + export interface CustomExpiration { + duration: number; - /** - * 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?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; + duration_unit: 'day' | 'month'; + } + } - /** - * 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 NewSubscriptionMaxGroupTieredPackagePrice { /** - * 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 NewSubscriptionGroupedWithMeteredMinimumPrice { + export interface NewSubscriptionUnitPrice { /** * 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: 'grouped_with_metered_minimum'; + 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. @@ -22640,7 +29928,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22653,6 +29941,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -22673,7 +29966,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?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22689,7 +29982,14 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { + 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. @@ -22706,6 +30006,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -22723,7 +30044,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMatrixWithDisplayNamePrice { + export interface NewSubscriptionPackagePrice { /** * The cadence to bill for this price on. */ @@ -22734,15 +30055,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; + 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. @@ -22759,7 +30080,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22772,6 +30093,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -22792,7 +30118,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?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22808,28 +30134,25 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { + export namespace NewSubscriptionPackagePrice { + export interface PackageConfig { /** - * The duration of the billing period. + * A currency amount to rate usage by */ - duration: number; + package_amount: string; /** - * The unit of billing period duration. + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating */ - duration_unit: 'day' | 'month'; + package_size: number; } /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - export interface InvoicingCycleConfiguration { + export interface BillingCycleConfiguration { /** * The duration of the billing period. */ @@ -22840,108 +30163,26 @@ export namespace SubscriptionSchedulePlanChangeParams { */ duration_unit: 'day' | 'month'; } - } - - 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: '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?: 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. - */ - 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?: NewSubscriptionGroupedTieredPackagePrice.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 NewSubscriptionGroupedTieredPackagePrice { /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * For dimensional price: specifies a price group and dimension values */ - export interface BillingCycleConfiguration { + export interface DimensionalPriceConfiguration { /** - * The duration of the billing period. + * The list of dimension values matching (in order) the dimensions of the price + * group */ - duration: number; + dimension_values: Array; /** - * The unit of billing period duration. + * The id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; } /** @@ -22960,285 +30201,186 @@ 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 NewSubscriptionMatrixPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - 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 item the price will be associated with. + */ + item_id: string; - /** - * The id of the adjustment on the plan to replace in the subscription. - */ - replaces_adjustment_id: string; - } + matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; + model_type: 'matrix'; /** - * The set of price IDs to which this adjustment applies. + * The name of the price. */ - applies_to_price_ids: Array; - - percentage_discount: number; + name: 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. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; + billable_metric_id?: string | null; /** - * The set of price IDs to which this adjustment applies. + * 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. */ - applies_to_price_ids: Array; - - usage_discount: number; + 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; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; + billing_cycle_configuration?: NewSubscriptionMatrixPrice.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; /** - * 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 NewMinimum { - adjustment_type: 'minimum'; + currency?: string | null; /** - * The set of price IDs to which this adjustment applies. + * For dimensional price: specifies a price group and dimension values */ - applies_to_price_ids: Array; + dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; /** - * The item ID that revenue from this minimum will be attributed to. + * An alias for the price. */ - item_id: string; - - minimum_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; - } + fixed_price_quantity?: number | null; - export interface NewMaximum { - adjustment_type: 'maximum'; + /** + * 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?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; - maximum_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; /** - * 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 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; + export namespace NewSubscriptionMatrixPrice { + export interface MatrixConfig { + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; - /** - * 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; + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - } + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; + } - 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; + 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; - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + /** + * Unit price for the specified dimension_values + */ + unit_amount: string; + } + } /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - currency: string; + export interface BillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. + * For dimensional price: specifies a price group and dimension values */ - expires_at_end_of_cadence: boolean; - } + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; - /** - * Only available if discount_type is `amount`. - */ - amount_discount?: string | null; + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - percentage_discount?: number | null; + export interface InvoicingCycleConfiguration { + /** + * 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 | null; + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } } - export interface NewSubscriptionUnitPrice { + export interface NewSubscriptionTieredPrice { /** * The cadence to bill for this price on. */ @@ -23249,14 +30391,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit'; + model_type: 'tiered'; /** * The name of the price. */ name: string; - unit_config: NewSubscriptionUnitPrice.UnitConfig; + tiered_config: NewSubscriptionTieredPrice.TieredConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -23274,7 +30416,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?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23287,6 +30429,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -23307,7 +30454,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?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -23323,12 +30470,31 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { + export namespace NewSubscriptionTieredPrice { + export interface TieredConfig { /** - * Rate per unit of usage + * Tiers for rating based on total usage quantities into the specified tier */ - unit_amount: string; + tiers: Array; + } + + export namespace TieredConfig { + export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; + } } /** @@ -23347,6 +30513,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -23364,7 +30551,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackagePrice { + export interface NewSubscriptionTieredBpsPrice { /** * The cadence to bill for this price on. */ @@ -23375,14 +30562,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'package'; + model_type: 'tiered_bps'; /** * The name of the price. */ name: string; - package_config: NewSubscriptionPackagePrice.PackageConfig; + tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -23400,7 +30587,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?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23413,6 +30600,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -23433,7 +30625,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?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -23449,18 +30641,37 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { + export namespace NewSubscriptionTieredBpsPrice { + export interface TieredBpsConfig { /** - * A currency amount to rate usage by + * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + * tiers */ - package_amount: string; + tiers: Array; + } - /** - * 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 TieredBpsConfig { + export interface Tier { + /** + * Per-event basis point rate + */ + bps: number; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive tier ending value + */ + maximum_amount?: string | null; + + /** + * Per unit maximum to charge + */ + per_unit_maximum?: string | null; + } } /** @@ -23479,6 +30690,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -23496,7 +30728,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMatrixPrice { + export interface NewSubscriptionBpsPrice { + bps_config: NewSubscriptionBpsPrice.BpsConfig; + /** * The cadence to bill for this price on. */ @@ -23507,9 +30741,7 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; + model_type: 'bps'; /** * The name of the price. @@ -23532,7 +30764,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?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23545,6 +30777,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -23565,7 +30802,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?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -23581,38 +30818,17 @@ 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; - + export namespace NewSubscriptionBpsPrice { + export interface BpsConfig { /** - * One or two event property values to evaluate matrix groups by + * Basis point take rate per event */ - dimensions: Array; + bps: number; /** - * Matrix values for specified matrix grouping keys + * Optional currency amount maximum to cap spend per event */ - 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; - } + per_unit_maximum?: string | null; } /** @@ -23628,7 +30844,28 @@ export namespace SubscriptionSchedulePlanChangeParams { /** * The unit of billing period duration. */ - duration_unit: 'day' | 'month'; + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; } /** @@ -23648,7 +30885,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPrice { + export interface NewSubscriptionBulkBpsPrice { + bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; + /** * The cadence to bill for this price on. */ @@ -23659,15 +30898,13 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered'; + model_type: 'bulk_bps'; /** * 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. @@ -23684,7 +30921,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?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23697,6 +30934,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -23717,7 +30959,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?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -23733,30 +30975,31 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { + export namespace NewSubscriptionBulkBpsPrice { + export interface BulkBpsConfig { /** - * Tiers for rating based on total usage quantities into the specified tier + * Tiers for a bulk BPS pricing model where all usage is aggregated to a single + * tier based on total volume */ - tiers: Array; + tiers: Array; } - export namespace TieredConfig { + export namespace BulkBpsConfig { export interface Tier { /** - * Exclusive tier starting value + * Basis points to rate on */ - first_unit: number; + bps: number; /** - * Amount per unit + * Upper bound for tier */ - unit_amount: string; + maximum_amount?: string | null; /** - * Inclusive tier ending value. If null, this is treated as the last tier + * The maximum amount to charge for any one event */ - last_unit?: number | null; + per_unit_maximum?: string | null; } } @@ -23776,6 +31019,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -23793,7 +31057,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredBpsPrice { + export interface NewSubscriptionBulkPrice { + bulk_config: NewSubscriptionBulkPrice.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -23804,15 +31070,13 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_bps'; + model_type: 'bulk'; /** * 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. @@ -23829,7 +31093,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?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23842,6 +31106,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -23862,7 +31131,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?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -23878,36 +31147,25 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { + export namespace NewSubscriptionBulkPrice { + export interface BulkConfig { /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers + * Bulk tiers for rating based on total usage volume */ - tiers: Array; + tiers: Array; } - export namespace TieredBpsConfig { + export namespace BulkConfig { export interface Tier { /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value + * Amount per unit */ - maximum_amount?: string | null; + unit_amount: string; /** - * Per unit maximum to charge + * Upper bound for this tier */ - per_unit_maximum?: string | null; + maximum_units?: number | null; } } @@ -23927,6 +31185,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -23944,9 +31223,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - + export interface NewSubscriptionThresholdTotalAmountPrice { /** * The cadence to bill for this price on. */ @@ -23957,13 +31234,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bps'; + 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. @@ -23980,7 +31259,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?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23993,6 +31272,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24013,7 +31297,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?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24029,19 +31313,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 NewSubscriptionThresholdTotalAmountPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24058,6 +31330,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24075,9 +31368,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - + export interface NewSubscriptionTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -24088,13 +31379,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'bulk_bps'; + 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. @@ -24111,7 +31404,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?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24124,6 +31417,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24144,7 +31442,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?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24160,34 +31458,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 NewSubscriptionTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24204,6 +31475,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24221,9 +31513,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - + export interface NewSubscriptionTieredWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -24234,13 +31524,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: '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. @@ -24257,7 +31549,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?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24270,6 +31562,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24290,7 +31587,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?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24306,28 +31603,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 NewSubscriptionTieredWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24339,9 +31615,30 @@ export namespace SubscriptionSchedulePlanChangeParams { duration: number; /** - * The unit of billing period duration. + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in */ - duration_unit: 'day' | 'month'; + external_dimensional_price_group_id?: string | null; } /** @@ -24361,7 +31658,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionThresholdTotalAmountPrice { + export interface NewSubscriptionUnitWithPercentPrice { /** * The cadence to bill for this price on. */ @@ -24372,14 +31669,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'threshold_total_amount'; + model_type: 'unit_with_percent'; /** * The name of the price. */ name: string; - threshold_total_amount_config: Record; + unit_with_percent_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -24397,7 +31694,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?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24410,6 +31707,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24430,7 +31732,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?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24446,7 +31748,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionThresholdTotalAmountPrice { + export namespace NewSubscriptionUnitWithPercentPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24463,6 +31765,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24480,7 +31803,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredPackagePrice { + export interface NewSubscriptionPackageWithAllocationPrice { /** * The cadence to bill for this price on. */ @@ -24491,14 +31814,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_package'; + model_type: 'package_with_allocation'; /** * The name of the price. */ name: string; - tiered_package_config: Record; + package_with_allocation_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -24516,7 +31839,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?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24529,6 +31852,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24549,7 +31877,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?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24565,7 +31893,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredPackagePrice { + export namespace NewSubscriptionPackageWithAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24582,6 +31910,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24599,7 +31948,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTieredWithMinimumPrice { + export interface NewSubscriptionTierWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -24610,14 +31959,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'tiered_with_minimum'; + model_type: 'tiered_with_proration'; /** * The name of the price. */ name: string; - tiered_with_minimum_config: Record; + tiered_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -24635,7 +31984,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?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24648,6 +31997,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24668,7 +32022,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?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24684,7 +32038,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTieredWithMinimumPrice { + export namespace NewSubscriptionTierWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24701,6 +32055,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24718,7 +32093,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithPercentPrice { + export interface NewSubscriptionUnitWithProrationPrice { /** * The cadence to bill for this price on. */ @@ -24729,14 +32104,14 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit_with_percent'; + model_type: 'unit_with_proration'; /** * The name of the price. */ name: string; - unit_with_percent_config: Record; + unit_with_proration_config: Record; /** * The id of the billable metric for the price. Only needed if the price is @@ -24754,7 +32129,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?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24767,6 +32142,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24787,7 +32167,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?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24803,7 +32183,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithPercentPrice { + export namespace NewSubscriptionUnitWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24820,6 +32200,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24837,26 +32238,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionPackageWithAllocationPrice { + 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_with_allocation'; + model_type: 'grouped_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. @@ -24873,7 +32274,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?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -24886,6 +32287,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -24906,7 +32312,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?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24922,7 +32328,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionPackageWithAllocationPrice { + export namespace NewSubscriptionGroupedAllocationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -24939,6 +32345,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -24956,26 +32383,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionTierWithProrationPrice { + 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_with_proration'; + model_type: 'grouped_with_prorated_minimum'; /** * 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. @@ -24992,7 +32419,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?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25005,6 +32432,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25025,7 +32457,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?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25041,7 +32473,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionTierWithProrationPrice { + export namespace NewSubscriptionGroupedWithProratedMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25058,6 +32490,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25075,7 +32528,9 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionUnitWithProrationPrice { + export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; + /** * The cadence to bill for this price on. */ @@ -25086,15 +32541,13 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'unit_with_proration'; + model_type: 'bulk_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. @@ -25111,7 +32564,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?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25124,6 +32577,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25144,7 +32602,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?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25160,7 +32618,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionUnitWithProrationPrice { + export namespace NewSubscriptionBulkWithProrationPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25177,6 +32635,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25194,26 +32673,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedAllocationPrice { + export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * 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: '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. @@ -25230,7 +32709,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?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25243,6 +32722,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25263,7 +32747,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?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25279,7 +32763,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedAllocationPrice { + export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25296,6 +32780,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25313,26 +32818,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedWithProratedMinimumPrice { + export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * 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: '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. @@ -25349,7 +32854,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?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25362,6 +32867,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25382,7 +32892,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?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25398,7 +32908,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { + export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25412,7 +32922,28 @@ export namespace SubscriptionSchedulePlanChangeParams { /** * The unit of billing period duration. */ - duration_unit: 'day' | 'month'; + duration_unit: 'day' | 'month'; + } + + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; } /** @@ -25432,20 +32963,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - + 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_with_proration'; + model_type: 'cumulative_grouped_bulk'; /** * The name of the price. @@ -25468,7 +32999,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?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25481,6 +33012,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25501,7 +33037,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?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25517,7 +33053,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionBulkWithProrationPrice { + export namespace NewSubscriptionCumulativeGroupedBulkPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25534,6 +33070,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25551,7 +33108,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { + export interface NewSubscriptionMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. */ @@ -25562,15 +33119,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - model_type: 'scalable_matrix_with_unit_pricing'; + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; /** * 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. @@ -25587,7 +33144,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25600,6 +33157,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25620,7 +33182,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?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25636,7 +33198,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { + export namespace NewSubscriptionMaxGroupTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25653,6 +33215,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25670,26 +33253,26 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { + 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: 'scalable_matrix_with_tiered_pricing'; + model_type: 'grouped_with_metered_minimum'; /** * 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. @@ -25706,7 +33289,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25719,6 +33302,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25739,7 +33327,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?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25755,7 +33343,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { + export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25772,6 +33360,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25789,20 +33398,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionCumulativeGroupedBulkPrice { + export interface NewSubscriptionMatrixWithDisplayNamePrice { /** * 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: 'cumulative_grouped_bulk'; + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; /** * The name of the price. @@ -25825,7 +33434,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25838,6 +33447,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25858,7 +33472,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?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25874,7 +33488,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionCumulativeGroupedBulkPrice { + export namespace NewSubscriptionMatrixWithDisplayNamePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -25891,6 +33505,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -25908,20 +33543,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMaxGroupTieredPackagePrice { + 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; - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; + model_type: 'grouped_tiered_package'; /** * The name of the price. @@ -25944,7 +33579,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25957,6 +33592,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -25977,7 +33617,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?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25993,7 +33633,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionMaxGroupTieredPackagePrice { + export namespace NewSubscriptionGroupedTieredPackagePrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -26010,6 +33650,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -26027,20 +33688,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedWithMeteredMinimumPrice { + export interface NewSubscriptionMatrixWithAllocationPrice { /** * 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: 'grouped_with_metered_minimum'; + matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; + + model_type: 'matrix_with_allocation'; /** * The name of the price. @@ -26063,7 +33724,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -26076,6 +33737,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -26096,7 +33762,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?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -26112,7 +33778,45 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { + export namespace NewSubscriptionMatrixWithAllocationPrice { + 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. @@ -26129,6 +33833,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -26146,7 +33871,7 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionMatrixWithDisplayNamePrice { + export interface NewSubscriptionTieredPackageWithMinimumPrice { /** * The cadence to bill for this price on. */ @@ -26157,15 +33882,15 @@ export namespace SubscriptionSchedulePlanChangeParams { */ item_id: string; - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; + model_type: 'tiered_package_with_minimum'; /** * The name of the price. */ name: string; + tiered_package_with_minimum_config: Record; + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -26182,7 +33907,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -26195,6 +33920,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -26215,7 +33945,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?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -26231,7 +33961,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionMatrixWithDisplayNamePrice { + export namespace NewSubscriptionTieredPackageWithMinimumPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -26248,6 +33978,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -26265,20 +34016,20 @@ export namespace SubscriptionSchedulePlanChangeParams { } } - export interface NewSubscriptionGroupedTieredPackagePrice { + export interface NewSubscriptionGroupedTieredPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_tiered_package_config: Record; + grouped_tiered_config: Record; /** * The id of the item the price will be associated with. */ item_id: string; - model_type: 'grouped_tiered_package'; + model_type: 'grouped_tiered'; /** * The name of the price. @@ -26301,7 +34052,7 @@ export namespace SubscriptionSchedulePlanChangeParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -26314,6 +34065,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ currency?: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; + /** * An alias for the price. */ @@ -26334,7 +34090,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?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -26350,7 +34106,7 @@ export namespace SubscriptionSchedulePlanChangeParams { reference_id?: string | null; } - export namespace NewSubscriptionGroupedTieredPackagePrice { + export namespace NewSubscriptionGroupedTieredPrice { /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -26367,6 +34123,27 @@ export namespace SubscriptionSchedulePlanChangeParams { duration_unit: 'day' | 'month'; } + /** + * For dimensional price: specifies a price group and dimension values + */ + export interface DimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; + } + /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. @@ -26432,7 +34209,7 @@ export interface SubscriptionUpdateFixedFeeQuantityParams { /** * The date that the quantity change should take effect, localized to the - * customer's timezone. Ifthis parameter is not passed in, the quantity change is + * customer's timezone. If this parameter is not passed in, the quantity change is * effective according to `change_option`. */ effective_date?: string | null; diff --git a/src/version.ts b/src/version.ts index 870907ad..4e3a33b1 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.72.3'; // x-release-please-version +export const VERSION = '4.73.0'; // x-release-please-version diff --git a/tests/api-resources/beta/beta.test.ts b/tests/api-resources/beta/beta.test.ts new file mode 100644 index 00000000..ca5c95f5 --- /dev/null +++ b/tests/api-resources/beta/beta.test.ts @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Orb from 'orb-billing'; +import { Response } from 'node-fetch'; + +const client = new Orb({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource beta', () => { + test('createPlanVersion: only required params', async () => { + const responsePromise = client.beta.createPlanVersion('plan_id', { version: 0 }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('createPlanVersion: required and optional params', async () => { + const response = await client.beta.createPlanVersion('plan_id', { + version: 0, + add_adjustments: [ + { + adjustment: { + adjustment_type: 'percentage_discount', + percentage_discount: 0, + applies_to_price_ids: ['price_1', 'price_2'], + is_invoice_level: true, + }, + plan_phase_order: 0, + }, + ], + add_prices: [ + { + allocation_price: { + amount: '10.00', + cadence: 'monthly', + currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, + expires_at_end_of_cadence: true, + }, + plan_phase_order: 0, + price: { + cadence: 'annual', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + }, + }, + ], + remove_adjustments: [{ adjustment_id: 'adjustment_id', plan_phase_order: 0 }], + remove_prices: [{ price_id: 'price_id', plan_phase_order: 0 }], + replace_adjustments: [ + { + adjustment: { + adjustment_type: 'percentage_discount', + percentage_discount: 0, + applies_to_price_ids: ['price_1', 'price_2'], + is_invoice_level: true, + }, + replaces_adjustment_id: 'replaces_adjustment_id', + plan_phase_order: 0, + }, + ], + replace_prices: [ + { + replaces_price_id: 'replaces_price_id', + allocation_price: { + amount: '10.00', + cadence: 'monthly', + currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, + expires_at_end_of_cadence: true, + }, + plan_phase_order: 0, + price: { + cadence: 'annual', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + }, + }, + ], + set_as_default: true, + }); + }); + + test('fetchPlanVersion', async () => { + const responsePromise = client.beta.fetchPlanVersion('plan_id', 'version'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('fetchPlanVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.beta.fetchPlanVersion('plan_id', 'version', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); + + test('setDefaultPlanVersion: only required params', async () => { + const responsePromise = client.beta.setDefaultPlanVersion('plan_id', { version: 0 }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('setDefaultPlanVersion: required and optional params', async () => { + const response = await client.beta.setDefaultPlanVersion('plan_id', { version: 0 }); + }); +}); diff --git a/tests/api-resources/beta/external-plan-id.test.ts b/tests/api-resources/beta/external-plan-id.test.ts new file mode 100644 index 00000000..897c1ded --- /dev/null +++ b/tests/api-resources/beta/external-plan-id.test.ts @@ -0,0 +1,162 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Orb from 'orb-billing'; +import { Response } from 'node-fetch'; + +const client = new Orb({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource externalPlanId', () => { + test('createPlanVersion: only required params', async () => { + const responsePromise = client.beta.externalPlanId.createPlanVersion('external_plan_id', { version: 0 }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('createPlanVersion: required and optional params', async () => { + const response = await client.beta.externalPlanId.createPlanVersion('external_plan_id', { + version: 0, + add_adjustments: [ + { + adjustment: { + adjustment_type: 'percentage_discount', + percentage_discount: 0, + applies_to_price_ids: ['price_1', 'price_2'], + is_invoice_level: true, + }, + plan_phase_order: 0, + }, + ], + add_prices: [ + { + allocation_price: { + amount: '10.00', + cadence: 'monthly', + currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, + expires_at_end_of_cadence: true, + }, + plan_phase_order: 0, + price: { + cadence: 'annual', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + }, + }, + ], + remove_adjustments: [{ adjustment_id: 'adjustment_id', plan_phase_order: 0 }], + remove_prices: [{ price_id: 'price_id', plan_phase_order: 0 }], + replace_adjustments: [ + { + adjustment: { + adjustment_type: 'percentage_discount', + percentage_discount: 0, + applies_to_price_ids: ['price_1', 'price_2'], + is_invoice_level: true, + }, + replaces_adjustment_id: 'replaces_adjustment_id', + plan_phase_order: 0, + }, + ], + replace_prices: [ + { + replaces_price_id: 'replaces_price_id', + allocation_price: { + amount: '10.00', + cadence: 'monthly', + currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, + expires_at_end_of_cadence: true, + }, + plan_phase_order: 0, + price: { + cadence: 'annual', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + }, + }, + ], + set_as_default: true, + }); + }); + + test('fetchPlanVersion', async () => { + const responsePromise = client.beta.externalPlanId.fetchPlanVersion('external_plan_id', 'version'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('fetchPlanVersion: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.beta.externalPlanId.fetchPlanVersion('external_plan_id', 'version', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Orb.NotFoundError); + }); + + test('setDefaultPlanVersion: only required params', async () => { + const responsePromise = client.beta.externalPlanId.setDefaultPlanVersion('external_plan_id', { + version: 0, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('setDefaultPlanVersion: required and optional params', async () => { + const response = await client.beta.externalPlanId.setDefaultPlanVersion('external_plan_id', { + version: 0, + }); + }); +}); diff --git a/tests/api-resources/credit-notes.test.ts b/tests/api-resources/credit-notes.test.ts index af78fd97..3bc948e5 100644 --- a/tests/api-resources/credit-notes.test.ts +++ b/tests/api-resources/credit-notes.test.ts @@ -12,6 +12,7 @@ describe('resource creditNotes', () => { test('create: only required params', async () => { const responsePromise = client.creditNotes.create({ line_items: [{ amount: 'amount', invoice_line_item_id: '4khy3nwzktxv7' }], + reason: 'duplicate', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,8 +26,8 @@ describe('resource creditNotes', () => { test('create: required and optional params', async () => { const response = await client.creditNotes.create({ line_items: [{ amount: 'amount', invoice_line_item_id: '4khy3nwzktxv7' }], - memo: 'An optional memo for my credit note.', reason: 'duplicate', + memo: 'An optional memo for my credit note.', }); }); diff --git a/tests/api-resources/invoices.test.ts b/tests/api-resources/invoices.test.ts index 8cf01698..32833614 100644 --- a/tests/api-resources/invoices.test.ts +++ b/tests/api-resources/invoices.test.ts @@ -53,9 +53,9 @@ describe('resource invoices', () => { net_terms: 0, customer_id: '4khy3nwzktxv7', discount: { - applies_to_price_ids: ['h74gfhdjvn7ujokd', '7hfgtgjnbvc3ujkl'], discount_type: 'percentage', percentage_discount: 0.15, + applies_to_price_ids: ['h74gfhdjvn7ujokd', '7hfgtgjnbvc3ujkl'], reason: 'reason', }, external_customer_id: 'external-customer-id', diff --git a/tests/api-resources/items.test.ts b/tests/api-resources/items.test.ts index c04b5a7c..4d1044d9 100644 --- a/tests/api-resources/items.test.ts +++ b/tests/api-resources/items.test.ts @@ -21,7 +21,7 @@ describe('resource items', () => { }); test('create: required and optional params', async () => { - const response = await client.items.create({ name: 'API requests' }); + const response = await client.items.create({ name: 'API requests', metadata: { foo: 'string' } }); }); test('update', async () => { @@ -58,6 +58,24 @@ describe('resource items', () => { ).rejects.toThrow(Orb.NotFoundError); }); + test('archive', async () => { + const responsePromise = client.items.archive('item_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('archive: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.items.archive('item_id', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Orb.NotFoundError, + ); + }); + test('fetch', async () => { const responsePromise = client.items.fetch('item_id'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/plans/plans.test.ts b/tests/api-resources/plans/plans.test.ts index 8cb366a7..826ac4de 100644 --- a/tests/api-resources/plans/plans.test.ts +++ b/tests/api-resources/plans/plans.test.ts @@ -48,9 +48,14 @@ describe('resource plans', () => { billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, conversion_rate: 0, currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, external_price_id: 'external_price_id', fixed_price_quantity: 0, - invoice_grouping_key: 'invoice_grouping_key', + invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, }, diff --git a/tests/api-resources/prices/prices.test.ts b/tests/api-resources/prices/prices.test.ts index e41c5cc2..beb9ff72 100644 --- a/tests/api-resources/prices/prices.test.ts +++ b/tests/api-resources/prices/prices.test.ts @@ -39,9 +39,14 @@ describe('resource prices', () => { billed_in_advance: true, billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, conversion_rate: 0, + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, external_price_id: 'external_price_id', fixed_price_quantity: 0, - invoice_grouping_key: 'invoice_grouping_key', + invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, }); @@ -106,6 +111,67 @@ describe('resource prices', () => { }); }); + test('evaluateMultiple: only required params', async () => { + const responsePromise = client.prices.evaluateMultiple({ + timeframe_end: '2019-12-27T18:11:19.117Z', + timeframe_start: '2019-12-27T18:11:19.117Z', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('evaluateMultiple: required and optional params', async () => { + const response = await client.prices.evaluateMultiple({ + timeframe_end: '2019-12-27T18:11:19.117Z', + timeframe_start: '2019-12-27T18:11:19.117Z', + customer_id: 'customer_id', + events: [ + { + event_name: 'event_name', + properties: {}, + timestamp: '2020-12-09T16:09:53Z', + customer_id: 'customer_id', + external_customer_id: 'external_customer_id', + }, + ], + external_customer_id: 'external_customer_id', + price_evaluations: [ + { + filter: "my_numeric_property > 100 AND my_other_property = 'bar'", + grouping_keys: ["case when my_event_type = 'foo' then true else false end"], + price: { + cadence: 'annual', + currency: 'currency', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + }, + price_id: 'price_id', + }, + ], + }); + }); + test('fetch', async () => { const responsePromise = client.prices.fetch('price_id'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index b6cd015e..4a8e294b 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -253,8 +253,8 @@ describe('resource subscriptions', () => { { adjustment: { adjustment_type: 'percentage_discount', - applies_to_price_ids: ['price_1', 'price_2'], percentage_discount: 0, + applies_to_price_ids: ['price_1', 'price_2'], is_invoice_level: true, }, end_date: '2019-12-27T18:11:19.117Z', @@ -268,6 +268,7 @@ describe('resource subscriptions', () => { amount: '10.00', cadence: 'monthly', currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, expires_at_end_of_cadence: true, }, discounts: [ @@ -294,9 +295,14 @@ describe('resource subscriptions', () => { billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, conversion_rate: 0, currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, external_price_id: 'external_price_id', fixed_price_quantity: 0, - invoice_grouping_key: 'invoice_grouping_key', + invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, reference_id: 'reference_id', @@ -328,8 +334,8 @@ describe('resource subscriptions', () => { { adjustment: { adjustment_type: 'percentage_discount', - applies_to_price_ids: ['price_1', 'price_2'], percentage_discount: 0, + applies_to_price_ids: ['price_1', 'price_2'], is_invoice_level: true, }, replaces_adjustment_id: 'replaces_adjustment_id', @@ -342,6 +348,7 @@ describe('resource subscriptions', () => { amount: '10.00', cadence: 'monthly', currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, expires_at_end_of_cadence: true, }, discounts: [ @@ -367,9 +374,14 @@ describe('resource subscriptions', () => { billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, conversion_rate: 0, currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, external_price_id: 'external_price_id', fixed_price_quantity: 0, - invoice_grouping_key: 'invoice_grouping_key', + invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, reference_id: 'reference_id', diff --git a/tests/index.test.ts b/tests/index.test.ts index 3e2a325a..8041812b 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -209,10 +209,7 @@ describe('idempotency', () => { baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', apiKey: 'My API Key', }); - await client.coupons.create( - { discount: { discount_type: 'percentage', percentage_discount: 0 }, redemption_code: 'HALFOFF' }, - { idempotencyKey: 'my-idempotency-key' }, - ); + await client.beta.createPlanVersion('plan_id', { version: 0 }, { idempotencyKey: 'my-idempotency-key' }); }); });