diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 27e41843..98144b04 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.64.0"
+ ".": "4.65.0"
}
diff --git a/.stats.yml b/.stats.yml
index 5776427f..715ea230 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 103
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c8fc7d0bf70bf7ed91a141f346a02929e4d25a6fac7b59f58b68136ed6ff024f.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-48084a007f009b4358484f09a3a7b74a990c402669f9d15adfbb60e4f835f951.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f727531..62c1b83a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,16 @@
# Changelog
+## 4.65.0 (2025-03-05)
+
+Full Changelog: [v4.64.0...v4.65.0](https://github.com/orbcorp/orb-node/compare/v4.64.0...v4.65.0)
+
+### Features
+
+* **api:** api update ([#535](https://github.com/orbcorp/orb-node/issues/535)) ([42e41ce](https://github.com/orbcorp/orb-node/commit/42e41cebe5784cbc254d503ae49111b682d066c9))
+* **api:** manual updates ([#538](https://github.com/orbcorp/orb-node/issues/538)) ([5f99471](https://github.com/orbcorp/orb-node/commit/5f994713a02b7ca7def32339dc7cb530bf964cec))
+* **api:** manual updates ([#540](https://github.com/orbcorp/orb-node/issues/540)) ([e144b49](https://github.com/orbcorp/orb-node/commit/e144b49763b1d755088ecb2f478943107387d6d4))
+* **api:** manual updates ([#542](https://github.com/orbcorp/orb-node/issues/542)) ([970f1b8](https://github.com/orbcorp/orb-node/commit/970f1b873462bc1d5609b694d43fca2c1749c4f1))
+
## 4.64.0 (2025-03-01)
Full Changelog: [v4.63.0...v4.64.0](https://github.com/orbcorp/orb-node/compare/v4.63.0...v4.64.0)
diff --git a/api.md b/api.md
index 12415ef6..c9764db2 100644
--- a/api.md
+++ b/api.md
@@ -11,6 +11,7 @@ Types:
- TrialDiscount
- UsageDiscount
+
# TopLevel
Types:
diff --git a/package.json b/package.json
index 0d3332cc..192a6208 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
- "version": "4.64.0",
+ "version": "4.65.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb ",
"types": "dist/index.d.ts",
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index ab2dbcef..1c9387b6 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -21,24 +21,6 @@ export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
export type Discount = PercentageDiscount | TrialDiscount | UsageDiscount | AmountDiscount;
-export interface UsageDiscount {
- /**
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
- * this can be a subset of prices.
- */
- applies_to_price_ids: Array;
-
- discount_type: 'usage';
-
- /**
- * Only available if discount_type is `usage`. Number of usage units that this
- * discount is for
- */
- usage_discount: number;
-
- reason?: string | null;
-}
-
export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount;
export interface PaginationMetadata {
@@ -86,3 +68,21 @@ export interface TrialDiscount {
*/
trial_percentage_discount?: number | null;
}
+
+export interface UsageDiscount {
+ /**
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
+ * this can be a subset of prices.
+ */
+ applies_to_price_ids: Array;
+
+ discount_type: 'usage';
+
+ /**
+ * Only available if discount_type is `usage`. Number of usage units that this
+ * discount is for
+ */
+ usage_discount: number;
+
+ reason?: string | null;
+}
diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts
index ea5cfe0e..292186d9 100644
--- a/src/resources/subscriptions.ts
+++ b/src/resources/subscriptions.ts
@@ -8346,6 +8346,13 @@ export namespace SubscriptionCreateParams {
| AddPrice.NewSubscriptionGroupedAllocationPrice
| AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice
| AddPrice.NewSubscriptionBulkWithProrationPrice
+ | AddPrice.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | AddPrice.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | AddPrice.NewSubscriptionCumulativeGroupedBulkPrice
+ | AddPrice.NewSubscriptionMaxGroupTieredPackagePrice
+ | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice
+ | AddPrice.NewSubscriptionGroupedTieredPackagePrice
| null;
/**
@@ -10722,297 +10729,265 @@ export namespace SubscriptionCreateParams {
duration_unit: 'day' | 'month';
}
}
- }
- export interface BillingCycleAnchorConfiguration {
- /**
- * The day of the month on which the billing cycle is anchored. If the maximum
- * number of days in a month is greater than this value, the last day of the month
- * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
- * period begins on the 30th.
- */
- day: number;
+ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * The month on which the billing cycle is anchored (e.g. a quarterly price
- * anchored in February would have cycles starting February, May, August, and
- * November).
- */
- month?: number | null;
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
- /**
- * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
- * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
- */
- year?: number | null;
- }
+ model_type: 'scalable_matrix_with_unit_pricing';
- export interface RemoveAdjustment {
- /**
- * The id of the adjustment to remove on the subscription.
- */
- adjustment_id: string;
- }
+ /**
+ * The name of the price.
+ */
+ name: string;
- export interface RemovePrice {
- /**
- * The external price id of the price to remove on the subscription.
- */
- external_price_id?: string | null;
+ scalable_matrix_with_unit_pricing_config: Record;
- /**
- * The id of the price to remove on the subscription.
- */
- price_id?: string | null;
- }
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
- export interface ReplaceAdjustment {
- /**
- * The definition of a new adjustment to create and add to the subscription.
- */
- adjustment:
- | ReplaceAdjustment.NewPercentageDiscount
- | ReplaceAdjustment.NewUsageDiscount
- | ReplaceAdjustment.NewAmountDiscount
- | ReplaceAdjustment.NewMinimum
- | ReplaceAdjustment.NewMaximum;
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
- /**
- * The id of the adjustment on the plan to replace in the subscription.
- */
- replaces_adjustment_id: string;
- }
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null;
- export namespace ReplaceAdjustment {
- export interface NewPercentageDiscount {
- adjustment_type: 'percentage_discount';
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
*/
- applies_to_price_ids: Array;
+ currency?: string | null;
- percentage_discount: number;
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
*/
- is_invoice_level?: boolean;
- }
+ fixed_price_quantity?: number | null;
- export interface NewUsageDiscount {
- adjustment_type: 'usage_discount';
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- applies_to_price_ids: Array;
+ invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null;
- usage_discount: number;
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
*/
- is_invoice_level?: boolean;
+ reference_id?: string | null;
}
- export interface NewAmountDiscount {
- adjustment_type: 'amount_discount';
-
- amount_discount: string;
-
+ export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice {
/**
- * The set of price IDs to which this adjustment applies.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- applies_to_price_ids: Array;
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- is_invoice_level?: boolean;
- }
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- export interface NewMinimum {
- adjustment_type: 'minimum';
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
/**
- * The set of price IDs to which this adjustment applies.
+ * The cadence to bill for this price on.
*/
- applies_to_price_ids: Array;
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
/**
- * The item ID that revenue from this minimum will be attributed to.
+ * The id of the item the price will be associated with.
*/
item_id: string;
- minimum_amount: string;
+ model_type: 'scalable_matrix_with_tiered_pricing';
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * The name of the price.
*/
- is_invoice_level?: boolean;
- }
+ name: string;
- export interface NewMaximum {
- adjustment_type: 'maximum';
+ scalable_matrix_with_tiered_pricing_config: Record;
/**
- * The set of price IDs to which this adjustment applies.
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
*/
- applies_to_price_ids: Array;
+ billable_metric_id?: string | null;
- maximum_amount: string;
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- is_invoice_level?: boolean;
- }
- }
+ billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null;
- export interface ReplacePrice {
- /**
- * The id of the price on the plan to replace in the subscription.
- */
- replaces_price_id: string;
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
- /**
- * The definition of a new allocation price to create and add to the subscription.
- */
- allocation_price?: ReplacePrice.AllocationPrice | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
- /**
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
- * discounts for the replacement price.
- */
- discounts?: Array | null;
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
- /**
- * The external price id of the price to add to the subscription.
- */
- external_price_id?: string | null;
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
- /**
- * The new quantity of the price, if the price is a fixed price.
- */
- fixed_price_quantity?: number | null;
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
- /**
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
- * amount for the replacement price.
- */
- maximum_amount?: string | null;
-
- /**
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
- * amount for the replacement price.
- */
- minimum_amount?: string | null;
-
- /**
- * The definition of a new price to create and add to the subscription.
- */
- price?:
- | ReplacePrice.NewSubscriptionUnitPrice
- | ReplacePrice.NewSubscriptionPackagePrice
- | ReplacePrice.NewSubscriptionMatrixPrice
- | ReplacePrice.NewSubscriptionTieredPrice
- | ReplacePrice.NewSubscriptionTieredBpsPrice
- | ReplacePrice.NewSubscriptionBpsPrice
- | ReplacePrice.NewSubscriptionBulkBpsPrice
- | ReplacePrice.NewSubscriptionBulkPrice
- | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice
- | ReplacePrice.NewSubscriptionTieredPackagePrice
- | ReplacePrice.NewSubscriptionTieredWithMinimumPrice
- | ReplacePrice.NewSubscriptionUnitWithPercentPrice
- | ReplacePrice.NewSubscriptionPackageWithAllocationPrice
- | ReplacePrice.NewSubscriptionTierWithProrationPrice
- | ReplacePrice.NewSubscriptionUnitWithProrationPrice
- | ReplacePrice.NewSubscriptionGroupedAllocationPrice
- | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice
- | ReplacePrice.NewSubscriptionBulkWithProrationPrice
- | null;
-
- /**
- * The id of the price to add to the subscription.
- */
- price_id?: string | null;
- }
-
- export namespace ReplacePrice {
- /**
- * The definition of a new allocation price to create and add to the subscription.
- */
- export interface AllocationPrice {
- /**
- * An amount of the currency to allocate to the customer at the specified cadence.
- */
- amount: string;
-
- /**
- * The cadence at which to allocate the amount to the customer.
- */
- cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null;
/**
- * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
- * this price.
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
*/
- currency: string;
+ metadata?: Record | null;
/**
- * Whether the allocated amount should expire at the end of the cadence or roll
- * over to the next period.
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
*/
- expires_at_end_of_cadence: boolean;
+ reference_id?: string | null;
}
- export interface Discount {
- discount_type: 'percentage' | 'usage' | 'amount';
-
+ export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice {
/**
- * Only available if discount_type is `amount`.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- amount_discount?: string | null;
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Only available if discount_type is `percentage`. This is a number between 0
- * and 1.
- */
- percentage_discount?: number | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
/**
- * Only available if discount_type is `usage`. Number of usage units that this
- * discount is for
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- usage_discount?: number | null;
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
}
- export interface NewSubscriptionUnitPrice {
+ export interface NewSubscriptionCumulativeGroupedBulkPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ cumulative_grouped_bulk_config: Record;
+
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'unit';
+ model_type: 'cumulative_grouped_bulk';
/**
* The name of the price.
*/
name: string;
- unit_config: NewSubscriptionUnitPrice.UnitConfig;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -11029,7 +11004,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -11062,7 +11037,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -11078,14 +11053,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionUnitPrice {
- export interface UnitConfig {
- /**
- * Rate per unit of usage
- */
- unit_amount: string;
- }
-
+ export namespace NewSubscriptionCumulativeGroupedBulkPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -11119,7 +11087,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionPackagePrice {
+ export interface NewSubscriptionMaxGroupTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -11130,15 +11098,15 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'package';
+ max_group_tiered_package_config: Record;
+
+ model_type: 'max_group_tiered_package';
/**
* The name of the price.
*/
name: string;
- package_config: NewSubscriptionPackagePrice.PackageConfig;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -11155,7 +11123,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -11188,7 +11156,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -11204,20 +11172,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionPackagePrice {
- export interface PackageConfig {
- /**
- * A currency amount to rate usage by
- */
- package_amount: string;
-
- /**
- * An integer amount to represent package size. For example, 1000 here would divide
- * usage by 1000 before multiplying by package_amount in rating
- */
- package_size: number;
- }
-
+ export namespace NewSubscriptionMaxGroupTieredPackagePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -11251,20 +11206,20 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionMatrixPrice {
+ export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ grouped_with_metered_minimum_config: Record;
+
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- matrix_config: NewSubscriptionMatrixPrice.MatrixConfig;
-
- model_type: 'matrix';
+ model_type: 'grouped_with_metered_minimum';
/**
* The name of the price.
@@ -11287,7 +11242,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -11320,7 +11275,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -11336,40 +11291,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionMatrixPrice {
- export interface MatrixConfig {
- /**
- * Default per unit rate for any usage not bucketed into a specified matrix_value
- */
- default_unit_amount: string;
-
- /**
- * One or two event property values to evaluate matrix groups by
- */
- dimensions: Array;
-
- /**
- * Matrix values for specified matrix grouping keys
- */
- matrix_values: Array;
- }
-
- export namespace MatrixConfig {
- export interface MatrixValue {
- /**
- * One or two matrix keys to filter usage to this Matrix value by. For example,
- * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
- * instance tier.
- */
- dimension_values: Array;
-
- /**
- * Unit price for the specified dimension_values
- */
- unit_amount: string;
- }
- }
-
+ export namespace NewSubscriptionGroupedWithMeteredMinimumPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -11403,7 +11325,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionTieredPrice {
+ export interface NewSubscriptionMatrixWithDisplayNamePrice {
/**
* The cadence to bill for this price on.
*/
@@ -11414,15 +11336,15 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'tiered';
+ matrix_with_display_name_config: Record;
+
+ model_type: 'matrix_with_display_name';
/**
* The name of the price.
*/
name: string;
- tiered_config: NewSubscriptionTieredPrice.TieredConfig;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -11439,7 +11361,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -11472,7 +11394,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -11488,33 +11410,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionTieredPrice {
- export interface TieredConfig {
- /**
- * Tiers for rating based on total usage quantities into the specified tier
- */
- tiers: Array;
- }
-
- export namespace TieredConfig {
- export interface Tier {
- /**
- * Inclusive tier starting value
- */
- first_unit: number;
-
- /**
- * Amount per unit
- */
- unit_amount: string;
-
- /**
- * Exclusive tier ending value. If null, this is treated as the last tier
- */
- last_unit?: number | null;
- }
- }
-
+ export namespace NewSubscriptionMatrixWithDisplayNamePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -11548,26 +11444,26 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionTieredBpsPrice {
+ export interface NewSubscriptionGroupedTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ grouped_tiered_package_config: Record;
+
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'tiered_bps';
+ model_type: 'grouped_tiered_package';
/**
* The name of the price.
*/
name: string;
- tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -11584,7 +11480,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -11617,7 +11513,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -11633,54 +11529,22 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionTieredBpsPrice {
- export interface TieredBpsConfig {
+ export namespace NewSubscriptionGroupedTieredPackagePrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
/**
- * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
- * tiers
+ * The duration of the billing period.
*/
- tiers: Array;
- }
+ duration: number;
- export namespace TieredBpsConfig {
- export interface Tier {
- /**
- * Per-event basis point rate
- */
- bps: number;
-
- /**
- * Inclusive tier starting value
- */
- minimum_amount: string;
-
- /**
- * Exclusive tier ending value
- */
- maximum_amount?: string | null;
-
- /**
- * Per unit maximum to charge
- */
- per_unit_maximum?: string | null;
- }
- }
-
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- export interface BillingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
-
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
@@ -11698,287 +11562,285 @@ export namespace SubscriptionCreateParams {
duration_unit: 'day' | 'month';
}
}
+ }
- export interface NewSubscriptionBpsPrice {
- bps_config: NewSubscriptionBpsPrice.BpsConfig;
+ export interface BillingCycleAnchorConfiguration {
+ /**
+ * The day of the month on which the billing cycle is anchored. If the maximum
+ * number of days in a month is greater than this value, the last day of the month
+ * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
+ * period begins on the 30th.
+ */
+ day: number;
- /**
- * The cadence to bill for this price on.
- */
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ /**
+ * The month on which the billing cycle is anchored (e.g. a quarterly price
+ * anchored in February would have cycles starting February, May, August, and
+ * November).
+ */
+ month?: number | null;
- /**
- * The id of the item the price will be associated with.
- */
- item_id: string;
+ /**
+ * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle
+ * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.).
+ */
+ year?: number | null;
+ }
- model_type: 'bps';
+ export interface RemoveAdjustment {
+ /**
+ * The id of the adjustment to remove on the subscription.
+ */
+ adjustment_id: string;
+ }
- /**
- * The name of the price.
- */
- name: string;
+ export interface RemovePrice {
+ /**
+ * The external price id of the price to remove on the subscription.
+ */
+ external_price_id?: string | null;
- /**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
- */
- billable_metric_id?: string | null;
+ /**
+ * The id of the price to remove on the subscription.
+ */
+ price_id?: string | null;
+ }
- /**
- * If the Price represents a fixed cost, the price will be billed in-advance if
- * this is true, and in-arrears if this is false.
- */
- billed_in_advance?: boolean | null;
+ export interface ReplaceAdjustment {
+ /**
+ * The definition of a new adjustment to create and add to the subscription.
+ */
+ adjustment:
+ | ReplaceAdjustment.NewPercentageDiscount
+ | ReplaceAdjustment.NewUsageDiscount
+ | ReplaceAdjustment.NewAmountDiscount
+ | ReplaceAdjustment.NewMinimum
+ | ReplaceAdjustment.NewMaximum;
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null;
+ /**
+ * The id of the adjustment on the plan to replace in the subscription.
+ */
+ replaces_adjustment_id: string;
+ }
- /**
- * The per unit conversion rate of the price currency to the invoicing currency.
- */
- conversion_rate?: number | null;
+ export namespace ReplaceAdjustment {
+ export interface NewPercentageDiscount {
+ adjustment_type: 'percentage_discount';
/**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
- * price is billed.
+ * The set of price IDs to which this adjustment applies.
*/
- currency?: string | null;
+ applies_to_price_ids: Array;
- /**
- * An alias for the price.
- */
- external_price_id?: string | null;
+ percentage_discount: number;
/**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
*/
- fixed_price_quantity?: number | null;
+ is_invoice_level?: boolean;
+ }
- /**
- * The property used to group this price on an invoice
- */
- invoice_grouping_key?: string | null;
+ export interface NewUsageDiscount {
+ adjustment_type: 'usage_discount';
/**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
+ * The set of price IDs to which this adjustment applies.
*/
- invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null;
+ applies_to_price_ids: Array;
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared
- * by setting `metadata` to `null`.
- */
- metadata?: Record | null;
+ usage_discount: number;
/**
- * A transient ID that can be used to reference this price when adding adjustments
- * in the same API call.
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
*/
- reference_id?: string | null;
+ is_invoice_level?: boolean;
}
- export namespace NewSubscriptionBpsPrice {
- export interface BpsConfig {
- /**
- * Basis point take rate per event
- */
- bps: number;
+ export interface NewAmountDiscount {
+ adjustment_type: 'amount_discount';
- /**
- * Optional currency amount maximum to cap spend per event
- */
- per_unit_maximum?: string | null;
- }
+ amount_discount: string;
/**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
+ * The set of price IDs to which this adjustment applies.
*/
- export interface BillingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
-
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ applies_to_price_ids: Array;
/**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
*/
- export interface InvoicingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
-
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ is_invoice_level?: boolean;
}
- export interface NewSubscriptionBulkBpsPrice {
- bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig;
+ export interface NewMinimum {
+ adjustment_type: 'minimum';
/**
- * The cadence to bill for this price on.
+ * The set of price IDs to which this adjustment applies.
*/
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ applies_to_price_ids: Array;
/**
- * The id of the item the price will be associated with.
+ * The item ID that revenue from this minimum will be attributed to.
*/
item_id: string;
- model_type: 'bulk_bps';
-
- /**
- * The name of the price.
- */
- name: string;
+ minimum_amount: string;
/**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
*/
- billable_metric_id?: string | null;
+ is_invoice_level?: boolean;
+ }
- /**
- * If the Price represents a fixed cost, the price will be billed in-advance if
- * this is true, and in-arrears if this is false.
- */
- billed_in_advance?: boolean | null;
+ export interface NewMaximum {
+ adjustment_type: 'maximum';
/**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
+ * The set of price IDs to which this adjustment applies.
*/
- billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null;
+ applies_to_price_ids: Array;
- /**
- * The per unit conversion rate of the price currency to the invoicing currency.
- */
- conversion_rate?: number | null;
+ maximum_amount: string;
/**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
- * price is billed.
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
*/
- currency?: string | null;
+ is_invoice_level?: boolean;
+ }
+ }
- /**
- * An alias for the price.
- */
- external_price_id?: string | null;
+ export interface ReplacePrice {
+ /**
+ * The id of the price on the plan to replace in the subscription.
+ */
+ replaces_price_id: string;
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fixed_price_quantity?: number | null;
+ /**
+ * The definition of a new allocation price to create and add to the subscription.
+ */
+ allocation_price?: ReplacePrice.AllocationPrice | null;
+
+ /**
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
+ * discounts for the replacement price.
+ */
+ discounts?: Array | null;
+
+ /**
+ * The external price id of the price to add to the subscription.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * The new quantity of the price, if the price is a fixed price.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
+ * amount for the replacement price.
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
+ * amount for the replacement price.
+ */
+ minimum_amount?: string | null;
+
+ /**
+ * The definition of a new price to create and add to the subscription.
+ */
+ price?:
+ | ReplacePrice.NewSubscriptionUnitPrice
+ | ReplacePrice.NewSubscriptionPackagePrice
+ | ReplacePrice.NewSubscriptionMatrixPrice
+ | ReplacePrice.NewSubscriptionTieredPrice
+ | ReplacePrice.NewSubscriptionTieredBpsPrice
+ | ReplacePrice.NewSubscriptionBpsPrice
+ | ReplacePrice.NewSubscriptionBulkBpsPrice
+ | ReplacePrice.NewSubscriptionBulkPrice
+ | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice
+ | ReplacePrice.NewSubscriptionTieredPackagePrice
+ | ReplacePrice.NewSubscriptionTieredWithMinimumPrice
+ | ReplacePrice.NewSubscriptionUnitWithPercentPrice
+ | ReplacePrice.NewSubscriptionPackageWithAllocationPrice
+ | ReplacePrice.NewSubscriptionTierWithProrationPrice
+ | ReplacePrice.NewSubscriptionUnitWithProrationPrice
+ | ReplacePrice.NewSubscriptionGroupedAllocationPrice
+ | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice
+ | ReplacePrice.NewSubscriptionBulkWithProrationPrice
+ | ReplacePrice.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | ReplacePrice.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | ReplacePrice.NewSubscriptionCumulativeGroupedBulkPrice
+ | ReplacePrice.NewSubscriptionMaxGroupTieredPackagePrice
+ | ReplacePrice.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | ReplacePrice.NewSubscriptionMatrixWithDisplayNamePrice
+ | ReplacePrice.NewSubscriptionGroupedTieredPackagePrice
+ | null;
+
+ /**
+ * The id of the price to add to the subscription.
+ */
+ price_id?: string | null;
+ }
+ export namespace ReplacePrice {
+ /**
+ * The definition of a new allocation price to create and add to the subscription.
+ */
+ export interface AllocationPrice {
/**
- * The property used to group this price on an invoice
+ * An amount of the currency to allocate to the customer at the specified cadence.
*/
- invoice_grouping_key?: string | null;
+ amount: string;
/**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
+ * The cadence at which to allocate the amount to the customer.
*/
- invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null;
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
/**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared
- * by setting `metadata` to `null`.
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
+ * this price.
*/
- metadata?: Record | null;
+ currency: string;
/**
- * A transient ID that can be used to reference this price when adding adjustments
- * in the same API call.
+ * Whether the allocated amount should expire at the end of the cadence or roll
+ * over to the next period.
*/
- reference_id?: string | null;
+ expires_at_end_of_cadence: boolean;
}
- export namespace NewSubscriptionBulkBpsPrice {
- export interface BulkBpsConfig {
- /**
- * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
- * tier based on total volume
- */
- tiers: Array;
- }
-
- export namespace BulkBpsConfig {
- export interface Tier {
- /**
- * Basis points to rate on
- */
- bps: number;
-
- /**
- * Upper bound for tier
- */
- maximum_amount?: string | null;
-
- /**
- * The maximum amount to charge for any one event
- */
- per_unit_maximum?: string | null;
- }
- }
+ export interface Discount {
+ discount_type: 'percentage' | 'usage' | 'amount';
/**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
+ * Only available if discount_type is `amount`.
*/
- export interface BillingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
-
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ amount_discount?: string | null;
/**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
+ * Only available if discount_type is `percentage`. This is a number between 0
+ * and 1.
*/
- export interface InvoicingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
+ percentage_discount?: number | null;
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ /**
+ * Only available if discount_type is `usage`. Number of usage units that this
+ * discount is for
+ */
+ usage_discount?: number | null;
}
- export interface NewSubscriptionBulkPrice {
- bulk_config: NewSubscriptionBulkPrice.BulkConfig;
-
+ export interface NewSubscriptionUnitPrice {
/**
* The cadence to bill for this price on.
*/
@@ -11989,13 +11851,15 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'bulk';
+ model_type: 'unit';
/**
* The name of the price.
*/
name: string;
+ unit_config: NewSubscriptionUnitPrice.UnitConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -12012,7 +11876,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12045,7 +11909,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12061,26 +11925,12 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionBulkPrice {
- export interface BulkConfig {
+ export namespace NewSubscriptionUnitPrice {
+ export interface UnitConfig {
/**
- * Bulk tiers for rating based on total usage volume
+ * Rate per unit of usage
*/
- tiers: Array;
- }
-
- export namespace BulkConfig {
- export interface Tier {
- /**
- * Amount per unit
- */
- unit_amount: string;
-
- /**
- * Upper bound for this tier
- */
- maximum_units?: number | null;
- }
+ unit_amount: string;
}
/**
@@ -12116,7 +11966,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionThresholdTotalAmountPrice {
+ export interface NewSubscriptionPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -12127,14 +11977,14 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'threshold_total_amount';
+ model_type: 'package';
/**
* The name of the price.
*/
name: string;
- threshold_total_amount_config: Record;
+ package_config: NewSubscriptionPackagePrice.PackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -12152,7 +12002,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12185,7 +12035,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12201,7 +12051,20 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionThresholdTotalAmountPrice {
+ export namespace NewSubscriptionPackagePrice {
+ export interface PackageConfig {
+ /**
+ * A currency amount to rate usage by
+ */
+ package_amount: string;
+
+ /**
+ * An integer amount to represent package size. For example, 1000 here would divide
+ * usage by 1000 before multiplying by package_amount in rating
+ */
+ package_size: number;
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -12235,7 +12098,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionTieredPackagePrice {
+ export interface NewSubscriptionMatrixPrice {
/**
* The cadence to bill for this price on.
*/
@@ -12246,15 +12109,15 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'tiered_package';
+ matrix_config: NewSubscriptionMatrixPrice.MatrixConfig;
+
+ model_type: 'matrix';
/**
* The name of the price.
*/
name: string;
- tiered_package_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -12271,7 +12134,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12304,7 +12167,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12320,21 +12183,54 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionTieredPackagePrice {
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- export interface BillingCycleConfiguration {
+ export namespace NewSubscriptionMatrixPrice {
+ export interface MatrixConfig {
/**
- * The duration of the billing period.
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
*/
- duration: number;
+ default_unit_amount: string;
/**
- * The unit of billing period duration.
+ * One or two event property values to evaluate matrix groups by
*/
- duration_unit: 'day' | 'month';
+ dimensions: Array;
+
+ /**
+ * Matrix values for specified matrix grouping keys
+ */
+ matrix_values: Array;
+ }
+
+ export namespace MatrixConfig {
+ export interface MatrixValue {
+ /**
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
+ * instance tier.
+ */
+ dimension_values: Array;
+
+ /**
+ * Unit price for the specified dimension_values
+ */
+ unit_amount: string;
+ }
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
}
/**
@@ -12354,7 +12250,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionTieredWithMinimumPrice {
+ export interface NewSubscriptionTieredPrice {
/**
* The cadence to bill for this price on.
*/
@@ -12365,14 +12261,14 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'tiered_with_minimum';
+ model_type: 'tiered';
/**
* The name of the price.
*/
name: string;
- tiered_with_minimum_config: Record;
+ tiered_config: NewSubscriptionTieredPrice.TieredConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -12390,7 +12286,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12423,7 +12319,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12439,7 +12335,33 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionTieredWithMinimumPrice {
+ export namespace NewSubscriptionTieredPrice {
+ export interface TieredConfig {
+ /**
+ * Tiers for rating based on total usage quantities into the specified tier
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredConfig {
+ export interface Tier {
+ /**
+ * Inclusive tier starting value
+ */
+ first_unit: number;
+
+ /**
+ * Amount per unit
+ */
+ unit_amount: string;
+
+ /**
+ * Exclusive tier ending value. If null, this is treated as the last tier
+ */
+ last_unit?: number | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -12473,7 +12395,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionUnitWithPercentPrice {
+ export interface NewSubscriptionTieredBpsPrice {
/**
* The cadence to bill for this price on.
*/
@@ -12484,14 +12406,14 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'unit_with_percent';
+ model_type: 'tiered_bps';
/**
* The name of the price.
*/
name: string;
- unit_with_percent_config: Record;
+ tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -12509,7 +12431,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12542,7 +12464,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12558,7 +12480,39 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionUnitWithPercentPrice {
+ export namespace NewSubscriptionTieredBpsPrice {
+ export interface TieredBpsConfig {
+ /**
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
+ * tiers
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredBpsConfig {
+ export interface Tier {
+ /**
+ * Per-event basis point rate
+ */
+ bps: number;
+
+ /**
+ * Inclusive tier starting value
+ */
+ minimum_amount: string;
+
+ /**
+ * Exclusive tier ending value
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * Per unit maximum to charge
+ */
+ per_unit_maximum?: string | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -12592,7 +12546,9 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionPackageWithAllocationPrice {
+ export interface NewSubscriptionBpsPrice {
+ bps_config: NewSubscriptionBpsPrice.BpsConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -12603,15 +12559,13 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'package_with_allocation';
+ model_type: 'bps';
/**
* The name of the price.
*/
name: string;
- package_with_allocation_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -12628,7 +12582,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12661,7 +12615,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12677,7 +12631,19 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionPackageWithAllocationPrice {
+ export namespace NewSubscriptionBpsPrice {
+ export interface BpsConfig {
+ /**
+ * Basis point take rate per event
+ */
+ bps: number;
+
+ /**
+ * Optional currency amount maximum to cap spend per event
+ */
+ per_unit_maximum?: string | null;
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -12711,7 +12677,9 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionTierWithProrationPrice {
+ export interface NewSubscriptionBulkBpsPrice {
+ bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -12722,15 +12690,13 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'tiered_with_proration';
+ model_type: 'bulk_bps';
/**
* The name of the price.
*/
name: string;
- tiered_with_proration_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -12747,7 +12713,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12780,7 +12746,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12796,7 +12762,34 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionTierWithProrationPrice {
+ export namespace NewSubscriptionBulkBpsPrice {
+ export interface BulkBpsConfig {
+ /**
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
+ * tier based on total volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkBpsConfig {
+ export interface Tier {
+ /**
+ * Basis points to rate on
+ */
+ bps: number;
+
+ /**
+ * Upper bound for tier
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * The maximum amount to charge for any one event
+ */
+ per_unit_maximum?: string | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -12830,7 +12823,9 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionUnitWithProrationPrice {
+ export interface NewSubscriptionBulkPrice {
+ bulk_config: NewSubscriptionBulkPrice.BulkConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -12841,15 +12836,13 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'unit_with_proration';
+ model_type: 'bulk';
/**
* The name of the price.
*/
name: string;
- unit_with_proration_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -12866,7 +12859,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -12899,7 +12892,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -12915,7 +12908,28 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionUnitWithProrationPrice {
+ export namespace NewSubscriptionBulkPrice {
+ export interface BulkConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkConfig {
+ export interface Tier {
+ /**
+ * Amount per unit
+ */
+ unit_amount: string;
+
+ /**
+ * Upper bound for this tier
+ */
+ maximum_units?: number | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -12949,26 +12963,26 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionGroupedAllocationPrice {
+ export interface NewSubscriptionThresholdTotalAmountPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_allocation_config: Record;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_allocation';
+ model_type: 'threshold_total_amount';
/**
* The name of the price.
*/
name: string;
+ threshold_total_amount_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -12985,7 +12999,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -13018,7 +13032,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -13034,7 +13048,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionGroupedAllocationPrice {
+ export namespace NewSubscriptionThresholdTotalAmountPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -13068,26 +13082,26 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionGroupedWithProratedMinimumPrice {
+ export interface NewSubscriptionTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- grouped_with_prorated_minimum_config: Record;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_with_prorated_minimum';
+ model_type: 'tiered_package';
/**
* The name of the price.
*/
name: string;
+ tiered_package_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -13104,7 +13118,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -13137,7 +13151,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -13153,7 +13167,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionGroupedWithProratedMinimumPrice {
+ export namespace NewSubscriptionTieredPackagePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -13187,9 +13201,7 @@ export namespace SubscriptionCreateParams {
}
}
- export interface NewSubscriptionBulkWithProrationPrice {
- bulk_with_proration_config: Record;
-
+ export interface NewSubscriptionTieredWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
@@ -13200,13 +13212,15 @@ export namespace SubscriptionCreateParams {
*/
item_id: string;
- model_type: 'bulk_with_proration';
+ model_type: 'tiered_with_minimum';
/**
* The name of the price.
*/
name: string;
+ tiered_with_minimum_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -13223,7 +13237,7 @@ export namespace SubscriptionCreateParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -13256,7 +13270,7 @@ export namespace SubscriptionCreateParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -13272,7 +13286,7 @@ export namespace SubscriptionCreateParams {
reference_id?: string | null;
}
- export namespace NewSubscriptionBulkWithProrationPrice {
+ export namespace NewSubscriptionTieredWithMinimumPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -13305,392 +13319,264 @@ export namespace SubscriptionCreateParams {
duration_unit: 'day' | 'month';
}
}
- }
-}
-export interface SubscriptionUpdateParams {
- /**
- * Determines whether issued invoices for this subscription will automatically be
- * charged with the saved payment method on the due date. This property defaults to
- * the plan's behavior.
- */
- auto_collection?: boolean | null;
+ export interface NewSubscriptionUnitWithPercentPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * Determines the default memo on this subscription's invoices. Note that if this
- * is not provided, it is determined by the plan configuration.
- */
- default_invoice_memo?: string | null;
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
- /**
- * When this subscription's accrued usage reaches this threshold, an invoice will
- * be issued for the subscription. If not specified, invoices will only be issued
- * at the end of the billing period.
- */
- invoicing_threshold?: string | null;
+ model_type: 'unit_with_percent';
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared
- * by setting `metadata` to `null`.
- */
- metadata?: Record | null;
+ /**
+ * The name of the price.
+ */
+ name: string;
- /**
- * Determines the difference between the invoice issue date for subscription
- * invoices as the date that they are due. A value of `0` here represents that the
- * invoice is due on issue, whereas a value of `30` represents that the customer
- * has a month to pay the invoice.
- */
- net_terms?: number | null;
-}
+ unit_with_percent_config: Record;
-export interface SubscriptionListParams extends PageParams {
- 'created_at[gt]'?: string | null;
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
- 'created_at[gte]'?: string | null;
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
- 'created_at[lt]'?: string | null;
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null;
- 'created_at[lte]'?: string | null;
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
- customer_id?: Array | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
- external_customer_id?: string | null;
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
- status?: 'active' | 'ended' | 'upcoming' | null;
-}
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
-export interface SubscriptionCancelParams {
- /**
- * Determines the timing of subscription cancellation
- */
- cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date';
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
- /**
- * If false, this request will fail if it would void an issued invoice or create a
- * credit note. Consider using this as a safety mechanism if you do not expect
- * existing invoices to be changed.
- */
- allow_invoice_credit_or_void?: boolean | null;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null;
- /**
- * The date that the cancellation should take effect. This parameter can only be
- * passed if the `cancel_option` is `requested_date`.
- */
- cancellation_date?: string | null;
-}
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
-export interface SubscriptionFetchCostsParams {
- /**
- * The currency or custom pricing unit to use.
- */
- currency?: string | null;
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
- /**
- * Costs returned are exclusive of `timeframe_end`.
- */
- timeframe_end?: string | null;
+ export namespace NewSubscriptionUnitWithPercentPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Costs returned are inclusive of `timeframe_start`.
- */
- timeframe_start?: string | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
- /**
- * Controls whether Orb returns cumulative costs since the start of the billing
- * period, or incremental day-by-day costs. If your customer has minimums or
- * discounts, it's strongly recommended that you use the default cumulative
- * behavior.
- */
- view_mode?: 'periodic' | 'cumulative' | null;
-}
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
-export interface SubscriptionFetchScheduleParams extends PageParams {
- 'start_date[gt]'?: string | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
- 'start_date[gte]'?: string | null;
+ export interface NewSubscriptionPackageWithAllocationPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- 'start_date[lt]'?: string | null;
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
- 'start_date[lte]'?: string | null;
-}
+ model_type: 'package_with_allocation';
-export interface SubscriptionFetchUsageParams {
- /**
- * When specified in conjunction with `group_by`, this parameter filters usage to a
- * single billable metric. Note that both `group_by` and `billable_metric_id` must
- * be specified together.
- */
- billable_metric_id?: string | null;
+ /**
+ * The name of the price.
+ */
+ name: string;
- first_dimension_key?: string | null;
+ package_with_allocation_config: Record;
- first_dimension_value?: string | null;
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
- /**
- * This determines the windowing of usage reporting.
- */
- granularity?: 'day' | null;
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
- /**
- * Groups per-price usage by the key provided.
- */
- group_by?: string | null;
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null;
- second_dimension_key?: string | null;
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
- second_dimension_value?: string | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
- /**
- * Usage returned is exclusive of `timeframe_end`.
- */
- timeframe_end?: string | null;
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
- /**
- * Usage returned is inclusive of `timeframe_start`.
- */
- timeframe_start?: string | null;
-
- /**
- * Controls whether Orb returns cumulative usage since the start of the billing
- * period, or incremental day-by-day usage. If your customer has minimums or
- * discounts, it's strongly recommended that you use the default cumulative
- * behavior.
- */
- view_mode?: 'periodic' | 'cumulative' | null;
-}
-
-export interface SubscriptionPriceIntervalsParams {
- /**
- * A list of price intervals to add to the subscription.
- */
- add?: Array;
-
- /**
- * A list of adjustments to add to the subscription.
- */
- add_adjustments?: Array;
-
- /**
- * If false, this request will fail if it would void an issued invoice or create a
- * credit note. Consider using this as a safety mechanism if you do not expect
- * existing invoices to be changed.
- */
- allow_invoice_credit_or_void?: boolean | null;
-
- /**
- * A list of price intervals to edit on the subscription.
- */
- edit?: Array;
-
- /**
- * A list of adjustments to edit on the subscription.
- */
- edit_adjustments?: Array;
-}
-
-export namespace SubscriptionPriceIntervalsParams {
- export interface Add {
- /**
- * The start date of the price interval. This is the date that the price will start
- * billing on the subscription.
- */
- start_date: (string & {}) | Shared.BillingCycleRelativeDate;
-
- /**
- * The definition of a new allocation price to create and add to the subscription.
- */
- allocation_price?: Add.AllocationPrice | null;
-
- /**
- * A list of discounts to initialize on the price interval.
- */
- discounts?: Array<
- | Add.AmountDiscountCreationParams
- | Add.PercentageDiscountCreationParams
- | Add.UsageDiscountCreationParams
- > | null;
-
- /**
- * The end date of the price interval. This is the date that the price will stop
- * billing on the subscription.
- */
- end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
-
- /**
- * The external price id of the price to add to the subscription.
- */
- external_price_id?: string | null;
-
- /**
- * An additional filter to apply to usage queries. This filter must be expressed as
- * a boolean
- * [computed property](/extensibility/advanced-metrics#computed-properties). If
- * null, usage queries will not include any additional filter.
- */
- filter?: string | null;
-
- /**
- * A list of fixed fee quantity transitions to initialize on the price interval.
- */
- fixed_fee_quantity_transitions?: Array | null;
-
- /**
- * The maximum amount that will be billed for this price interval for a given
- * billing period.
- */
- maximum_amount?: number | null;
-
- /**
- * The minimum amount that will be billed for this price interval for a given
- * billing period.
- */
- minimum_amount?: number | null;
-
- /**
- * The definition of a new price to create and add to the subscription.
- */
- price?:
- | Add.NewFloatingUnitPrice
- | Add.NewFloatingPackagePrice
- | Add.NewFloatingMatrixPrice
- | Add.NewFloatingMatrixWithAllocationPrice
- | Add.NewFloatingTieredPrice
- | Add.NewFloatingTieredBpsPrice
- | Add.NewFloatingBpsPrice
- | Add.NewFloatingBulkBpsPrice
- | Add.NewFloatingBulkPrice
- | Add.NewFloatingThresholdTotalAmountPrice
- | Add.NewFloatingTieredPackagePrice
- | Add.NewFloatingGroupedTieredPrice
- | Add.NewFloatingMaxGroupTieredPackagePrice
- | Add.NewFloatingTieredWithMinimumPrice
- | Add.NewFloatingPackageWithAllocationPrice
- | Add.NewFloatingTieredPackageWithMinimumPrice
- | Add.NewFloatingUnitWithPercentPrice
- | Add.NewFloatingTieredWithProrationPrice
- | Add.NewFloatingUnitWithProrationPrice
- | Add.NewFloatingGroupedAllocationPrice
- | Add.NewFloatingGroupedWithProratedMinimumPrice
- | Add.NewFloatingGroupedWithMeteredMinimumPrice
- | Add.NewFloatingMatrixWithDisplayNamePrice
- | Add.NewFloatingBulkWithProrationPrice
- | Add.NewFloatingGroupedTieredPackagePrice
- | Add.NewFloatingScalableMatrixWithUnitPricingPrice
- | Add.NewFloatingScalableMatrixWithTieredPricingPrice
- | Add.NewFloatingCumulativeGroupedBulkPrice
- | null;
-
- /**
- * The id of the price to add to the subscription.
- */
- price_id?: string | null;
-
- /**
- * A list of customer IDs whose usage events will be aggregated and billed under
- * this subscription. By default, a subscription only considers usage events
- * associated with its attached customer's customer_id. When usage_customer_ids is
- * provided, the subscription includes usage events from the specified customers
- * only. Provided usage_customer_ids must be either the customer for this
- * subscription itself, or any of that customer's children.
- */
- usage_customer_ids?: Array | null;
- }
-
- export namespace Add {
- /**
- * The definition of a new allocation price to create and add to the subscription.
- */
- export interface AllocationPrice {
/**
- * An amount of the currency to allocate to the customer at the specified cadence.
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
*/
- amount: string;
+ fixed_price_quantity?: number | null;
/**
- * The cadence at which to allocate the amount to the customer.
+ * The property used to group this price on an invoice
*/
- cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
+ invoice_grouping_key?: string | null;
/**
- * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
- * this price.
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- currency: string;
+ invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null;
/**
- * Whether the allocated amount should expire at the end of the cadence or roll
- * over to the next period.
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
*/
- expires_at_end_of_cadence: boolean;
- }
+ metadata?: Record | null;
- export interface AmountDiscountCreationParams {
/**
- * Only available if discount_type is `amount`.
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
*/
- amount_discount: number;
-
- discount_type: 'amount';
+ reference_id?: string | null;
}
- export interface PercentageDiscountCreationParams {
- discount_type: 'percentage';
-
+ export namespace NewSubscriptionPackageWithAllocationPrice {
/**
- * Only available if discount_type is `percentage`. This is a number between 0
- * and 1.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- percentage_discount: number;
- }
-
- export interface UsageDiscountCreationParams {
- discount_type: 'usage';
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Only available if discount_type is `usage`. Number of usage units that this
- * discount is for.
- */
- usage_discount: number;
- }
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
- export interface FixedFeeQuantityTransition {
/**
- * The date that the fixed fee quantity transition should take effect.
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- effective_date: string;
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * The quantity of the fixed fee quantity transition.
- */
- quantity: number;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
}
- export interface NewFloatingUnitPrice {
+ export interface NewSubscriptionTierWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'unit';
+ model_type: 'tiered_with_proration';
/**
* The name of the price.
*/
name: string;
- unit_config: NewFloatingUnitPrice.UnitConfig;
+ tiered_with_proration_config: Record;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -13708,13 +13594,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -13735,7 +13627,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -13743,16 +13635,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
- export namespace NewFloatingUnitPrice {
- export interface UnitConfig {
- /**
- * Rate per unit of usage
- */
- unit_amount: string;
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionTierWithProrationPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -13786,30 +13677,25 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingPackagePrice {
+ export interface NewSubscriptionUnitWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'package';
+ model_type: 'unit_with_proration';
/**
* The name of the price.
*/
name: string;
- package_config: NewFloatingPackagePrice.PackageConfig;
+ unit_with_proration_config: Record;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -13827,13 +13713,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -13854,7 +13746,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -13862,22 +13754,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingPackagePrice {
- export interface PackageConfig {
- /**
- * A currency amount to rate usage by
- */
- package_amount: string;
- /**
- * An integer amount to represent package size. For example, 1000 here would divide
- * usage by 1000 before multiplying by package_amount in rating
- */
- package_size: number;
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionUnitWithProrationPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -13911,25 +13796,20 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingMatrixPrice {
+ export interface NewSubscriptionGroupedAllocationPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+ grouped_allocation_config: Record;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- matrix_config: NewFloatingMatrixPrice.MatrixConfig;
-
- model_type: 'matrix';
+ model_type: 'grouped_allocation';
/**
* The name of the price.
@@ -13952,13 +13832,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -13979,7 +13865,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -13987,42 +13873,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingMatrixPrice {
- export interface MatrixConfig {
- /**
- * Default per unit rate for any usage not bucketed into a specified matrix_value
- */
- default_unit_amount: string;
-
- /**
- * One or two event property values to evaluate matrix groups by
- */
- dimensions: Array;
-
- /**
- * Matrix values for specified matrix grouping keys
- */
- matrix_values: Array;
- }
-
- export namespace MatrixConfig {
- export interface MatrixValue {
- /**
- * One or two matrix keys to filter usage to this Matrix value by. For example,
- * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
- * instance tier.
- */
- dimension_values: Array;
- /**
- * Unit price for the specified dimension_values
- */
- unit_amount: string;
- }
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionGroupedAllocationPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14056,25 +13915,20 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingMatrixWithAllocationPrice {
+ export interface NewSubscriptionGroupedWithProratedMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+ grouped_with_prorated_minimum_config: Record;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig;
-
- model_type: 'matrix_with_allocation';
+ model_type: 'grouped_with_prorated_minimum';
/**
* The name of the price.
@@ -14097,13 +13951,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -14124,7 +13984,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14132,47 +13992,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingMatrixWithAllocationPrice {
- export interface MatrixWithAllocationConfig {
- /**
- * Allocation to be used to calculate the price
- */
- allocation: number;
-
- /**
- * Default per unit rate for any usage not bucketed into a specified matrix_value
- */
- default_unit_amount: string;
-
- /**
- * One or two event property values to evaluate matrix groups by
- */
- dimensions: Array;
-
- /**
- * Matrix values for specified matrix grouping keys
- */
- matrix_values: Array;
- }
-
- export namespace MatrixWithAllocationConfig {
- export interface MatrixValue {
- /**
- * One or two matrix keys to filter usage to this Matrix value by. For example,
- * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
- * instance tier.
- */
- dimension_values: Array;
- /**
- * Unit price for the specified dimension_values
- */
- unit_amount: string;
- }
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionGroupedWithProratedMinimumPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14206,31 +14034,26 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingTieredPrice {
+ export interface NewSubscriptionBulkWithProrationPrice {
+ bulk_with_proration_config: Record;
+
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'tiered';
+ model_type: 'bulk_with_proration';
/**
* The name of the price.
*/
name: string;
- tiered_config: NewFloatingTieredPrice.TieredConfig;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -14247,13 +14070,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -14274,7 +14103,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14282,35 +14111,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingTieredPrice {
- export interface TieredConfig {
- /**
- * Tiers for rating based on total usage quantities into the specified tier
- */
- tiers: Array;
- }
-
- export namespace TieredConfig {
- export interface Tier {
- /**
- * Inclusive tier starting value
- */
- first_unit: number;
-
- /**
- * Amount per unit
- */
- unit_amount: string;
- /**
- * Exclusive tier ending value. If null, this is treated as the last tier
- */
- last_unit?: number | null;
- }
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionBulkWithProrationPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14344,30 +14153,25 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingTieredBpsPrice {
+ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'tiered_bps';
+ model_type: 'scalable_matrix_with_unit_pricing';
/**
* The name of the price.
*/
name: string;
- tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig;
+ scalable_matrix_with_unit_pricing_config: Record;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -14385,7 +14189,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -14393,9 +14197,15 @@ export namespace SubscriptionPriceIntervalsParams {
conversion_rate?: number | null;
/**
- * An alias for the price.
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
*/
- external_price_id?: string | null;
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
@@ -14412,7 +14222,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14420,41 +14230,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingTieredBpsPrice {
- export interface TieredBpsConfig {
- /**
- * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
- * tiers
- */
- tiers: Array;
- }
-
- export namespace TieredBpsConfig {
- export interface Tier {
- /**
- * Per-event basis point rate
- */
- bps: number;
-
- /**
- * Inclusive tier starting value
- */
- minimum_amount: string;
-
- /**
- * Exclusive tier ending value
- */
- maximum_amount?: string | null;
- /**
- * Per unit maximum to charge
- */
- per_unit_maximum?: string | null;
- }
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14488,31 +14272,26 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingBpsPrice {
- bps_config: NewFloatingBpsPrice.BpsConfig;
-
+ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'bps';
+ model_type: 'scalable_matrix_with_tiered_pricing';
/**
* The name of the price.
*/
name: string;
+ scalable_matrix_with_tiered_pricing_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -14529,13 +14308,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -14556,7 +14341,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14564,21 +14349,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingBpsPrice {
- export interface BpsConfig {
- /**
- * Basis point take rate per event
- */
- bps: number;
- /**
- * Optional currency amount maximum to cap spend per event
- */
- per_unit_maximum?: string | null;
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14612,25 +14391,20 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingBulkBpsPrice {
- bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig;
-
+ export interface NewSubscriptionCumulativeGroupedBulkPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+ cumulative_grouped_bulk_config: Record;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'bulk_bps';
+ model_type: 'cumulative_grouped_bulk';
/**
* The name of the price.
@@ -14653,13 +14427,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -14680,7 +14460,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14688,36 +14468,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingBulkBpsPrice {
- export interface BulkBpsConfig {
- /**
- * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
- * tier based on total volume
- */
- tiers: Array;
- }
-
- export namespace BulkBpsConfig {
- export interface Tier {
- /**
- * Basis points to rate on
- */
- bps: number;
- /**
- * Upper bound for tier
- */
- maximum_amount?: string | null;
-
- /**
- * The maximum amount to charge for any one event
- */
- per_unit_maximum?: string | null;
- }
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionCumulativeGroupedBulkPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14751,25 +14510,20 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingBulkPrice {
- bulk_config: NewFloatingBulkPrice.BulkConfig;
-
+ export interface NewSubscriptionMaxGroupTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'bulk';
+ max_group_tiered_package_config: Record;
+
+ model_type: 'max_group_tiered_package';
/**
* The name of the price.
@@ -14792,13 +14546,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -14819,7 +14579,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14827,30 +14587,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
-
- export namespace NewFloatingBulkPrice {
- export interface BulkConfig {
- /**
- * Bulk tiers for rating based on total usage volume
- */
- tiers: Array;
- }
-
- export namespace BulkConfig {
- export interface Tier {
- /**
- * Amount per unit
- */
- unit_amount: string;
- /**
- * Upper bound for this tier
- */
- maximum_units?: number | null;
- }
- }
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+ export namespace NewSubscriptionMaxGroupTieredPackagePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14884,31 +14629,26 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingThresholdTotalAmountPrice {
+ export interface NewSubscriptionGroupedWithMeteredMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+ grouped_with_metered_minimum_config: Record;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'threshold_total_amount';
+ model_type: 'grouped_with_metered_minimum';
/**
* The name of the price.
*/
name: string;
- threshold_total_amount_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -14925,13 +14665,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -14952,7 +14698,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -14960,9 +14706,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
}
- export namespace NewFloatingThresholdTotalAmountPrice {
+ export namespace NewSubscriptionGroupedWithMeteredMinimumPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -14996,31 +14748,26 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingTieredPackagePrice {
+ export interface NewSubscriptionMatrixWithDisplayNamePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'tiered_package';
+ matrix_with_display_name_config: Record;
+
+ model_type: 'matrix_with_display_name';
/**
* The name of the price.
*/
name: string;
- tiered_package_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -15037,13 +14784,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -15064,7 +14817,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15072,9 +14825,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
}
- export namespace NewFloatingTieredPackagePrice {
+ export namespace NewSubscriptionMatrixWithDisplayNamePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -15108,25 +14867,20 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingGroupedTieredPrice {
+ export interface NewSubscriptionGroupedTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
-
- grouped_tiered_config: Record;
+ grouped_tiered_package_config: Record;
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_tiered';
+ model_type: 'grouped_tiered_package';
/**
* The name of the price.
@@ -15149,13 +14903,19 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
/**
* An alias for the price.
*/
@@ -15176,7 +14936,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15184,9 +14944,15 @@ export namespace SubscriptionPriceIntervalsParams {
* by setting `metadata` to `null`.
*/
metadata?: Record | null;
- }
- export namespace NewFloatingGroupedTieredPrice {
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionGroupedTieredPackagePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -15219,232 +14985,369 @@ export namespace SubscriptionPriceIntervalsParams {
duration_unit: 'day' | 'month';
}
}
+ }
+}
- export interface NewFloatingMaxGroupTieredPackagePrice {
- /**
- * The cadence to bill for this price on.
- */
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
-
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+export interface SubscriptionUpdateParams {
+ /**
+ * Determines whether issued invoices for this subscription will automatically be
+ * charged with the saved payment method on the due date. This property defaults to
+ * the plan's behavior.
+ */
+ auto_collection?: boolean | null;
- /**
- * The id of the item the price will be associated with.
- */
- item_id: string;
+ /**
+ * Determines the default memo on this subscription's invoices. Note that if this
+ * is not provided, it is determined by the plan configuration.
+ */
+ default_invoice_memo?: string | null;
- max_group_tiered_package_config: Record;
+ /**
+ * When this subscription's accrued usage reaches this threshold, an invoice will
+ * be issued for the subscription. If not specified, invoices will only be issued
+ * at the end of the billing period.
+ */
+ invoicing_threshold?: string | null;
- model_type: 'max_group_tiered_package';
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
- /**
- * The name of the price.
- */
- name: string;
+ /**
+ * Determines the difference between the invoice issue date for subscription
+ * invoices as the date that they are due. A value of `0` here represents that the
+ * invoice is due on issue, whereas a value of `30` represents that the customer
+ * has a month to pay the invoice.
+ */
+ net_terms?: number | null;
+}
- /**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
- */
- billable_metric_id?: string | null;
+export interface SubscriptionListParams extends PageParams {
+ 'created_at[gt]'?: string | null;
- /**
- * If the Price represents a fixed cost, the price will be billed in-advance if
- * this is true, and in-arrears if this is false.
- */
- billed_in_advance?: boolean | null;
+ 'created_at[gte]'?: string | null;
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
+ 'created_at[lt]'?: string | null;
- /**
- * The per unit conversion rate of the price currency to the invoicing currency.
- */
- conversion_rate?: number | null;
+ 'created_at[lte]'?: string | null;
- /**
- * An alias for the price.
- */
- external_price_id?: string | null;
+ customer_id?: Array | null;
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fixed_price_quantity?: number | null;
+ external_customer_id?: string | null;
- /**
- * The property used to group this price on an invoice
- */
- invoice_grouping_key?: string | null;
+ status?: 'active' | 'ended' | 'upcoming' | null;
+}
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
- */
- invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
+export interface SubscriptionCancelParams {
+ /**
+ * Determines the timing of subscription cancellation
+ */
+ cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date';
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared
- * by setting `metadata` to `null`.
- */
- metadata?: Record | null;
- }
+ /**
+ * If false, this request will fail if it would void an issued invoice or create a
+ * credit note. Consider using this as a safety mechanism if you do not expect
+ * existing invoices to be changed.
+ */
+ allow_invoice_credit_or_void?: boolean | null;
- export namespace NewFloatingMaxGroupTieredPackagePrice {
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- export interface BillingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
+ /**
+ * The date that the cancellation should take effect. This parameter can only be
+ * passed if the `cancel_option` is `requested_date`.
+ */
+ cancellation_date?: string | null;
+}
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+export interface SubscriptionFetchCostsParams {
+ /**
+ * The currency or custom pricing unit to use.
+ */
+ currency?: string | null;
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
- */
- export interface InvoicingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
+ /**
+ * Costs returned are exclusive of `timeframe_end`.
+ */
+ timeframe_end?: string | null;
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
- }
+ /**
+ * Costs returned are inclusive of `timeframe_start`.
+ */
+ timeframe_start?: string | null;
- export interface NewFloatingTieredWithMinimumPrice {
- /**
- * The cadence to bill for this price on.
- */
- cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+ /**
+ * Controls whether Orb returns cumulative costs since the start of the billing
+ * period, or incremental day-by-day costs. If your customer has minimums or
+ * discounts, it's strongly recommended that you use the default cumulative
+ * behavior.
+ */
+ view_mode?: 'periodic' | 'cumulative' | null;
+}
- /**
- * An ISO 4217 currency string for which this price is billed in.
- */
- currency: string;
+export interface SubscriptionFetchScheduleParams extends PageParams {
+ 'start_date[gt]'?: string | null;
- /**
- * The id of the item the price will be associated with.
- */
- item_id: string;
+ 'start_date[gte]'?: string | null;
- model_type: 'tiered_with_minimum';
+ 'start_date[lt]'?: string | null;
- /**
- * The name of the price.
- */
- name: string;
+ 'start_date[lte]'?: string | null;
+}
- tiered_with_minimum_config: Record;
+export interface SubscriptionFetchUsageParams {
+ /**
+ * When specified in conjunction with `group_by`, this parameter filters usage to a
+ * single billable metric. Note that both `group_by` and `billable_metric_id` must
+ * be specified together.
+ */
+ billable_metric_id?: string | null;
- /**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
- */
- billable_metric_id?: string | null;
+ first_dimension_key?: string | null;
- /**
- * If the Price represents a fixed cost, the price will be billed in-advance if
- * this is true, and in-arrears if this is false.
- */
- billed_in_advance?: boolean | null;
+ first_dimension_value?: string | null;
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null;
+ /**
+ * This determines the windowing of usage reporting.
+ */
+ granularity?: 'day' | null;
- /**
- * The per unit conversion rate of the price currency to the invoicing currency.
- */
- conversion_rate?: number | null;
+ /**
+ * Groups per-price usage by the key provided.
+ */
+ group_by?: string | null;
- /**
- * An alias for the price.
- */
- external_price_id?: string | null;
+ second_dimension_key?: string | null;
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fixed_price_quantity?: number | null;
+ second_dimension_value?: string | null;
- /**
- * The property used to group this price on an invoice
+ /**
+ * Usage returned is exclusive of `timeframe_end`.
+ */
+ timeframe_end?: string | null;
+
+ /**
+ * Usage returned is inclusive of `timeframe_start`.
+ */
+ timeframe_start?: string | null;
+
+ /**
+ * Controls whether Orb returns cumulative usage since the start of the billing
+ * period, or incremental day-by-day usage. If your customer has minimums or
+ * discounts, it's strongly recommended that you use the default cumulative
+ * behavior.
+ */
+ view_mode?: 'periodic' | 'cumulative' | null;
+}
+
+export interface SubscriptionPriceIntervalsParams {
+ /**
+ * A list of price intervals to add to the subscription.
+ */
+ add?: Array;
+
+ /**
+ * A list of adjustments to add to the subscription.
+ */
+ add_adjustments?: Array;
+
+ /**
+ * If false, this request will fail if it would void an issued invoice or create a
+ * credit note. Consider using this as a safety mechanism if you do not expect
+ * existing invoices to be changed.
+ */
+ allow_invoice_credit_or_void?: boolean | null;
+
+ /**
+ * A list of price intervals to edit on the subscription.
+ */
+ edit?: Array;
+
+ /**
+ * A list of adjustments to edit on the subscription.
+ */
+ edit_adjustments?: Array;
+}
+
+export namespace SubscriptionPriceIntervalsParams {
+ export interface Add {
+ /**
+ * The start date of the price interval. This is the date that the price will start
+ * billing on the subscription.
+ */
+ start_date: (string & {}) | Shared.BillingCycleRelativeDate;
+
+ /**
+ * The definition of a new allocation price to create and add to the subscription.
+ */
+ allocation_price?: Add.AllocationPrice | null;
+
+ /**
+ * A list of discounts to initialize on the price interval.
+ */
+ discounts?: Array<
+ | Add.AmountDiscountCreationParams
+ | Add.PercentageDiscountCreationParams
+ | Add.UsageDiscountCreationParams
+ > | null;
+
+ /**
+ * The end date of the price interval. This is the date that the price will stop
+ * billing on the subscription.
+ */
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
+
+ /**
+ * The external price id of the price to add to the subscription.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * An additional filter to apply to usage queries. This filter must be expressed as
+ * a boolean
+ * [computed property](/extensibility/advanced-metrics#computed-properties). If
+ * null, usage queries will not include any additional filter.
+ */
+ filter?: string | null;
+
+ /**
+ * A list of fixed fee quantity transitions to initialize on the price interval.
+ */
+ fixed_fee_quantity_transitions?: Array | null;
+
+ /**
+ * The maximum amount that will be billed for this price interval for a given
+ * billing period.
+ */
+ maximum_amount?: number | null;
+
+ /**
+ * The minimum amount that will be billed for this price interval for a given
+ * billing period.
+ */
+ minimum_amount?: number | null;
+
+ /**
+ * The definition of a new price to create and add to the subscription.
+ */
+ price?:
+ | Add.NewFloatingUnitPrice
+ | Add.NewFloatingPackagePrice
+ | Add.NewFloatingMatrixPrice
+ | Add.NewFloatingMatrixWithAllocationPrice
+ | Add.NewFloatingTieredPrice
+ | Add.NewFloatingTieredBpsPrice
+ | Add.NewFloatingBpsPrice
+ | Add.NewFloatingBulkBpsPrice
+ | Add.NewFloatingBulkPrice
+ | Add.NewFloatingThresholdTotalAmountPrice
+ | Add.NewFloatingTieredPackagePrice
+ | Add.NewFloatingGroupedTieredPrice
+ | Add.NewFloatingMaxGroupTieredPackagePrice
+ | Add.NewFloatingTieredWithMinimumPrice
+ | Add.NewFloatingPackageWithAllocationPrice
+ | Add.NewFloatingTieredPackageWithMinimumPrice
+ | Add.NewFloatingUnitWithPercentPrice
+ | Add.NewFloatingTieredWithProrationPrice
+ | Add.NewFloatingUnitWithProrationPrice
+ | Add.NewFloatingGroupedAllocationPrice
+ | Add.NewFloatingGroupedWithProratedMinimumPrice
+ | Add.NewFloatingGroupedWithMeteredMinimumPrice
+ | Add.NewFloatingMatrixWithDisplayNamePrice
+ | Add.NewFloatingBulkWithProrationPrice
+ | Add.NewFloatingGroupedTieredPackagePrice
+ | Add.NewFloatingScalableMatrixWithUnitPricingPrice
+ | Add.NewFloatingScalableMatrixWithTieredPricingPrice
+ | Add.NewFloatingCumulativeGroupedBulkPrice
+ | null;
+
+ /**
+ * The id of the price to add to the subscription.
+ */
+ price_id?: string | null;
+
+ /**
+ * A list of customer IDs whose usage events will be aggregated and billed under
+ * this subscription. By default, a subscription only considers usage events
+ * associated with its attached customer's customer_id. When usage_customer_ids is
+ * provided, the subscription includes usage events from the specified customers
+ * only. Provided usage_customer_ids must be either the customer for this
+ * subscription itself, or any of that customer's children.
+ */
+ usage_customer_ids?: Array | null;
+ }
+
+ export namespace Add {
+ /**
+ * The definition of a new allocation price to create and add to the subscription.
+ */
+ export interface AllocationPrice {
+ /**
+ * An amount of the currency to allocate to the customer at the specified cadence.
*/
- invoice_grouping_key?: string | null;
+ amount: string;
/**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
+ * The cadence at which to allocate the amount to the customer.
*/
- invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null;
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
/**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared
- * by setting `metadata` to `null`.
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
+ * this price.
*/
- metadata?: Record | null;
+ currency: string;
+
+ /**
+ * Whether the allocated amount should expire at the end of the cadence or roll
+ * over to the next period.
+ */
+ expires_at_end_of_cadence: boolean;
}
- export namespace NewFloatingTieredWithMinimumPrice {
+ export interface AmountDiscountCreationParams {
/**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
+ * Only available if discount_type is `amount`.
*/
- export interface BillingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
+ amount_discount: number;
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ discount_type: 'amount';
+ }
+
+ export interface PercentageDiscountCreationParams {
+ discount_type: 'percentage';
/**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
+ * Only available if discount_type is `percentage`. This is a number between 0
+ * and 1.
*/
- export interface InvoicingCycleConfiguration {
- /**
- * The duration of the billing period.
- */
- duration: number;
+ percentage_discount: number;
+ }
- /**
- * The unit of billing period duration.
- */
- duration_unit: 'day' | 'month';
- }
+ export interface UsageDiscountCreationParams {
+ discount_type: 'usage';
+
+ /**
+ * Only available if discount_type is `usage`. Number of usage units that this
+ * discount is for.
+ */
+ usage_discount: number;
}
- export interface NewFloatingPackageWithAllocationPrice {
+ export interface FixedFeeQuantityTransition {
+ /**
+ * The date that the fixed fee quantity transition should take effect.
+ */
+ effective_date: string;
+
+ /**
+ * The quantity of the fixed fee quantity transition.
+ */
+ quantity: number;
+ }
+
+ export interface NewFloatingUnitPrice {
/**
* The cadence to bill for this price on.
*/
@@ -15460,14 +15363,14 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'package_with_allocation';
+ model_type: 'unit';
/**
* The name of the price.
*/
name: string;
- package_with_allocation_config: Record;
+ unit_config: NewFloatingUnitPrice.UnitConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -15485,7 +15388,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -15512,7 +15415,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15522,11 +15425,18 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingPackageWithAllocationPrice {
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
+ export namespace NewFloatingUnitPrice {
+ export interface UnitConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
export interface BillingCycleConfiguration {
/**
* The duration of the billing period.
@@ -15556,7 +15466,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingTieredPackageWithMinimumPrice {
+ export interface NewFloatingPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -15572,14 +15482,14 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'tiered_package_with_minimum';
+ model_type: 'package';
/**
* The name of the price.
*/
name: string;
- tiered_package_with_minimum_config: Record;
+ package_config: NewFloatingPackagePrice.PackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -15597,7 +15507,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -15624,7 +15534,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15634,7 +15544,20 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingTieredPackageWithMinimumPrice {
+ export namespace NewFloatingPackagePrice {
+ export interface PackageConfig {
+ /**
+ * A currency amount to rate usage by
+ */
+ package_amount: string;
+
+ /**
+ * An integer amount to represent package size. For example, 1000 here would divide
+ * usage by 1000 before multiplying by package_amount in rating
+ */
+ package_size: number;
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -15668,7 +15591,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingUnitWithPercentPrice {
+ export interface NewFloatingMatrixPrice {
/**
* The cadence to bill for this price on.
*/
@@ -15684,15 +15607,15 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'unit_with_percent';
+ matrix_config: NewFloatingMatrixPrice.MatrixConfig;
+
+ model_type: 'matrix';
/**
* The name of the price.
*/
name: string;
- unit_with_percent_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -15709,7 +15632,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -15736,7 +15659,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15746,7 +15669,40 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingUnitWithPercentPrice {
+ export namespace NewFloatingMatrixPrice {
+ export interface MatrixConfig {
+ /**
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
+ */
+ default_unit_amount: string;
+
+ /**
+ * One or two event property values to evaluate matrix groups by
+ */
+ dimensions: Array;
+
+ /**
+ * Matrix values for specified matrix grouping keys
+ */
+ matrix_values: Array;
+ }
+
+ export namespace MatrixConfig {
+ export interface MatrixValue {
+ /**
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
+ * instance tier.
+ */
+ dimension_values: Array;
+
+ /**
+ * Unit price for the specified dimension_values
+ */
+ unit_amount: string;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -15780,7 +15736,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingTieredWithProrationPrice {
+ export interface NewFloatingMatrixWithAllocationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -15796,15 +15752,15 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'tiered_with_proration';
+ matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig;
+
+ model_type: 'matrix_with_allocation';
/**
* The name of the price.
*/
name: string;
- tiered_with_proration_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -15821,7 +15777,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -15848,7 +15804,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15858,7 +15814,45 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingTieredWithProrationPrice {
+ export namespace NewFloatingMatrixWithAllocationPrice {
+ export interface MatrixWithAllocationConfig {
+ /**
+ * Allocation to be used to calculate the price
+ */
+ allocation: number;
+
+ /**
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
+ */
+ default_unit_amount: string;
+
+ /**
+ * One or two event property values to evaluate matrix groups by
+ */
+ dimensions: Array;
+
+ /**
+ * Matrix values for specified matrix grouping keys
+ */
+ matrix_values: Array;
+ }
+
+ export namespace MatrixWithAllocationConfig {
+ export interface MatrixValue {
+ /**
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
+ * instance tier.
+ */
+ dimension_values: Array;
+
+ /**
+ * Unit price for the specified dimension_values
+ */
+ unit_amount: string;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -15892,7 +15886,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingUnitWithProrationPrice {
+ export interface NewFloatingTieredPrice {
/**
* The cadence to bill for this price on.
*/
@@ -15908,14 +15902,14 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'unit_with_proration';
+ model_type: 'tiered';
/**
* The name of the price.
*/
name: string;
- unit_with_proration_config: Record;
+ tiered_config: NewFloatingTieredPrice.TieredConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
@@ -15933,7 +15927,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -15960,7 +15954,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15970,7 +15964,33 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingUnitWithProrationPrice {
+ export namespace NewFloatingTieredPrice {
+ export interface TieredConfig {
+ /**
+ * Tiers for rating based on total usage quantities into the specified tier
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredConfig {
+ export interface Tier {
+ /**
+ * Inclusive tier starting value
+ */
+ first_unit: number;
+
+ /**
+ * Amount per unit
+ */
+ unit_amount: string;
+
+ /**
+ * Exclusive tier ending value. If null, this is treated as the last tier
+ */
+ last_unit?: number | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16004,7 +16024,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingGroupedAllocationPrice {
+ export interface NewFloatingTieredBpsPrice {
/**
* The cadence to bill for this price on.
*/
@@ -16015,20 +16035,20 @@ export namespace SubscriptionPriceIntervalsParams {
*/
currency: string;
- grouped_allocation_config: Record;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_allocation';
+ model_type: 'tiered_bps';
/**
* The name of the price.
*/
name: string;
+ tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -16045,7 +16065,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16072,7 +16092,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16082,7 +16102,39 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingGroupedAllocationPrice {
+ export namespace NewFloatingTieredBpsPrice {
+ export interface TieredBpsConfig {
+ /**
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
+ * tiers
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredBpsConfig {
+ export interface Tier {
+ /**
+ * Per-event basis point rate
+ */
+ bps: number;
+
+ /**
+ * Inclusive tier starting value
+ */
+ minimum_amount: string;
+
+ /**
+ * Exclusive tier ending value
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * Per unit maximum to charge
+ */
+ per_unit_maximum?: string | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16116,7 +16168,9 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingGroupedWithProratedMinimumPrice {
+ export interface NewFloatingBpsPrice {
+ bps_config: NewFloatingBpsPrice.BpsConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -16127,14 +16181,12 @@ export namespace SubscriptionPriceIntervalsParams {
*/
currency: string;
- grouped_with_prorated_minimum_config: Record;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_with_prorated_minimum';
+ model_type: 'bps';
/**
* The name of the price.
@@ -16157,7 +16209,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16184,7 +16236,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16194,7 +16246,19 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingGroupedWithProratedMinimumPrice {
+ export namespace NewFloatingBpsPrice {
+ export interface BpsConfig {
+ /**
+ * Basis point take rate per event
+ */
+ bps: number;
+
+ /**
+ * Optional currency amount maximum to cap spend per event
+ */
+ per_unit_maximum?: string | null;
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16228,7 +16292,9 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingGroupedWithMeteredMinimumPrice {
+ export interface NewFloatingBulkBpsPrice {
+ bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -16239,14 +16305,12 @@ export namespace SubscriptionPriceIntervalsParams {
*/
currency: string;
- grouped_with_metered_minimum_config: Record;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_with_metered_minimum';
+ model_type: 'bulk_bps';
/**
* The name of the price.
@@ -16269,7 +16333,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16296,7 +16360,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16306,7 +16370,34 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingGroupedWithMeteredMinimumPrice {
+ export namespace NewFloatingBulkBpsPrice {
+ export interface BulkBpsConfig {
+ /**
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
+ * tier based on total volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkBpsConfig {
+ export interface Tier {
+ /**
+ * Basis points to rate on
+ */
+ bps: number;
+
+ /**
+ * Upper bound for tier
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * The maximum amount to charge for any one event
+ */
+ per_unit_maximum?: string | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16340,7 +16431,9 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingMatrixWithDisplayNamePrice {
+ export interface NewFloatingBulkPrice {
+ bulk_config: NewFloatingBulkPrice.BulkConfig;
+
/**
* The cadence to bill for this price on.
*/
@@ -16356,9 +16449,7 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- matrix_with_display_name_config: Record;
-
- model_type: 'matrix_with_display_name';
+ model_type: 'bulk';
/**
* The name of the price.
@@ -16381,7 +16472,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16408,7 +16499,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16418,7 +16509,28 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingMatrixWithDisplayNamePrice {
+ export namespace NewFloatingBulkPrice {
+ export interface BulkConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkConfig {
+ export interface Tier {
+ /**
+ * Amount per unit
+ */
+ unit_amount: string;
+
+ /**
+ * Upper bound for this tier
+ */
+ maximum_units?: number | null;
+ }
+ }
+
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16452,9 +16564,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingBulkWithProrationPrice {
- bulk_with_proration_config: Record;
-
+ export interface NewFloatingThresholdTotalAmountPrice {
/**
* The cadence to bill for this price on.
*/
@@ -16470,13 +16580,15 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'bulk_with_proration';
+ model_type: 'threshold_total_amount';
/**
* The name of the price.
*/
name: string;
+ threshold_total_amount_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -16493,7 +16605,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16520,7 +16632,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16530,7 +16642,7 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingBulkWithProrationPrice {
+ export namespace NewFloatingThresholdTotalAmountPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16564,7 +16676,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingGroupedTieredPackagePrice {
+ export interface NewFloatingTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -16575,20 +16687,20 @@ export namespace SubscriptionPriceIntervalsParams {
*/
currency: string;
- grouped_tiered_package_config: Record;
-
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'grouped_tiered_package';
+ model_type: 'tiered_package';
/**
* The name of the price.
*/
name: string;
+ tiered_package_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -16605,7 +16717,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16632,7 +16744,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16642,7 +16754,7 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingGroupedTieredPackagePrice {
+ export namespace NewFloatingTieredPackagePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16676,7 +16788,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingScalableMatrixWithUnitPricingPrice {
+ export interface NewFloatingGroupedTieredPrice {
/**
* The cadence to bill for this price on.
*/
@@ -16687,20 +16799,20 @@ export namespace SubscriptionPriceIntervalsParams {
*/
currency: string;
+ grouped_tiered_config: Record;
+
/**
* The id of the item the price will be associated with.
*/
item_id: string;
- model_type: 'scalable_matrix_with_unit_pricing';
+ model_type: 'grouped_tiered';
/**
* The name of the price.
*/
name: string;
- scalable_matrix_with_unit_pricing_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -16717,7 +16829,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16744,7 +16856,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16754,7 +16866,7 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingScalableMatrixWithUnitPricingPrice {
+ export namespace NewFloatingGroupedTieredPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16788,7 +16900,7 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingScalableMatrixWithTieredPricingPrice {
+ export interface NewFloatingMaxGroupTieredPackagePrice {
/**
* The cadence to bill for this price on.
*/
@@ -16804,15 +16916,15 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'scalable_matrix_with_tiered_pricing';
+ max_group_tiered_package_config: Record;
+
+ model_type: 'max_group_tiered_package';
/**
* The name of the price.
*/
name: string;
- scalable_matrix_with_tiered_pricing_config: Record;
-
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -16829,7 +16941,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16856,7 +16968,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16866,7 +16978,7 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingScalableMatrixWithTieredPricingPrice {
+ export namespace NewFloatingMaxGroupTieredPackagePrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -16900,14 +17012,12 @@ export namespace SubscriptionPriceIntervalsParams {
}
}
- export interface NewFloatingCumulativeGroupedBulkPrice {
+ export interface NewFloatingTieredWithMinimumPrice {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- cumulative_grouped_bulk_config: Record;
-
/**
* An ISO 4217 currency string for which this price is billed in.
*/
@@ -16918,13 +17028,15 @@ export namespace SubscriptionPriceIntervalsParams {
*/
item_id: string;
- model_type: 'cumulative_grouped_bulk';
+ model_type: 'tiered_with_minimum';
/**
* The name of the price.
*/
name: string;
+ tiered_with_minimum_config: Record;
+
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
@@ -16941,7 +17053,7 @@ export namespace SubscriptionPriceIntervalsParams {
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
- billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null;
+ billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
@@ -16968,7 +17080,7 @@ export namespace SubscriptionPriceIntervalsParams {
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
- invoicing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null;
+ invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null;
/**
* User-specified key/value pairs for the resource. Individual keys can be removed
@@ -16978,7 +17090,7 @@ export namespace SubscriptionPriceIntervalsParams {
metadata?: Record | null;
}
- export namespace NewFloatingCumulativeGroupedBulkPrice {
+ export namespace NewFloatingTieredWithMinimumPrice {
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
@@ -17011,614 +17123,4026 @@ export namespace SubscriptionPriceIntervalsParams {
duration_unit: 'day' | 'month';
}
}
- }
-
- export interface AddAdjustment {
- /**
- * The definition of a new adjustment to create and add to the subscription.
- */
- adjustment:
- | AddAdjustment.NewPercentageDiscount
- | AddAdjustment.NewUsageDiscount
- | AddAdjustment.NewAmountDiscount
- | AddAdjustment.NewMinimum
- | AddAdjustment.NewMaximum;
-
- /**
- * The start date of the adjustment interval. This is the date that the adjustment
- * will start affecting prices on the subscription.
- */
- start_date: (string & {}) | Shared.BillingCycleRelativeDate;
-
- /**
- * The end date of the adjustment interval. This is the date that the adjustment
- * will stop affecting prices on the subscription.
- */
- end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
- }
-
- export namespace AddAdjustment {
- export interface NewPercentageDiscount {
- adjustment_type: 'percentage_discount';
+ export interface NewFloatingPackageWithAllocationPrice {
/**
- * The set of price IDs to which this adjustment applies.
+ * The cadence to bill for this price on.
*/
- applies_to_price_ids: Array;
-
- percentage_discount: number;
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * An ISO 4217 currency string for which this price is billed in.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewUsageDiscount {
- adjustment_type: 'usage_discount';
+ currency: string;
/**
- * The set of price IDs to which this adjustment applies.
+ * The id of the item the price will be associated with.
*/
- applies_to_price_ids: Array;
+ item_id: string;
- usage_discount: number;
+ model_type: 'package_with_allocation';
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * The name of the price.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewAmountDiscount {
- adjustment_type: 'amount_discount';
+ name: string;
- amount_discount: string;
+ package_with_allocation_config: Record;
/**
- * The set of price IDs to which this adjustment applies.
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
*/
- applies_to_price_ids: Array;
+ billable_metric_id?: string | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewMinimum {
- adjustment_type: 'minimum';
+ billed_in_advance?: boolean | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- applies_to_price_ids: Array;
+ billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null;
/**
- * The item ID that revenue from this minimum will be attributed to.
+ * The per unit conversion rate of the price currency to the invoicing currency.
*/
- item_id: string;
-
- minimum_amount: string;
+ conversion_rate?: number | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * An alias for the price.
*/
- is_invoice_level?: boolean;
- }
+ external_price_id?: string | null;
- export interface NewMaximum {
- adjustment_type: 'maximum';
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * The property used to group this price on an invoice
*/
- applies_to_price_ids: Array;
+ invoice_grouping_key?: string | null;
- maximum_amount: string;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
*/
- is_invoice_level?: boolean;
+ metadata?: Record | null;
}
- }
- export interface Edit {
- /**
- * The id of the price interval to edit.
- */
- price_interval_id: string;
+ export namespace NewFloatingPackageWithAllocationPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * The updated billing cycle day for this price interval. If not specified, the
- * billing cycle day will not be updated. Note that overlapping price intervals
- * must have the same billing cycle day.
- */
- billing_cycle_day?: number | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
- /**
- * The updated end date of this price interval. If not specified, the start date
- * will not be updated.
- */
- end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * An additional filter to apply to usage queries. This filter must be expressed as
- * a boolean
- * [computed property](/extensibility/advanced-metrics#computed-properties). If
- * null, usage queries will not include any additional filter.
- */
- filter?: string | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
- /**
- * A list of fixed fee quantity transitions to use for this price interval. Note
- * that this list will overwrite all existing fixed fee quantity transitions on the
- * price interval.
- */
- fixed_fee_quantity_transitions?: Array | null;
+ export interface NewFloatingTieredPackageWithMinimumPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * The updated start date of this price interval. If not specified, the start date
- * will not be updated.
- */
- start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
- /**
- * A list of customer IDs whose usage events will be aggregated and billed under
- * this subscription. By default, a subscription only considers usage events
- * associated with its attached customer's customer_id. When usage_customer_ids is
- * provided, the subscription includes usage events from the specified customers
- * only. Provided usage_customer_ids must be either the customer for this
- * subscription itself, or any of that customer's children.
- */
- usage_customer_ids?: Array | null;
- }
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'tiered_package_with_minimum';
- export namespace Edit {
- export interface FixedFeeQuantityTransition {
/**
- * The date that the fixed fee quantity transition should take effect.
+ * The name of the price.
*/
- effective_date: string;
+ name: string;
+
+ tiered_package_with_minimum_config: Record;
/**
- * The quantity of the fixed fee quantity transition.
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
*/
- quantity: number;
- }
- }
+ billable_metric_id?: string | null;
- export interface EditAdjustment {
- /**
- * The id of the adjustment interval to edit.
- */
- adjustment_interval_id: string;
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
- /**
- * The updated end date of this adjustment interval. If not specified, the start
- * date will not be updated.
- */
- end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null;
- /**
- * The updated start date of this adjustment interval. If not specified, the start
- * date will not be updated.
- */
- start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
- }
-}
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
-export interface SubscriptionSchedulePlanChangeParams {
- change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate';
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
- /**
- * Additional adjustments to be added to the subscription. (Only available for
- * accounts that have migrated off of legacy subscription overrides)
- */
- add_adjustments?: Array | null;
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
- /**
- * Additional prices to be added to the subscription. (Only available for accounts
- * that have migrated off of legacy subscription overrides)
- */
- add_prices?: Array | null;
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
- /**
- * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
- * aligned with the plan change's effective date.
- */
- align_billing_with_plan_change_date?: boolean | null;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null;
- /**
- * Determines whether issued invoices for this subscription will automatically be
- * charged with the saved payment method on the due date. If not specified, this
- * defaults to the behavior configured for this customer.
- */
- auto_collection?: boolean | null;
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
- /**
- * Reset billing periods to be aligned with the plan change's effective date or
- * start of the month. Defaults to `unchanged` which keeps subscription's existing
- * billing cycle alignment.
- */
- billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null;
+ export namespace NewFloatingTieredPackageWithMinimumPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- billing_cycle_anchor_configuration?: SubscriptionSchedulePlanChangeParams.BillingCycleAnchorConfiguration | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
- /**
- * The date that the plan change should take effect. This parameter can only be
- * passed if the `change_option` is `requested_date`. If a date with no time is
- * passed, the plan change will happen at midnight in the customer's timezone.
- */
- change_date?: string | null;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Redemption code to be used for this subscription. If the coupon cannot be found
- * by its redemption code, or cannot be redeemed, an error response will be
- * returned and the subscription creation or plan change will not be scheduled.
- */
- coupon_redemption_code?: string | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
- credits_overage_rate?: number | null;
+ export interface NewFloatingUnitWithPercentPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * Determines the default memo on this subscription's invoices. Note that if this
- * is not provided, it is determined by the plan configuration.
- */
- default_invoice_memo?: string | null;
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
- /**
- * The external_plan_id of the plan that the given subscription should be switched
- * to. Note that either this property or `plan_id` must be specified.
- */
- external_plan_id?: string | null;
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
- /**
+ model_type: 'unit_with_percent';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ unit_with_percent_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingUnitWithPercentPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingTieredWithProrationPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'tiered_with_proration';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ tiered_with_proration_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingTieredWithProrationPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingUnitWithProrationPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'unit_with_proration';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ unit_with_proration_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingUnitWithProrationPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingGroupedAllocationPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ grouped_allocation_config: Record;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'grouped_allocation';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingGroupedAllocationPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingGroupedWithProratedMinimumPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ grouped_with_prorated_minimum_config: Record;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'grouped_with_prorated_minimum';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingGroupedWithProratedMinimumPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingGroupedWithMeteredMinimumPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ grouped_with_metered_minimum_config: Record;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'grouped_with_metered_minimum';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingGroupedWithMeteredMinimumPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingMatrixWithDisplayNamePrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ matrix_with_display_name_config: Record;
+
+ model_type: 'matrix_with_display_name';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingMatrixWithDisplayNamePrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingBulkWithProrationPrice {
+ bulk_with_proration_config: Record;
+
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'bulk_with_proration';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingBulkWithProrationPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingGroupedTieredPackagePrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ grouped_tiered_package_config: Record;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'grouped_tiered_package';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingGroupedTieredPackagePrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingScalableMatrixWithUnitPricingPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'scalable_matrix_with_unit_pricing';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ scalable_matrix_with_unit_pricing_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingScalableMatrixWithUnitPricingPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingScalableMatrixWithTieredPricingPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'scalable_matrix_with_tiered_pricing';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ scalable_matrix_with_tiered_pricing_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingScalableMatrixWithTieredPricingPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewFloatingCumulativeGroupedBulkPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ cumulative_grouped_bulk_config: Record;
+
+ /**
+ * An ISO 4217 currency string for which this price is billed in.
+ */
+ currency: string;
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'cumulative_grouped_bulk';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+ }
+
+ export namespace NewFloatingCumulativeGroupedBulkPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+ }
+
+ export interface AddAdjustment {
+ /**
+ * The definition of a new adjustment to create and add to the subscription.
+ */
+ adjustment:
+ | AddAdjustment.NewPercentageDiscount
+ | AddAdjustment.NewUsageDiscount
+ | AddAdjustment.NewAmountDiscount
+ | AddAdjustment.NewMinimum
+ | AddAdjustment.NewMaximum;
+
+ /**
+ * The start date of the adjustment interval. This is the date that the adjustment
+ * will start affecting prices on the subscription.
+ */
+ start_date: (string & {}) | Shared.BillingCycleRelativeDate;
+
+ /**
+ * The end date of the adjustment interval. This is the date that the adjustment
+ * will stop affecting prices on the subscription.
+ */
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
+ }
+
+ export namespace AddAdjustment {
+ export interface NewPercentageDiscount {
+ adjustment_type: 'percentage_discount';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ percentage_discount: number;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewUsageDiscount {
+ adjustment_type: 'usage_discount';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ usage_discount: number;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewAmountDiscount {
+ adjustment_type: 'amount_discount';
+
+ amount_discount: string;
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewMinimum {
+ adjustment_type: 'minimum';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ /**
+ * The item ID that revenue from this minimum will be attributed to.
+ */
+ item_id: string;
+
+ minimum_amount: string;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewMaximum {
+ adjustment_type: 'maximum';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ maximum_amount: string;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+ }
+
+ export interface Edit {
+ /**
+ * The id of the price interval to edit.
+ */
+ price_interval_id: string;
+
+ /**
+ * The updated billing cycle day for this price interval. If not specified, the
+ * billing cycle day will not be updated. Note that overlapping price intervals
+ * must have the same billing cycle day.
+ */
+ billing_cycle_day?: number | null;
+
+ /**
+ * The updated end date of this price interval. If not specified, the start date
+ * will not be updated.
+ */
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
+
+ /**
+ * An additional filter to apply to usage queries. This filter must be expressed as
+ * a boolean
+ * [computed property](/extensibility/advanced-metrics#computed-properties). If
+ * null, usage queries will not include any additional filter.
+ */
+ filter?: string | null;
+
+ /**
+ * A list of fixed fee quantity transitions to use for this price interval. Note
+ * that this list will overwrite all existing fixed fee quantity transitions on the
+ * price interval.
+ */
+ fixed_fee_quantity_transitions?: Array | null;
+
+ /**
+ * The updated start date of this price interval. If not specified, the start date
+ * will not be updated.
+ */
+ start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
+
+ /**
+ * A list of customer IDs whose usage events will be aggregated and billed under
+ * this subscription. By default, a subscription only considers usage events
+ * associated with its attached customer's customer_id. When usage_customer_ids is
+ * provided, the subscription includes usage events from the specified customers
+ * only. Provided usage_customer_ids must be either the customer for this
+ * subscription itself, or any of that customer's children.
+ */
+ usage_customer_ids?: Array | null;
+ }
+
+ export namespace Edit {
+ export interface FixedFeeQuantityTransition {
+ /**
+ * The date that the fixed fee quantity transition should take effect.
+ */
+ effective_date: string;
+
+ /**
+ * The quantity of the fixed fee quantity transition.
+ */
+ quantity: number;
+ }
+ }
+
+ export interface EditAdjustment {
+ /**
+ * The id of the adjustment interval to edit.
+ */
+ adjustment_interval_id: string;
+
+ /**
+ * The updated end date of this adjustment interval. If not specified, the start
+ * date will not be updated.
+ */
+ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
+
+ /**
+ * The updated start date of this adjustment interval. If not specified, the start
+ * date will not be updated.
+ */
+ start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
+ }
+}
+
+export interface SubscriptionSchedulePlanChangeParams {
+ change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate';
+
+ /**
+ * Additional adjustments to be added to the subscription. (Only available for
+ * accounts that have migrated off of legacy subscription overrides)
+ */
+ add_adjustments?: Array | null;
+
+ /**
+ * Additional prices to be added to the subscription. (Only available for accounts
+ * that have migrated off of legacy subscription overrides)
+ */
+ add_prices?: Array | null;
+
+ /**
+ * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
+ * aligned with the plan change's effective date.
+ */
+ align_billing_with_plan_change_date?: boolean | null;
+
+ /**
+ * Determines whether issued invoices for this subscription will automatically be
+ * charged with the saved payment method on the due date. If not specified, this
+ * defaults to the behavior configured for this customer.
+ */
+ auto_collection?: boolean | null;
+
+ /**
+ * Reset billing periods to be aligned with the plan change's effective date or
+ * start of the month. Defaults to `unchanged` which keeps subscription's existing
+ * billing cycle alignment.
+ */
+ billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null;
+
+ billing_cycle_anchor_configuration?: SubscriptionSchedulePlanChangeParams.BillingCycleAnchorConfiguration | null;
+
+ /**
+ * The date that the plan change should take effect. This parameter can only be
+ * passed if the `change_option` is `requested_date`. If a date with no time is
+ * passed, the plan change will happen at midnight in the customer's timezone.
+ */
+ change_date?: string | null;
+
+ /**
+ * Redemption code to be used for this subscription. If the coupon cannot be found
+ * by its redemption code, or cannot be redeemed, an error response will be
+ * returned and the subscription creation or plan change will not be scheduled.
+ */
+ coupon_redemption_code?: string | null;
+
+ credits_overage_rate?: number | null;
+
+ /**
+ * Determines the default memo on this subscription's invoices. Note that if this
+ * is not provided, it is determined by the plan configuration.
+ */
+ default_invoice_memo?: string | null;
+
+ /**
+ * The external_plan_id of the plan that the given subscription should be switched
+ * to. Note that either this property or `plan_id` must be specified.
+ */
+ external_plan_id?: string | null;
+
+ /**
* An additional filter to apply to usage queries. This filter must be expressed as
* a boolean
* [computed property](/extensibility/advanced-metrics#computed-properties). If
* null, usage queries will not include any additional filter.
*/
- filter?: string | null;
+ filter?: string | null;
+
+ /**
+ * The phase of the plan to start with
+ */
+ initial_phase_order?: number | null;
+
+ /**
+ * When this subscription's accrued usage reaches this threshold, an invoice will
+ * be issued for the subscription. If not specified, invoices will only be issued
+ * at the end of the billing period.
+ */
+ invoicing_threshold?: string | null;
+
+ /**
+ * The net terms determines the difference between the invoice date and the issue
+ * date for the invoice. If you intend the invoice to be due on issue, set this
+ * to 0. If not provided, this defaults to the value specified in the plan.
+ */
+ net_terms?: number | null;
+
+ per_credit_overage_amount?: number | null;
+
+ /**
+ * The plan that the given subscription should be switched to. Note that either
+ * this property or `external_plan_id` must be specified.
+ */
+ plan_id?: string | null;
+
+ /**
+ * Specifies which version of the plan to change to. If null, the default version
+ * will be used.
+ */
+ plan_version_number?: number | null;
+
+ /**
+ * Optionally provide a list of overrides for prices on the plan
+ */
+ price_overrides?: Array | null;
+
+ /**
+ * Plan adjustments to be removed from the subscription. (Only available for
+ * accounts that have migrated off of legacy subscription overrides)
+ */
+ remove_adjustments?: Array | null;
+
+ /**
+ * Plan prices to be removed from the subscription. (Only available for accounts
+ * that have migrated off of legacy subscription overrides)
+ */
+ remove_prices?: Array | null;
+
+ /**
+ * Plan adjustments to be replaced with additional adjustments on the subscription.
+ * (Only available for accounts that have migrated off of legacy subscription
+ * overrides)
+ */
+ replace_adjustments?: Array | null;
+
+ /**
+ * Plan prices to be replaced with additional prices on the subscription. (Only
+ * available for accounts that have migrated off of legacy subscription overrides)
+ */
+ replace_prices?: Array | null;
+
+ /**
+ * The duration of the trial period in days. If not provided, this defaults to the
+ * value specified in the plan. If `0` is provided, the trial on the plan will be
+ * skipped.
+ */
+ trial_duration_days?: number | null;
+
+ /**
+ * A list of customer IDs whose usage events will be aggregated and billed under
+ * this subscription. By default, a subscription only considers usage events
+ * associated with its attached customer's customer_id. When usage_customer_ids is
+ * provided, the subscription includes usage events from the specified customers
+ * only. Provided usage_customer_ids must be either the customer for this
+ * subscription itself, or any of that customer's children.
+ */
+ usage_customer_ids?: Array | null;
+}
+
+export namespace SubscriptionSchedulePlanChangeParams {
+ export interface AddAdjustment {
+ /**
+ * The definition of a new adjustment to create and add to the subscription.
+ */
+ adjustment:
+ | AddAdjustment.NewPercentageDiscount
+ | AddAdjustment.NewUsageDiscount
+ | AddAdjustment.NewAmountDiscount
+ | AddAdjustment.NewMinimum
+ | AddAdjustment.NewMaximum;
+
+ /**
+ * The end date of the adjustment interval. This is the date that the adjustment
+ * will stop affecting prices on the subscription.
+ */
+ end_date?: string | null;
+
+ /**
+ * The phase to add this adjustment to.
+ */
+ plan_phase_order?: number | null;
+
+ /**
+ * The start date of the adjustment interval. This is the date that the adjustment
+ * will start affecting prices on the subscription. If null, the adjustment will
+ * start when the phase or subscription starts.
+ */
+ start_date?: string | null;
+ }
+
+ export namespace AddAdjustment {
+ export interface NewPercentageDiscount {
+ adjustment_type: 'percentage_discount';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ percentage_discount: number;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewUsageDiscount {
+ adjustment_type: 'usage_discount';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ usage_discount: number;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewAmountDiscount {
+ adjustment_type: 'amount_discount';
+
+ amount_discount: string;
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewMinimum {
+ adjustment_type: 'minimum';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ /**
+ * The item ID that revenue from this minimum will be attributed to.
+ */
+ item_id: string;
+
+ minimum_amount: string;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+
+ export interface NewMaximum {
+ adjustment_type: 'maximum';
+
+ /**
+ * The set of price IDs to which this adjustment applies.
+ */
+ applies_to_price_ids: Array;
+
+ maximum_amount: string;
+
+ /**
+ * When false, this adjustment will be applied to a single price. Otherwise, it
+ * will be applied at the invoice level, possibly to multiple prices.
+ */
+ is_invoice_level?: boolean;
+ }
+ }
+
+ export interface AddPrice {
+ /**
+ * The definition of a new allocation price to create and add to the subscription.
+ */
+ allocation_price?: AddPrice.AllocationPrice | null;
+
+ /**
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
+ * discounts for this price.
+ */
+ discounts?: Array | null;
+
+ /**
+ * The end date of the price interval. This is the date that the price will stop
+ * billing on the subscription. If null, billing will end when the phase or
+ * subscription ends.
+ */
+ end_date?: string | null;
+
+ /**
+ * The external price id of the price to add to the subscription.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
+ * amount for this price.
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
+ * amount for this price.
+ */
+ minimum_amount?: string | null;
+
+ /**
+ * The phase to add this price to.
+ */
+ plan_phase_order?: number | null;
+
+ /**
+ * The definition of a new price to create and add to the subscription.
+ */
+ price?:
+ | AddPrice.NewSubscriptionUnitPrice
+ | AddPrice.NewSubscriptionPackagePrice
+ | AddPrice.NewSubscriptionMatrixPrice
+ | AddPrice.NewSubscriptionTieredPrice
+ | AddPrice.NewSubscriptionTieredBpsPrice
+ | AddPrice.NewSubscriptionBpsPrice
+ | AddPrice.NewSubscriptionBulkBpsPrice
+ | AddPrice.NewSubscriptionBulkPrice
+ | AddPrice.NewSubscriptionThresholdTotalAmountPrice
+ | AddPrice.NewSubscriptionTieredPackagePrice
+ | AddPrice.NewSubscriptionTieredWithMinimumPrice
+ | AddPrice.NewSubscriptionUnitWithPercentPrice
+ | AddPrice.NewSubscriptionPackageWithAllocationPrice
+ | AddPrice.NewSubscriptionTierWithProrationPrice
+ | AddPrice.NewSubscriptionUnitWithProrationPrice
+ | AddPrice.NewSubscriptionGroupedAllocationPrice
+ | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice
+ | AddPrice.NewSubscriptionBulkWithProrationPrice
+ | AddPrice.NewSubscriptionScalableMatrixWithUnitPricingPrice
+ | AddPrice.NewSubscriptionScalableMatrixWithTieredPricingPrice
+ | AddPrice.NewSubscriptionCumulativeGroupedBulkPrice
+ | AddPrice.NewSubscriptionMaxGroupTieredPackagePrice
+ | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice
+ | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice
+ | AddPrice.NewSubscriptionGroupedTieredPackagePrice
+ | null;
+
+ /**
+ * The id of the price to add to the subscription.
+ */
+ price_id?: string | null;
+
+ /**
+ * The start date of the price interval. This is the date that the price will start
+ * billing on the subscription. If null, billing will start when the phase or
+ * subscription starts.
+ */
+ start_date?: string | null;
+ }
+
+ export namespace AddPrice {
+ /**
+ * The definition of a new allocation price to create and add to the subscription.
+ */
+ export interface AllocationPrice {
+ /**
+ * An amount of the currency to allocate to the customer at the specified cadence.
+ */
+ amount: string;
+
+ /**
+ * The cadence at which to allocate the amount to the customer.
+ */
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
+
+ /**
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
+ * this price.
+ */
+ currency: string;
+
+ /**
+ * Whether the allocated amount should expire at the end of the cadence or roll
+ * over to the next period.
+ */
+ expires_at_end_of_cadence: boolean;
+ }
+
+ export interface Discount {
+ discount_type: 'percentage' | 'usage' | 'amount';
+
+ /**
+ * Only available if discount_type is `amount`.
+ */
+ amount_discount?: string | null;
+
+ /**
+ * Only available if discount_type is `percentage`. This is a number between 0
+ * and 1.
+ */
+ percentage_discount?: number | null;
+
+ /**
+ * Only available if discount_type is `usage`. Number of usage units that this
+ * discount is for
+ */
+ usage_discount?: number | null;
+ }
+
+ export interface NewSubscriptionUnitPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'unit';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ unit_config: NewSubscriptionUnitPrice.UnitConfig;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionUnitPrice {
+ export interface UnitConfig {
+ /**
+ * Rate per unit of usage
+ */
+ unit_amount: string;
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionPackagePrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'package';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ package_config: NewSubscriptionPackagePrice.PackageConfig;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionPackagePrice {
+ export interface PackageConfig {
+ /**
+ * A currency amount to rate usage by
+ */
+ package_amount: string;
+
+ /**
+ * An integer amount to represent package size. For example, 1000 here would divide
+ * usage by 1000 before multiplying by package_amount in rating
+ */
+ package_size: number;
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionMatrixPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ matrix_config: NewSubscriptionMatrixPrice.MatrixConfig;
+
+ model_type: 'matrix';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionMatrixPrice {
+ export interface MatrixConfig {
+ /**
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
+ */
+ default_unit_amount: string;
+
+ /**
+ * One or two event property values to evaluate matrix groups by
+ */
+ dimensions: Array;
+
+ /**
+ * Matrix values for specified matrix grouping keys
+ */
+ matrix_values: Array;
+ }
+
+ export namespace MatrixConfig {
+ export interface MatrixValue {
+ /**
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
+ * instance tier.
+ */
+ dimension_values: Array;
+
+ /**
+ * Unit price for the specified dimension_values
+ */
+ unit_amount: string;
+ }
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionTieredPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'tiered';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ tiered_config: NewSubscriptionTieredPrice.TieredConfig;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionTieredPrice {
+ export interface TieredConfig {
+ /**
+ * Tiers for rating based on total usage quantities into the specified tier
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredConfig {
+ export interface Tier {
+ /**
+ * Inclusive tier starting value
+ */
+ first_unit: number;
+
+ /**
+ * Amount per unit
+ */
+ unit_amount: string;
+
+ /**
+ * Exclusive tier ending value. If null, this is treated as the last tier
+ */
+ last_unit?: number | null;
+ }
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionTieredBpsPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'tiered_bps';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionTieredBpsPrice {
+ export interface TieredBpsConfig {
+ /**
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
+ * tiers
+ */
+ tiers: Array;
+ }
+
+ export namespace TieredBpsConfig {
+ export interface Tier {
+ /**
+ * Per-event basis point rate
+ */
+ bps: number;
+
+ /**
+ * Inclusive tier starting value
+ */
+ minimum_amount: string;
+
+ /**
+ * Exclusive tier ending value
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * Per unit maximum to charge
+ */
+ per_unit_maximum?: string | null;
+ }
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionBpsPrice {
+ bps_config: NewSubscriptionBpsPrice.BpsConfig;
+
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'bps';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionBpsPrice {
+ export interface BpsConfig {
+ /**
+ * Basis point take rate per event
+ */
+ bps: number;
+
+ /**
+ * Optional currency amount maximum to cap spend per event
+ */
+ per_unit_maximum?: string | null;
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionBulkBpsPrice {
+ bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig;
+
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'bulk_bps';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionBulkBpsPrice {
+ export interface BulkBpsConfig {
+ /**
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
+ * tier based on total volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkBpsConfig {
+ export interface Tier {
+ /**
+ * Basis points to rate on
+ */
+ bps: number;
+
+ /**
+ * Upper bound for tier
+ */
+ maximum_amount?: string | null;
+
+ /**
+ * The maximum amount to charge for any one event
+ */
+ per_unit_maximum?: string | null;
+ }
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionBulkPrice {
+ bulk_config: NewSubscriptionBulkPrice.BulkConfig;
+
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'bulk';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionBulkPrice {
+ export interface BulkConfig {
+ /**
+ * Bulk tiers for rating based on total usage volume
+ */
+ tiers: Array;
+ }
+
+ export namespace BulkConfig {
+ export interface Tier {
+ /**
+ * Amount per unit
+ */
+ unit_amount: string;
+
+ /**
+ * Upper bound for this tier
+ */
+ maximum_units?: number | null;
+ }
+ }
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionThresholdTotalAmountPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'threshold_total_amount';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ threshold_total_amount_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionThresholdTotalAmountPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionTieredPackagePrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'tiered_package';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ tiered_package_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionTieredPackagePrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionTieredWithMinimumPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'tiered_with_minimum';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ tiered_with_minimum_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionTieredWithMinimumPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+
+ export interface NewSubscriptionUnitWithPercentPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
+
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
+
+ model_type: 'unit_with_percent';
+
+ /**
+ * The name of the price.
+ */
+ name: string;
+
+ unit_with_percent_config: Record;
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
+
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null;
+
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ */
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
- /**
- * The phase of the plan to start with
- */
- initial_phase_order?: number | null;
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
- /**
- * When this subscription's accrued usage reaches this threshold, an invoice will
- * be issued for the subscription. If not specified, invoices will only be issued
- * at the end of the billing period.
- */
- invoicing_threshold?: string | null;
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
- /**
- * The net terms determines the difference between the invoice date and the issue
- * date for the invoice. If you intend the invoice to be due on issue, set this
- * to 0. If not provided, this defaults to the value specified in the plan.
- */
- net_terms?: number | null;
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
- per_credit_overage_amount?: number | null;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null;
- /**
- * The plan that the given subscription should be switched to. Note that either
- * this property or `external_plan_id` must be specified.
- */
- plan_id?: string | null;
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
- /**
- * Specifies which version of the plan to change to. If null, the default version
- * will be used.
- */
- plan_version_number?: number | null;
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
- /**
- * Optionally provide a list of overrides for prices on the plan
- */
- price_overrides?: Array | null;
+ export namespace NewSubscriptionUnitWithPercentPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Plan adjustments to be removed from the subscription. (Only available for
- * accounts that have migrated off of legacy subscription overrides)
- */
- remove_adjustments?: Array | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
- /**
- * Plan prices to be removed from the subscription. (Only available for accounts
- * that have migrated off of legacy subscription overrides)
- */
- remove_prices?: Array | null;
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Plan adjustments to be replaced with additional adjustments on the subscription.
- * (Only available for accounts that have migrated off of legacy subscription
- * overrides)
- */
- replace_adjustments?: Array | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
- /**
- * Plan prices to be replaced with additional prices on the subscription. (Only
- * available for accounts that have migrated off of legacy subscription overrides)
- */
- replace_prices?: Array | null;
+ export interface NewSubscriptionPackageWithAllocationPrice {
+ /**
+ * The cadence to bill for this price on.
+ */
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
- /**
- * The duration of the trial period in days. If not provided, this defaults to the
- * value specified in the plan. If `0` is provided, the trial on the plan will be
- * skipped.
- */
- trial_duration_days?: number | null;
+ /**
+ * The id of the item the price will be associated with.
+ */
+ item_id: string;
- /**
- * A list of customer IDs whose usage events will be aggregated and billed under
- * this subscription. By default, a subscription only considers usage events
- * associated with its attached customer's customer_id. When usage_customer_ids is
- * provided, the subscription includes usage events from the specified customers
- * only. Provided usage_customer_ids must be either the customer for this
- * subscription itself, or any of that customer's children.
- */
- usage_customer_ids?: Array | null;
-}
+ model_type: 'package_with_allocation';
-export namespace SubscriptionSchedulePlanChangeParams {
- export interface AddAdjustment {
- /**
- * The definition of a new adjustment to create and add to the subscription.
- */
- adjustment:
- | AddAdjustment.NewPercentageDiscount
- | AddAdjustment.NewUsageDiscount
- | AddAdjustment.NewAmountDiscount
- | AddAdjustment.NewMinimum
- | AddAdjustment.NewMaximum;
+ /**
+ * The name of the price.
+ */
+ name: string;
- /**
- * The end date of the adjustment interval. This is the date that the adjustment
- * will stop affecting prices on the subscription.
- */
- end_date?: string | null;
+ package_with_allocation_config: Record;
- /**
- * The phase to add this adjustment to.
- */
- plan_phase_order?: number | null;
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ billable_metric_id?: string | null;
- /**
- * The start date of the adjustment interval. This is the date that the adjustment
- * will start affecting prices on the subscription. If null, the adjustment will
- * start when the phase or subscription starts.
- */
- start_date?: string | null;
- }
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
+ */
+ billed_in_advance?: boolean | null;
- export namespace AddAdjustment {
- export interface NewPercentageDiscount {
- adjustment_type: 'percentage_discount';
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * The per unit conversion rate of the price currency to the invoicing currency.
*/
- applies_to_price_ids: Array;
+ conversion_rate?: number | null;
+
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ */
+ currency?: string | null;
+
+ /**
+ * An alias for the price.
+ */
+ external_price_id?: string | null;
+
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ */
+ fixed_price_quantity?: number | null;
+
+ /**
+ * The property used to group this price on an invoice
+ */
+ invoice_grouping_key?: string | null;
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null;
+
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
+ */
+ metadata?: Record | null;
+
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ */
+ reference_id?: string | null;
+ }
+
+ export namespace NewSubscriptionPackageWithAllocationPrice {
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ */
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ */
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- percentage_discount: number;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
+ }
+ export interface NewSubscriptionTierWithProrationPrice {
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * The cadence to bill for this price on.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewUsageDiscount {
- adjustment_type: 'usage_discount';
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
/**
- * The set of price IDs to which this adjustment applies.
+ * The id of the item the price will be associated with.
*/
- applies_to_price_ids: Array;
+ item_id: string;
- usage_discount: number;
+ model_type: 'tiered_with_proration';
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * The name of the price.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewAmountDiscount {
- adjustment_type: 'amount_discount';
+ name: string;
- amount_discount: string;
+ tiered_with_proration_config: Record;
/**
- * The set of price IDs to which this adjustment applies.
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
*/
- applies_to_price_ids: Array;
+ billable_metric_id?: string | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * If the Price represents a fixed cost, the price will be billed in-advance if
+ * this is true, and in-arrears if this is false.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewMinimum {
- adjustment_type: 'minimum';
+ billed_in_advance?: boolean | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- applies_to_price_ids: Array;
+ billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null;
/**
- * The item ID that revenue from this minimum will be attributed to.
+ * The per unit conversion rate of the price currency to the invoicing currency.
*/
- item_id: string;
-
- minimum_amount: string;
+ conversion_rate?: number | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
*/
- is_invoice_level?: boolean;
- }
-
- export interface NewMaximum {
- adjustment_type: 'maximum';
+ currency?: string | null;
/**
- * The set of price IDs to which this adjustment applies.
+ * An alias for the price.
*/
- applies_to_price_ids: Array;
-
- maximum_amount: string;
+ external_price_id?: string | null;
/**
- * When false, this adjustment will be applied to a single price. Otherwise, it
- * will be applied at the invoice level, possibly to multiple prices.
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
*/
- is_invoice_level?: boolean;
- }
- }
-
- export interface AddPrice {
- /**
- * The definition of a new allocation price to create and add to the subscription.
- */
- allocation_price?: AddPrice.AllocationPrice | null;
-
- /**
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
- * discounts for this price.
- */
- discounts?: Array | null;
-
- /**
- * The end date of the price interval. This is the date that the price will stop
- * billing on the subscription. If null, billing will end when the phase or
- * subscription ends.
- */
- end_date?: string | null;
-
- /**
- * The external price id of the price to add to the subscription.
- */
- external_price_id?: string | null;
-
- /**
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum
- * amount for this price.
- */
- maximum_amount?: string | null;
-
- /**
- * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum
- * amount for this price.
- */
- minimum_amount?: string | null;
-
- /**
- * The phase to add this price to.
- */
- plan_phase_order?: number | null;
-
- /**
- * The definition of a new price to create and add to the subscription.
- */
- price?:
- | AddPrice.NewSubscriptionUnitPrice
- | AddPrice.NewSubscriptionPackagePrice
- | AddPrice.NewSubscriptionMatrixPrice
- | AddPrice.NewSubscriptionTieredPrice
- | AddPrice.NewSubscriptionTieredBpsPrice
- | AddPrice.NewSubscriptionBpsPrice
- | AddPrice.NewSubscriptionBulkBpsPrice
- | AddPrice.NewSubscriptionBulkPrice
- | AddPrice.NewSubscriptionThresholdTotalAmountPrice
- | AddPrice.NewSubscriptionTieredPackagePrice
- | AddPrice.NewSubscriptionTieredWithMinimumPrice
- | AddPrice.NewSubscriptionUnitWithPercentPrice
- | AddPrice.NewSubscriptionPackageWithAllocationPrice
- | AddPrice.NewSubscriptionTierWithProrationPrice
- | AddPrice.NewSubscriptionUnitWithProrationPrice
- | AddPrice.NewSubscriptionGroupedAllocationPrice
- | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice
- | AddPrice.NewSubscriptionBulkWithProrationPrice
- | null;
-
- /**
- * The id of the price to add to the subscription.
- */
- price_id?: string | null;
-
- /**
- * The start date of the price interval. This is the date that the price will start
- * billing on the subscription. If null, billing will start when the phase or
- * subscription starts.
- */
- start_date?: string | null;
- }
+ fixed_price_quantity?: number | null;
- export namespace AddPrice {
- /**
- * The definition of a new allocation price to create and add to the subscription.
- */
- export interface AllocationPrice {
/**
- * An amount of the currency to allocate to the customer at the specified cadence.
+ * The property used to group this price on an invoice
*/
- amount: string;
+ invoice_grouping_key?: string | null;
/**
- * The cadence at which to allocate the amount to the customer.
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
+ invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null;
/**
- * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
- * this price.
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
+ * by setting `metadata` to `null`.
*/
- currency: string;
+ metadata?: Record | null;
/**
- * Whether the allocated amount should expire at the end of the cadence or roll
- * over to the next period.
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
*/
- expires_at_end_of_cadence: boolean;
+ reference_id?: string | null;
}
- export interface Discount {
- discount_type: 'percentage' | 'usage' | 'amount';
-
+ export namespace NewSubscriptionTierWithProrationPrice {
/**
- * Only available if discount_type is `amount`.
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
*/
- amount_discount?: string | null;
+ export interface BillingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
- /**
- * Only available if discount_type is `percentage`. This is a number between 0
- * and 1.
- */
- percentage_discount?: number | null;
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
/**
- * Only available if discount_type is `usage`. Number of usage units that this
- * discount is for
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
*/
- usage_discount?: number | null;
+ export interface InvoicingCycleConfiguration {
+ /**
+ * The duration of the billing period.
+ */
+ duration: number;
+
+ /**
+ * The unit of billing period duration.
+ */
+ duration_unit: 'day' | 'month';
+ }
}
- export interface NewSubscriptionUnitPrice {
+ export interface NewSubscriptionUnitWithProrationPrice {
/**
* The cadence to bill for this price on.
*/
@@ -17629,14 +21153,14 @@ export namespace SubscriptionSchedulePlanChangeParams {
*/
item_id: string;
- model_type: 'unit';
+ model_type: 'unit_with_proration';
/**
* The name of the price.
*/
name: string;
- unit_config: NewSubscriptionUnitPrice.UnitConfig;
+ unit_with_proration_config: Record