orb-billing
Version:
The official TypeScript library for the Orb API
1,164 lines (1,163 loc) • 211 kB
TypeScript
import { APIResource } from "../../resource.js";
import * as Core from "../../core.js";
import * as Shared from "../shared.js";
import * as ExternalPlanIDAPI from "./external-plan-id.js";
import { ExternalPlanID, ExternalPlanIDUpdateParams } from "./external-plan-id.js";
import * as MigrationsAPI from "./migrations.js";
import { MigrationCancelResponse, MigrationListParams, MigrationListResponse, MigrationListResponsesPage, MigrationRetrieveResponse, Migrations } from "./migrations.js";
import { Page, type PageParams } from "../../pagination.js";
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a
* customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices
* in the [Price resource](/reference/price).
*/
export declare class Plans extends APIResource {
externalPlanId: ExternalPlanIDAPI.ExternalPlanID;
migrations: MigrationsAPI.Migrations;
/**
* This endpoint allows creation of plans including their prices.
*/
create(body: PlanCreateParams, options?: Core.RequestOptions): Core.APIPromise<Plan>;
/**
* This endpoint can be used to update the `external_plan_id`, and `metadata` of an
* existing plan.
*
* Other fields on a plan are currently immutable.
*/
update(planId: string, body: PlanUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Plan>;
/**
* This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for
* an account in a list format. The list of plans is ordered starting from the most
* recently created plan. The response also includes
* [`pagination_metadata`](/api-reference/pagination), which lets the caller
* retrieve the next page of results if they exist.
*/
list(query?: PlanListParams, options?: Core.RequestOptions): Core.PagePromise<PlansPage, Plan>;
list(options?: Core.RequestOptions): Core.PagePromise<PlansPage, Plan>;
/**
* This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details
* given a plan identifier. It returns information about the prices included in the
* plan and their configuration, as well as the product that the plan is attached
* to.
*
* ## Serialized prices
*
* Orb supports a few different pricing models out of the box. Each of these models
* is serialized differently in a given [Price](/core-concepts#plan-and-price)
* object. The `model_type` field determines the key for the configuration object
* that is present. A detailed explanation of price types can be found in the
* [Price schema](/core-concepts#plan-and-price).
*
* ## Phases
*
* Orb supports plan phases, also known as contract ramps. For plans with phases,
* the serialized prices refer to all prices across all phases.
*/
fetch(planId: string, options?: Core.RequestOptions): Core.APIPromise<Plan>;
}
export declare class PlansPage extends Page<Plan> {
}
/**
* The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
* subscribed to by a customer. Plans define the billing behavior of the
* subscription. You can see more about how to configure prices in the
* [Price resource](/reference/price).
*/
export interface Plan {
id: string;
/**
* Adjustments for this plan. If the plan has phases, this includes adjustments
* across all phases of the plan.
*/
adjustments: Array<Shared.PlanPhaseUsageDiscountAdjustment | Shared.PlanPhaseAmountDiscountAdjustment | Shared.PlanPhasePercentageDiscountAdjustment | Shared.PlanPhaseMinimumAdjustment | Shared.PlanPhaseMaximumAdjustment>;
/**
* @deprecated Legacy field representing the parent plan if the current plan is a
* 'child plan', overriding prices from the parent.
*/
base_plan: Plan.BasePlan | null;
/**
* @deprecated Legacy field representing the parent plan ID if the current plan is
* a 'child plan', overriding prices from the parent.
*/
base_plan_id: string | null;
created_at: string;
/**
* @deprecated An ISO 4217 currency string or custom pricing unit (`credits`) for
* this plan's prices.
*/
currency: string;
/**
* The default memo text on the invoices corresponding to subscriptions on this
* plan. Note that each subscription may configure its own memo.
*/
default_invoice_memo: string | null;
description: string;
/**
* @deprecated
*/
discount: Shared.Discount | null;
/**
* An optional user-defined ID for this plan resource, used throughout the system
* as an alias for this Plan. Use this field to identify a plan by an existing
* identifier in your system.
*/
external_plan_id: string | null;
/**
* An ISO 4217 currency string for which this plan is billed in. Matches `currency`
* unless `currency` is a custom pricing unit.
*/
invoicing_currency: string;
/**
* @deprecated
*/
maximum: Shared.Maximum | null;
/**
* @deprecated
*/
maximum_amount: string | null;
/**
* User specified key-value pairs for the resource. If not present, this defaults
* to an empty dictionary. Individual keys can be removed by setting the value to
* `null`, and the entire metadata mapping can be cleared by setting `metadata` to
* `null`.
*/
metadata: {
[key: string]: string;
};
/**
* @deprecated
*/
minimum: Shared.Minimum | null;
/**
* @deprecated
*/
minimum_amount: string | null;
name: string;
/**
* Determines the difference between the invoice issue date and the due date. A
* value of "0" here signifies that invoices are due on issue, whereas a value of
* "30" means that the customer has a month to pay the invoice before its overdue.
* Note that individual subscriptions or invoices may set a different net terms
* configuration.
*/
net_terms: number | null;
plan_phases: Array<Plan.PlanPhase> | null;
/**
* Prices for this plan. If the plan has phases, this includes prices across all
* phases of the plan.
*/
prices: Array<Shared.Price>;
product: Plan.Product;
status: 'active' | 'archived' | 'draft';
trial_config: Plan.TrialConfig;
version: number;
}
export declare namespace Plan {
/**
* @deprecated Legacy field representing the parent plan if the current plan is a
* 'child plan', overriding prices from the parent.
*/
interface BasePlan {
id: string | null;
/**
* An optional user-defined ID for this plan resource, used throughout the system
* as an alias for this Plan. Use this field to identify a plan by an existing
* identifier in your system.
*/
external_plan_id: string | null;
name: string | null;
}
interface PlanPhase {
id: string;
description: string | null;
discount: Shared.Discount | null;
/**
* How many terms of length `duration_unit` this phase is active for. If null, this
* phase is evergreen and active indefinitely
*/
duration: number | null;
duration_unit: 'daily' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | null;
maximum: Shared.Maximum | null;
maximum_amount: string | null;
minimum: Shared.Minimum | null;
minimum_amount: string | null;
name: string;
/**
* Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
*/
order: number;
}
interface Product {
id: string;
created_at: string;
name: string;
}
interface TrialConfig {
trial_period: number | null;
trial_period_unit: 'days';
}
}
export interface PlanCreateParams {
/**
* An ISO 4217 currency string for invoices generated by subscriptions on this
* plan.
*/
currency: string;
name: string;
/**
* Prices for this plan. If the plan has phases, this includes prices across all
* phases of the plan.
*/
prices: Array<PlanCreateParams.Price>;
/**
* Adjustments for this plan. If the plan has phases, this includes adjustments
* across all phases of the plan.
*/
adjustments?: Array<PlanCreateParams.Adjustment> | null;
/**
* Free-form text which is available on the invoice PDF and the Orb invoice portal.
*/
default_invoice_memo?: string | null;
external_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?: {
[key: string]: string | null;
} | 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.
*/
net_terms?: number | null;
/**
* Configuration of pre-defined phases, each with their own prices and adjustments.
* Leave unspecified for plans with a single phase.
*/
plan_phases?: Array<PlanCreateParams.PlanPhase> | null;
/**
* The status of the plan to create (either active or draft). If not specified,
* this defaults to active.
*/
status?: 'active' | 'draft';
}
export declare namespace PlanCreateParams {
interface Price {
/**
* The allocation price to add to the plan.
*/
allocation_price?: Shared.NewAllocationPrice | null;
/**
* The license allocation price to add to the plan.
*/
license_allocation_price?: Price.NewLicenseAllocationUnitPrice | Price.NewLicenseAllocationTieredPrice | Price.NewLicenseAllocationBulkPrice | Price.NewLicenseAllocationBulkWithFiltersPrice | Price.NewLicenseAllocationPackagePrice | Price.NewLicenseAllocationMatrixPrice | Price.NewLicenseAllocationThresholdTotalAmountPrice | Price.NewLicenseAllocationTieredPackagePrice | Price.NewLicenseAllocationTieredWithMinimumPrice | Price.NewLicenseAllocationGroupedTieredPrice | Price.NewLicenseAllocationTieredPackageWithMinimumPrice | Price.NewLicenseAllocationPackageWithAllocationPrice | Price.NewLicenseAllocationUnitWithPercentPrice | Price.NewLicenseAllocationMatrixWithAllocationPrice | Price.NewLicenseAllocationTieredWithProrationPrice | Price.NewLicenseAllocationUnitWithProrationPrice | Price.NewLicenseAllocationGroupedAllocationPrice | Price.NewLicenseAllocationBulkWithProrationPrice | Price.NewLicenseAllocationGroupedWithProratedMinimumPrice | Price.NewLicenseAllocationGroupedWithMeteredMinimumPrice | Price.NewLicenseAllocationGroupedWithMinMaxThresholdsPrice | Price.NewLicenseAllocationMatrixWithDisplayNamePrice | Price.NewLicenseAllocationGroupedTieredPackagePrice | Price.NewLicenseAllocationMaxGroupTieredPackagePrice | Price.NewLicenseAllocationScalableMatrixWithUnitPricingPrice | Price.NewLicenseAllocationScalableMatrixWithTieredPricingPrice | Price.NewLicenseAllocationCumulativeGroupedBulkPrice | Price.NewLicenseAllocationCumulativeGroupedAllocationPrice | Price.NewLicenseAllocationMinimumCompositePrice | Price.NewLicenseAllocationPercentCompositePrice | Price.NewLicenseAllocationEventOutputPrice | null;
/**
* The phase to add this price to.
*/
plan_phase_order?: number | null;
/**
* New plan price request body params.
*/
price?: Shared.NewPlanUnitPrice | Shared.NewPlanTieredPrice | Shared.NewPlanBulkPrice | Price.NewPlanBulkWithFiltersPrice | Shared.NewPlanPackagePrice | Shared.NewPlanMatrixPrice | Shared.NewPlanThresholdTotalAmountPrice | Shared.NewPlanTieredPackagePrice | Shared.NewPlanTieredWithMinimumPrice | Shared.NewPlanGroupedTieredPrice | Shared.NewPlanTieredPackageWithMinimumPrice | Shared.NewPlanPackageWithAllocationPrice | Shared.NewPlanUnitWithPercentPrice | Shared.NewPlanMatrixWithAllocationPrice | Price.NewPlanTieredWithProrationPrice | Shared.NewPlanUnitWithProrationPrice | Shared.NewPlanGroupedAllocationPrice | Shared.NewPlanBulkWithProrationPrice | Shared.NewPlanGroupedWithProratedMinimumPrice | Shared.NewPlanGroupedWithMeteredMinimumPrice | Price.NewPlanGroupedWithMinMaxThresholdsPrice | Shared.NewPlanMatrixWithDisplayNamePrice | Shared.NewPlanGroupedTieredPackagePrice | Shared.NewPlanMaxGroupTieredPackagePrice | Shared.NewPlanScalableMatrixWithUnitPricingPrice | Shared.NewPlanScalableMatrixWithTieredPricingPrice | Shared.NewPlanCumulativeGroupedBulkPrice | Price.NewPlanCumulativeGroupedAllocationPrice | Shared.NewPlanMinimumCompositePrice | Price.NewPlanPercentCompositePrice | Price.NewPlanEventOutputPrice | null;
}
namespace Price {
interface NewLicenseAllocationUnitPrice {
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationUnitPrice.LicenseAllocation>;
/**
* The pricing model type
*/
model_type: 'unit';
/**
* The name of the price.
*/
name: string;
/**
* Configuration for unit pricing
*/
unit_config: Shared.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?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationUnitPrice {
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
}
interface NewLicenseAllocationTieredPrice {
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationTieredPrice.LicenseAllocation>;
/**
* The pricing model type
*/
model_type: 'tiered';
/**
* The name of the price.
*/
name: string;
/**
* Configuration for tiered pricing
*/
tiered_config: Shared.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?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationTieredPrice {
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
}
interface NewLicenseAllocationBulkPrice {
/**
* Configuration for bulk pricing
*/
bulk_config: Shared.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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationBulkPrice.LicenseAllocation>;
/**
* The pricing model type
*/
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?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationBulkPrice {
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
}
interface NewLicenseAllocationBulkWithFiltersPrice {
/**
* Configuration for bulk_with_filters pricing
*/
bulk_with_filters_config: NewLicenseAllocationBulkWithFiltersPrice.BulkWithFiltersConfig;
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationBulkWithFiltersPrice.LicenseAllocation>;
/**
* The pricing model type
*/
model_type: 'bulk_with_filters';
/**
* The name of the price.
*/
name: string;
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
*/
billable_metric_id?: string | null;
/**
* If the Price represents a fixed cost, the price will be billed in-advance if
* this is true, and in-arrears if this is false.
*/
billed_in_advance?: boolean | null;
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationBulkWithFiltersPrice {
/**
* Configuration for bulk_with_filters pricing
*/
interface BulkWithFiltersConfig {
/**
* Property filters to apply (all must match)
*/
filters: Array<BulkWithFiltersConfig.Filter>;
/**
* Bulk tiers for rating based on total usage volume
*/
tiers: Array<BulkWithFiltersConfig.Tier>;
}
namespace BulkWithFiltersConfig {
/**
* Configuration for a single property filter
*/
interface Filter {
/**
* Event property key to filter on
*/
property_key: string;
/**
* Event property value to match
*/
property_value: string;
}
/**
* Configuration for a single bulk pricing tier
*/
interface Tier {
/**
* Amount per unit
*/
unit_amount: string;
/**
* The lower bound for this tier
*/
tier_lower_bound?: string | null;
}
}
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
}
interface NewLicenseAllocationPackagePrice {
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationPackagePrice.LicenseAllocation>;
/**
* The pricing model type
*/
model_type: 'package';
/**
* The name of the price.
*/
name: string;
/**
* Configuration for package pricing
*/
package_config: Shared.PackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
*/
billable_metric_id?: string | null;
/**
* If the Price represents a fixed cost, the price will be billed in-advance if
* this is true, and in-arrears if this is false.
*/
billed_in_advance?: boolean | null;
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationPackagePrice {
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
}
interface NewLicenseAllocationMatrixPrice {
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationMatrixPrice.LicenseAllocation>;
/**
* Configuration for matrix pricing
*/
matrix_config: Shared.MatrixConfig;
/**
* The pricing model type
*/
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?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationMatrixPrice {
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
}
interface NewLicenseAllocationThresholdTotalAmountPrice {
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationThresholdTotalAmountPrice.LicenseAllocation>;
/**
* The pricing model type
*/
model_type: 'threshold_total_amount';
/**
* The name of the price.
*/
name: string;
/**
* Configuration for threshold_total_amount pricing
*/
threshold_total_amount_config: NewLicenseAllocationThresholdTotalAmountPrice.ThresholdTotalAmountConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
*/
billable_metric_id?: string | null;
/**
* If the Price represents a fixed cost, the price will be billed in-advance if
* this is true, and in-arrears if this is false.
*/
billed_in_advance?: boolean | null;
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.
*/
currency?: string | null;
/**
* For dimensional price: specifies a price group and dimension values
*/
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
/**
* An alias for the price.
*/
external_price_id?: string | null;
/**
* If the Price represents a fixed cost, this represents the quantity of units
* applied.
*/
fixed_price_quantity?: number | null;
/**
* The property used to group this price on an invoice
*/
invoice_grouping_key?: string | null;
/**
* Within each billing cycle, specifies the cadence at which invoices are produced.
* If unspecified, a single invoice is produced per billing cycle.
*/
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The ID of the license type to associate with this price.
*/
license_type_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?: {
[key: string]: string | null;
} | null;
/**
* A transient ID that can be used to reference this price when adding adjustments
* in the same API call.
*/
reference_id?: string | null;
}
namespace NewLicenseAllocationThresholdTotalAmountPrice {
interface LicenseAllocation {
/**
* The amount of credits granted per active license per cadence.
*/
amount: string;
/**
* The currency of the license allocation.
*/
currency: string;
/**
* When True, overage beyond the allocation is written off.
*/
write_off_overage?: boolean | null;
}
/**
* Configuration for threshold_total_amount pricing
*/
interface ThresholdTotalAmountConfig {
/**
* When the quantity consumed passes a provided threshold, the configured total
* will be charged
*/
consumption_table: Array<ThresholdTotalAmountConfig.ConsumptionTable>;
/**
* If true, the unit price will be prorated to the billing period
*/
prorate?: boolean | null;
}
namespace ThresholdTotalAmountConfig {
/**
* Configuration for a single threshold
*/
interface ConsumptionTable {
threshold: string;
/**
* Total amount for this threshold
*/
total_amount: string;
}
}
}
interface NewLicenseAllocationTieredPackagePrice {
/**
* 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;
/**
* License allocations to associate with this price. Each entry defines a
* per-license credit pool granted each cadence. Requires license_type_id or
* license_type_configuration to be set.
*/
license_allocations: Array<NewLicenseAllocationTieredPackagePrice.LicenseAllocation>;
/**
* The pricing model type
*/
model_type: 'tiered_package';
/**
* The name of the price.
*/
name: string;
/**
* Configuration for tiered_package pricing
*/
tiered_package_config: NewLicenseAllocationTieredPackagePrice.TieredPackageConfig;
/**
* The id of the billable metric for the price. Only needed if the price is
* usage-based.
*/
billable_metric_id?: string | null;
/**
* If the Price represents a fixed cost, the price will be billed in-advance if
* this is true, and in-arrears if this is false.
*/
billed_in_advance?: boolean | null;
/**
* For custom cadence: specifies the duration of the billing period in days or
* months.
*/
billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;
/**
* The configuration for the rate of the price currency to the invoicing currency.
*/
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
/**
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
* price is billed.