diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06c868a5..83b53019 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,18 @@ jobs: run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/orb-node' + if: |- + github.repository == 'stainless-sdks/orb-node' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/orb-node' + if: |- + github.repository == 'stainless-sdks/orb-node' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b6edec6..633fb4ef 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.44.0" + ".": "5.45.0" } diff --git a/.stats.yml b/.stats.yml index a6cf36af..438843fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 126 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-931771ff4ab183044ee50ce43ea794ac0a15bfafbaf7df61ac0344af3ff08944.yml -openapi_spec_hash: 71371804e373f662585284bf5d93cc62 -config_hash: bcf82bddb691f6be773ac6cae8c03b9a +configured_endpoints: 139 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d6a851f21804170f796637f1911c3382f1c57f5ed6b9b77cd7d0c6f74c06e174.yml +openapi_spec_hash: 82df33badf54d0c7087a61145d379f58 +config_hash: 3279841440b02d4e8303c961d6983492 diff --git a/CHANGELOG.md b/CHANGELOG.md index 600830bf..7fbaeee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## 5.45.0 (2026-03-07) + +Full Changelog: [v5.44.0...v5.45.0](https://github.com/orbcorp/orb-node/compare/v5.44.0...v5.45.0) + +### Features + +* **api:** api update ([fc0292b](https://github.com/orbcorp/orb-node/commit/fc0292bb065e65eba0010879df704f97b422ca41)) +* **api:** api update ([295182a](https://github.com/orbcorp/orb-node/commit/295182a5de863633a751117d261047c830bc499d)) +* **api:** api update ([4e98ace](https://github.com/orbcorp/orb-node/commit/4e98ace57d456ad4e77421ae74eab18ade208ce7)) +* **api:** api update ([bfe8270](https://github.com/orbcorp/orb-node/commit/bfe8270c1e7aaa297e8dc5258f0e9bc905f3a88a)) +* **api:** api update ([57b665f](https://github.com/orbcorp/orb-node/commit/57b665f8d62be71de028d9d2944cacabb41edfc8)) +* **api:** api update ([a8fe88d](https://github.com/orbcorp/orb-node/commit/a8fe88da2c64e76c8bff26161dc97a29f8110909)) +* **api:** api update ([c76b284](https://github.com/orbcorp/orb-node/commit/c76b2844ff044681670d98568efd179058783f6f)) +* **api:** api update ([720c5a3](https://github.com/orbcorp/orb-node/commit/720c5a3e0989b93ee36734ef09e7d3795fe3a2dc)) +* **api:** api update ([1ddb26c](https://github.com/orbcorp/orb-node/commit/1ddb26ca1c2f60891ef1a11a7a1182a8ea4483d3)) +* **api:** api update ([5476617](https://github.com/orbcorp/orb-node/commit/5476617ca804ee1de20da3f084b8d9d02ad7e361)) +* **api:** manual updates ([d6168c3](https://github.com/orbcorp/orb-node/commit/d6168c30d48d79be48dc074b8c61350354cdbe69)) + + +### Bug Fixes + +* **client:** preserve URL params already embedded in path ([ff159b3](https://github.com/orbcorp/orb-node/commit/ff159b3a11672e6cf9a9bd37df098b5373e7dd97)) +* **docs/contributing:** correct pnpm link command ([69cfdec](https://github.com/orbcorp/orb-node/commit/69cfdec7ae1c862e6430fedba7a1534257153054)) +* fix request delays for retrying to be more respectful of high requested delays ([e28e89e](https://github.com/orbcorp/orb-node/commit/e28e89e3828daee3333582f654b9811611027357)) + + +### Chores + +* **ci:** skip uploading artifacts on stainless-internal branches ([c0dc840](https://github.com/orbcorp/orb-node/commit/c0dc84020c1a346e76d23f474f847485c818a016)) +* **docs:** add missing descriptions ([bb3d420](https://github.com/orbcorp/orb-node/commit/bb3d420ec711c7783d7ebf84a3fc3188dafc65e2)) +* **docs:** remove www prefix ([37e00fc](https://github.com/orbcorp/orb-node/commit/37e00fc4e60ac1107d74b83a1d2057aad91d13b5)) +* **internal:** codegen related update ([43c7ba8](https://github.com/orbcorp/orb-node/commit/43c7ba830b0546c01132ae9a333f631186706ff7)) +* **internal:** codegen related update ([8128355](https://github.com/orbcorp/orb-node/commit/8128355f63538b59a5be56e67397b65a1ca560f9)) +* **internal:** move stringifyQuery implementation to internal function ([cd14352](https://github.com/orbcorp/orb-node/commit/cd1435211504da9a1c270636477b1dd60904d522)) +* **test:** do not count install time for mock server timeout ([352ee5f](https://github.com/orbcorp/orb-node/commit/352ee5fcb680e65bf7a5f65182f9ade565a45f4e)) +* update mock server docs ([7186ac0](https://github.com/orbcorp/orb-node/commit/7186ac06f4803670d98bc10c97ee5bfce1a0b7f3)) + ## 5.44.0 (2026-02-03) Full Changelog: [v5.43.0...v5.44.0](https://github.com/orbcorp/orb-node/compare/v5.43.0...v5.44.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 717743f3..22a49134 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ $ yarn link orb-billing # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global orb-billing +$ pnpm link --global orb-billing ``` ## Running tests @@ -68,7 +68,7 @@ $ pnpm link -—global orb-billing Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh diff --git a/api.md b/api.md index 5925d152..4b9c170e 100644 --- a/api.md +++ b/api.md @@ -355,6 +355,7 @@ Methods: Types: - InvoiceFetchUpcomingResponse +- InvoiceIssueSummaryResponse - InvoiceListSummaryResponse Methods: @@ -366,6 +367,7 @@ Methods: - client.invoices.fetch(invoiceId) -> Invoice - client.invoices.fetchUpcoming({ ...params }) -> InvoiceFetchUpcomingResponse - client.invoices.issue(invoiceId, { ...params }) -> Invoice +- client.invoices.issueSummary(invoiceId, { ...params }) -> InvoiceIssueSummaryResponse - client.invoices.listSummary({ ...params }) -> InvoiceListSummaryResponsesPage - client.invoices.markPaid(invoiceId, { ...params }) -> Invoice - client.invoices.pay(invoiceId) -> Invoice @@ -575,8 +577,64 @@ Methods: Types: - CreditBlockRetrieveResponse +- CreditBlockListInvoicesResponse Methods: - client.creditBlocks.retrieve(blockId) -> CreditBlockRetrieveResponse - client.creditBlocks.delete(blockId) -> void +- client.creditBlocks.listInvoices(blockId) -> CreditBlockListInvoicesResponse + +# LicenseTypes + +Types: + +- LicenseTypeCreateResponse +- LicenseTypeRetrieveResponse +- LicenseTypeListResponse + +Methods: + +- client.licenseTypes.create({ ...params }) -> LicenseTypeCreateResponse +- client.licenseTypes.retrieve(licenseTypeId) -> LicenseTypeRetrieveResponse +- client.licenseTypes.list({ ...params }) -> LicenseTypeListResponsesPage + +# Licenses + +Types: + +- LicenseCreateResponse +- LicenseRetrieveResponse +- LicenseListResponse +- LicenseDeactivateResponse +- LicenseRetrieveByExternalIDResponse + +Methods: + +- client.licenses.create({ ...params }) -> LicenseCreateResponse +- client.licenses.retrieve(licenseId) -> LicenseRetrieveResponse +- client.licenses.list({ ...params }) -> LicenseListResponsesPage +- client.licenses.deactivate(licenseId, { ...params }) -> LicenseDeactivateResponse +- client.licenses.retrieveByExternalId(externalLicenseId, { ...params }) -> LicenseRetrieveByExternalIDResponse + +## ExternalLicenses + +Types: + +- ExternalLicenseGetUsageResponse + +Methods: + +- client.licenses.externalLicenses.getUsage(externalLicenseId, { ...params }) -> ExternalLicenseGetUsageResponse + +## Usage + +Types: + +- UsageGetAllUsageResponse +- UsageGetUsageResponse + +Methods: + +- client.licenses.usage.getAllUsage({ ...params }) -> UsageGetAllUsageResponse +- client.licenses.usage.getUsage(licenseId, { ...params }) -> UsageGetUsageResponse diff --git a/package.json b/package.json index ea6a6c42..e030f609 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "5.44.0", + "version": "5.45.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/scripts/mock b/scripts/mock index 0b28f6ea..bcf3b392 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - # Wait for server to come online + # Wait for server to come online (max 30s) echo -n "Waiting for server" + attempts=0 while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Prism server to start" + cat .prism.log + exit 1 + fi echo -n "." sleep 0.1 done diff --git a/src/core.ts b/src/core.ts index 961aff1f..c18ac5c4 100644 --- a/src/core.ts +++ b/src/core.ts @@ -6,6 +6,7 @@ import { APIConnectionTimeoutError, APIUserAbortError, } from './error'; +import { stringifyQuery } from './internal/utils/query'; import { kind as shimsKind, type Readable, @@ -523,32 +524,20 @@ export abstract class APIClient { : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query } as Req; + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query } as Req; } if (typeof query === 'object' && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query as Record); + url.search = this.stringifyQuery(query); } return url.toString(); } - protected stringifyQuery(query: Record): string { - return Object.entries(query) - .filter(([_, value]) => typeof value !== 'undefined') - .map(([key, value]) => { - if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - if (value === null) { - return `${encodeURIComponent(key)}=`; - } - throw new OrbError( - `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, - ); - }) - .join('&'); + protected stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } async fetchWithTimeout( @@ -630,9 +619,9 @@ export abstract class APIClient { } } - // If the API asks us to wait a certain amount of time (and it's a reasonable amount), - // just do what it says, but otherwise calculate a default - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) { + // If the API asks us to wait a certain amount of time, do what it says. + // Otherwise calculate a default. + if (timeoutMillis === undefined) { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } diff --git a/src/index.ts b/src/index.ts index 1b264f79..b2ecc854 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { type Agent } from './_shims/index'; -import * as qs from './internal/qs'; +import { stringifyQuery } from './internal/utils/query'; import * as Core from './core'; import * as Errors from './error'; import * as Pagination from './pagination'; @@ -21,7 +21,11 @@ import { AlertsPage, Threshold, } from './resources/alerts'; -import { CreditBlockRetrieveResponse, CreditBlocks } from './resources/credit-blocks'; +import { + CreditBlockListInvoicesResponse, + CreditBlockRetrieveResponse, + CreditBlocks, +} from './resources/credit-blocks'; import { CreditNoteCreateParams, CreditNoteListParams, CreditNotes } from './resources/credit-notes'; import { InvoiceLineItemCreateParams, @@ -33,6 +37,8 @@ import { InvoiceFetchUpcomingParams, InvoiceFetchUpcomingResponse, InvoiceIssueParams, + InvoiceIssueSummaryParams, + InvoiceIssueSummaryResponse, InvoiceListParams, InvoiceListSummaryParams, InvoiceListSummaryResponse, @@ -49,6 +55,15 @@ import { Items, ItemsPage, } from './resources/items'; +import { + LicenseTypeCreateParams, + LicenseTypeCreateResponse, + LicenseTypeListParams, + LicenseTypeListResponse, + LicenseTypeListResponsesPage, + LicenseTypeRetrieveResponse, + LicenseTypes, +} from './resources/license-types'; import { BillableMetric, BillableMetricsPage, @@ -167,6 +182,19 @@ import { EventUpdateResponse, Events, } from './resources/events/events'; +import { + LicenseCreateParams, + LicenseCreateResponse, + LicenseDeactivateParams, + LicenseDeactivateResponse, + LicenseListParams, + LicenseListResponse, + LicenseListResponsesPage, + LicenseRetrieveByExternalIDParams, + LicenseRetrieveByExternalIDResponse, + LicenseRetrieveResponse, + Licenses, +} from './resources/licenses/licenses'; import { Plan, PlanCreateParams, @@ -317,23 +345,105 @@ export class Orb extends Core.APIClient { } topLevel: API.TopLevel = new API.TopLevel(this); + /** + * 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). + */ beta: API.Beta = new API.Beta(this); + /** + * A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users. + */ coupons: API.Coupons = new API.Coupons(this); + /** + * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + * particular invoice. + */ creditNotes: API.CreditNotes = new API.CreditNotes(this); + /** + * A customer is a buyer of your products, and the other party to the billing relationship. + * + * In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these + * match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an + * `external_customer_id` with your own identifier. See + * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these + * aliases work in Orb. + * + * In addition to having an identifier in your system, a customer may exist in a payment provider solution like + * Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping. + * + * A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which + * defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for + * information on what this timezone parameter influences within Orb. + */ customers: API.Customers = new API.Customers(this); + /** + * The [Event](/core-concepts#event) resource represents a usage event that has been created for a + * customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for + * a given billing period. + */ events: API.Events = new API.Events(this); + /** + * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for + * a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and + * can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as + * the result of an action, such as a cancellation. + */ invoiceLineItems: API.InvoiceLineItems = new API.InvoiceLineItems(this); + /** + * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for + * a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and + * can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as + * the result of an action, such as a cancellation. + */ invoices: API.Invoices = new API.Invoices(this); + /** + * The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics, + * and prices and are used for defining external sync behavior for invoices and tax calculation purposes. + */ items: API.Items = new API.Items(this); + /** + * The Metric resource represents a calculation of a quantity based on events. + * Metrics are defined by the query that transforms raw usage events into meaningful values for your customers. + */ metrics: API.Metrics = new API.Metrics(this); + /** + * 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). + */ plans: API.Plans = new API.Plans(this); + /** + * The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + * the form of an invoice line item. Prices take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + * given Price object. The model_type field determines the key for the configuration object that is present. + * + * For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + */ prices: API.Prices = new API.Prices(this); subscriptions: API.Subscriptions = new API.Subscriptions(this); webhooks: API.Webhooks = new API.Webhooks(this); + /** + * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, + * usage, or credit balance and trigger webhooks when a threshold is exceeded. + * + * Alerts created through the API can be scoped to either customers or subscriptions. + */ alerts: API.Alerts = new API.Alerts(this); dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this); subscriptionChanges: API.SubscriptionChanges = new API.SubscriptionChanges(this); + /** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + */ creditBlocks: API.CreditBlocks = new API.CreditBlocks(this); + /** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ + licenseTypes: API.LicenseTypes = new API.LicenseTypes(this); + licenses: API.Licenses = new API.Licenses(this); /** * Check whether the base URL is set to its default. @@ -357,8 +467,8 @@ export class Orb extends Core.APIClient { return { Authorization: `Bearer ${this.apiKey}` }; } - protected override stringifyQuery(query: Record): string { - return qs.stringify(query, { arrayFormat: 'brackets' }); + protected override stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } static Orb = this; @@ -420,6 +530,10 @@ Orb.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage; Orb.SubscriptionChanges = SubscriptionChanges; Orb.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage; Orb.CreditBlocks = CreditBlocks; +Orb.LicenseTypes = LicenseTypes; +Orb.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage; +Orb.Licenses = Licenses; +Orb.LicenseListResponsesPage = LicenseListResponsesPage; export declare namespace Orb { export type RequestOptions = Core.RequestOptions; @@ -489,6 +603,7 @@ export declare namespace Orb { export { Invoices as Invoices, type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, + type InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse, type InvoiceListSummaryResponse as InvoiceListSummaryResponse, InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage, type InvoiceCreateParams as InvoiceCreateParams, @@ -496,6 +611,7 @@ export declare namespace Orb { type InvoiceListParams as InvoiceListParams, type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams, type InvoiceIssueParams as InvoiceIssueParams, + type InvoiceIssueSummaryParams as InvoiceIssueSummaryParams, type InvoiceListSummaryParams as InvoiceListSummaryParams, type InvoiceMarkPaidParams as InvoiceMarkPaidParams, }; @@ -626,7 +742,35 @@ export declare namespace Orb { type SubscriptionChangeApplyParams as SubscriptionChangeApplyParams, }; - export { CreditBlocks as CreditBlocks, type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse }; + export { + CreditBlocks as CreditBlocks, + type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse, + type CreditBlockListInvoicesResponse as CreditBlockListInvoicesResponse, + }; + + export { + LicenseTypes as LicenseTypes, + type LicenseTypeCreateResponse as LicenseTypeCreateResponse, + type LicenseTypeRetrieveResponse as LicenseTypeRetrieveResponse, + type LicenseTypeListResponse as LicenseTypeListResponse, + LicenseTypeListResponsesPage as LicenseTypeListResponsesPage, + type LicenseTypeCreateParams as LicenseTypeCreateParams, + type LicenseTypeListParams as LicenseTypeListParams, + }; + + export { + Licenses as Licenses, + type LicenseCreateResponse as LicenseCreateResponse, + type LicenseRetrieveResponse as LicenseRetrieveResponse, + type LicenseListResponse as LicenseListResponse, + type LicenseDeactivateResponse as LicenseDeactivateResponse, + type LicenseRetrieveByExternalIDResponse as LicenseRetrieveByExternalIDResponse, + LicenseListResponsesPage as LicenseListResponsesPage, + type LicenseCreateParams as LicenseCreateParams, + type LicenseListParams as LicenseListParams, + type LicenseDeactivateParams as LicenseDeactivateParams, + type LicenseRetrieveByExternalIDParams as LicenseRetrieveByExternalIDParams, + }; export type Address = API.Address; export type AdjustmentInterval = API.AdjustmentInterval; diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts new file mode 100644 index 00000000..f7d1b4b2 --- /dev/null +++ b/src/internal/utils/query.ts @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import * as qs from '../qs/stringify'; + +export function stringifyQuery(query: object | Record) { + return qs.stringify(query, { arrayFormat: 'brackets' }); +} diff --git a/src/resources/alerts.ts b/src/resources/alerts.ts index 7e3ab7c9..cb4617d8 100644 --- a/src/resources/alerts.ts +++ b/src/resources/alerts.ts @@ -6,6 +6,12 @@ import * as Core from '../core'; import * as Shared from './shared'; import { Page, type PageParams } from '../pagination'; +/** + * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, + * usage, or credit balance and trigger webhooks when a threshold is exceeded. + * + * Alerts created through the API can be scoped to either customers or subscriptions. + */ export class Alerts extends APIResource { /** * This endpoint retrieves an alert by its ID. @@ -233,6 +239,12 @@ export interface Alert { */ balance_alert_status?: Array | null; + /** + * The property keys to group cost alerts by. Only present for cost alerts with + * grouping enabled. + */ + grouping_keys?: Array | null; + /** * Minified license type for alert serialization. */ @@ -378,10 +390,22 @@ export interface AlertCreateForSubscriptionParams { */ type: 'usage_exceeded' | 'cost_exceeded'; + /** + * The property keys to group cost alerts by. Only applicable for cost_exceeded + * alerts. + */ + grouping_keys?: Array | null; + /** * The metric to track usage for. */ metric_id?: string | null; + + /** + * The pricing unit to use for grouped cost alerts. Required when grouping_keys is + * set. + */ + pricing_unit_id?: string | null; } export interface AlertDisableParams { diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index 87dba090..77890eda 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -11,6 +11,11 @@ import { } from './external-plan-id'; import * as PlansAPI from '../plans/plans'; +/** + * 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 class Beta extends APIResource { externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client); @@ -166,6 +171,43 @@ export namespace BetaCreatePlanVersionParams { */ allocation_price?: Shared.NewAllocationPrice | null; + /** + * The license allocation price to add to the plan. + */ + license_allocation_price?: + | AddPrice.NewLicenseAllocationUnitPrice + | AddPrice.NewLicenseAllocationTieredPrice + | AddPrice.NewLicenseAllocationBulkPrice + | AddPrice.NewLicenseAllocationBulkWithFiltersPrice + | AddPrice.NewLicenseAllocationPackagePrice + | AddPrice.NewLicenseAllocationMatrixPrice + | AddPrice.NewLicenseAllocationThresholdTotalAmountPrice + | AddPrice.NewLicenseAllocationTieredPackagePrice + | AddPrice.NewLicenseAllocationTieredWithMinimumPrice + | AddPrice.NewLicenseAllocationGroupedTieredPrice + | AddPrice.NewLicenseAllocationTieredPackageWithMinimumPrice + | AddPrice.NewLicenseAllocationPackageWithAllocationPrice + | AddPrice.NewLicenseAllocationUnitWithPercentPrice + | AddPrice.NewLicenseAllocationMatrixWithAllocationPrice + | AddPrice.NewLicenseAllocationTieredWithProrationPrice + | AddPrice.NewLicenseAllocationUnitWithProrationPrice + | AddPrice.NewLicenseAllocationGroupedAllocationPrice + | AddPrice.NewLicenseAllocationBulkWithProrationPrice + | AddPrice.NewLicenseAllocationGroupedWithProratedMinimumPrice + | AddPrice.NewLicenseAllocationGroupedWithMeteredMinimumPrice + | AddPrice.NewLicenseAllocationGroupedWithMinMaxThresholdsPrice + | AddPrice.NewLicenseAllocationMatrixWithDisplayNamePrice + | AddPrice.NewLicenseAllocationGroupedTieredPackagePrice + | AddPrice.NewLicenseAllocationMaxGroupTieredPackagePrice + | AddPrice.NewLicenseAllocationScalableMatrixWithUnitPricingPrice + | AddPrice.NewLicenseAllocationScalableMatrixWithTieredPricingPrice + | AddPrice.NewLicenseAllocationCumulativeGroupedBulkPrice + | AddPrice.NewLicenseAllocationCumulativeGroupedAllocationPrice + | AddPrice.NewLicenseAllocationMinimumCompositePrice + | AddPrice.NewLicenseAllocationPercentCompositePrice + | AddPrice.NewLicenseAllocationEventOutputPrice + | null; + /** * The phase to add this price to. */ @@ -210,12 +252,7 @@ export namespace BetaCreatePlanVersionParams { } export namespace AddPrice { - export interface NewPlanBulkWithFiltersPrice { - /** - * Configuration for bulk_with_filters pricing - */ - bulk_with_filters_config: NewPlanBulkWithFiltersPrice.BulkWithFiltersConfig; - + export interface NewLicenseAllocationUnitPrice { /** * The cadence to bill for this price on. */ @@ -226,16 +263,28 @@ export namespace BetaCreatePlanVersionParams { */ 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; + /** * The pricing model type */ - model_type: 'bulk_with_filters'; + 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. @@ -297,6 +346,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -311,56 +365,163 @@ export namespace BetaCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanBulkWithFiltersPrice { - /** - * Configuration for bulk_with_filters pricing - */ - export interface BulkWithFiltersConfig { + export namespace NewLicenseAllocationUnitPrice { + export interface LicenseAllocation { /** - * Property filters to apply (all must match) + * The amount of credits granted per active license per cadence. */ - filters: Array; + amount: string; /** - * Bulk tiers for rating based on total usage volume + * The currency of the license allocation. */ - tiers: Array; - } + currency: string; - export namespace BulkWithFiltersConfig { /** - * Configuration for a single property filter + * When True, overage beyond the allocation is written off. */ - export interface Filter { - /** - * Event property key to filter on - */ - property_key: string; + write_off_overage?: boolean | null; + } + } - /** - * Event property value to match - */ - property_value: string; - } + export 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; + + /** + * 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; + } + export namespace NewLicenseAllocationTieredPrice { + export interface LicenseAllocation { /** - * Configuration for a single bulk pricing tier + * The amount of credits granted per active license per cadence. */ - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; + amount: string; - /** - * The lower bound for this tier - */ - tier_lower_bound?: string | null; - } + /** + * The currency of the license allocation. + */ + currency: string; + + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; } } - export interface NewPlanTieredWithProrationPrice { + export interface NewLicenseAllocationBulkPrice { + /** + * Configuration for bulk pricing + */ + bulk_config: Shared.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -371,10 +532,17 @@ export namespace BetaCreatePlanVersionParams { */ 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; + /** * The pricing model type */ - model_type: 'tiered_with_proration'; + model_type: 'bulk'; /** * The name of the price. @@ -382,9 +550,9530 @@ export namespace BetaCreatePlanVersionParams { name: string; /** - * Configuration for tiered_with_proration pricing + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig; + 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; + } + + export namespace NewLicenseAllocationBulkPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackagePrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationThresholdTotalAmountPrice { + export 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 + */ + export interface ThresholdTotalAmountConfig { + /** + * When the quantity consumed passes a provided threshold, the configured total + * will be charged + */ + consumption_table: Array; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + } + + export namespace ThresholdTotalAmountConfig { + /** + * Configuration for a single threshold + */ + export interface ConsumptionTable { + threshold: string; + + /** + * Total amount for this threshold + */ + total_amount: string; + } + } + } + + export 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; + + /** + * 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. + */ + 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; + } + + export namespace NewLicenseAllocationTieredPackagePrice { + export 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 tiered_package pricing + */ + export interface TieredPackageConfig { + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. The tier bounds are defined based on + * the total quantity rather than the number of packages, so they must be multiples + * of the package size. + */ + tiers: Array; + } + + export namespace TieredPackageConfig { + /** + * Configuration for a single tier with business logic + */ + export interface Tier { + /** + * Price per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationTieredWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_minimum pricing + */ + tiered_with_minimum_config: NewLicenseAllocationTieredWithMinimumPrice.TieredWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithMinimumPrice { + export 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 tiered_with_minimum pricing + */ + export interface TieredWithMinimumConfig { + /** + * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + * defined using exclusive lower bounds. + */ + tiers: Array; + + /** + * If true, tiers with an accrued amount of 0 will not be included in the rating. + */ + hide_zero_amount_tiers?: boolean; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean; + } + + export namespace TieredWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered pricing + */ + grouped_tiered_config: NewLicenseAllocationGroupedTieredPrice.GroupedTieredConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPrice { + /** + * Configuration for grouped_tiered pricing + */ + export interface GroupedTieredConfig { + /** + * The billable metric property used to group before tiering + */ + grouping_key: string; + + /** + * Apply tiered pricing to each segment generated after grouping with the provided + * key + */ + tiers: Array; + } + + export namespace GroupedTieredConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationTieredPackageWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_package_with_minimum pricing + */ + tiered_package_with_minimum_config: NewLicenseAllocationTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPackageWithMinimumPrice { + export 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 tiered_package_with_minimum pricing + */ + export interface TieredPackageWithMinimumConfig { + package_size: number; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace TieredPackageWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationPackageWithAllocationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for package_with_allocation pricing + */ + package_with_allocation_config: NewLicenseAllocationPackageWithAllocationPrice.PackageWithAllocationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackageWithAllocationPrice { + export 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 package_with_allocation pricing + */ + export interface PackageWithAllocationConfig { + allocation: string; + + package_amount: string; + + package_size: string; + } + } + + export interface NewLicenseAllocationUnitWithPercentPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_percent pricing + */ + unit_with_percent_config: NewLicenseAllocationUnitWithPercentPrice.UnitWithPercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithPercentPrice { + export 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 unit_with_percent pricing + */ + export interface UnitWithPercentConfig { + /** + * What percent, out of 100, of the calculated total to charge + */ + percent: string; + + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationMatrixWithAllocationPrice { + /** + * 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; + + /** + * Configuration for matrix_with_allocation pricing + */ + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixWithAllocationPrice { + export 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; + } + } + + export interface NewLicenseAllocationTieredWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewLicenseAllocationTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithProrationPrice { + export 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 tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationUnitWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_proration pricing + */ + unit_with_proration_config: NewLicenseAllocationUnitWithProrationPrice.UnitWithProrationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithProrationPrice { + export 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 unit_with_proration pricing + */ + export interface UnitWithProrationConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_allocation pricing + */ + grouped_allocation_config: NewLicenseAllocationGroupedAllocationPrice.GroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedAllocationPrice { + /** + * Configuration for grouped_allocation pricing + */ + export interface GroupedAllocationConfig { + /** + * Usage allocation per group + */ + allocation: string; + + /** + * How to determine the groups that should each be allocated some quantity + */ + grouping_key: string; + + /** + * Unit rate for post-allocation + */ + overage_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + bulk_with_proration_config: NewLicenseAllocationBulkWithProrationPrice.BulkWithProrationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + export interface BulkWithProrationConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithProrationConfig { + /** + * Configuration for a single bulk pricing tier with proration + */ + export interface Tier { + /** + * Cost per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + grouped_with_prorated_minimum_config: NewLicenseAllocationGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + export interface GroupedWithProratedMinimumConfig { + /** + * How to determine the groups that should each have a minimum + */ + grouping_key: string; + + /** + * The minimum amount to charge per group + */ + minimum: string; + + /** + * The amount to charge per unit + */ + unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_metered_minimum pricing + */ + grouped_with_metered_minimum_config: NewLicenseAllocationGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * Configuration for grouped_with_metered_minimum pricing + */ + export interface GroupedWithMeteredMinimumConfig { + /** + * Used to partition the usage into groups. The minimum amount is applied to each + * group. + */ + grouping_key: string; + + /** + * The minimum amount to charge per group per unit + */ + minimum_unit_amount: string; + + /** + * Used to determine the unit rate + */ + pricing_key: string; + + /** + * Scale the unit rates by the scaling factor. + */ + scaling_factors: Array; + + /** + * Used to determine the unit rate scaling factor + */ + scaling_key: string; + + /** + * Apply per unit pricing to each pricing value. The minimum amount is applied any + * unmatched usage. + */ + unit_amounts: Array; + } + + export namespace GroupedWithMeteredMinimumConfig { + /** + * Configuration for a scaling factor + */ + export interface ScalingFactor { + scaling_factor: string; + + scaling_value: string; + } + + /** + * Configuration for a unit amount + */ + export interface UnitAmount { + pricing_value: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewLicenseAllocationGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationMatrixWithDisplayNamePrice { + /** + * 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; + + /** + * Configuration for matrix_with_display_name pricing + */ + matrix_with_display_name_config: NewLicenseAllocationMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationMatrixWithDisplayNamePrice { + export 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 matrix_with_display_name pricing + */ + export interface MatrixWithDisplayNameConfig { + /** + * Used to determine the unit rate + */ + dimension: string; + + /** + * Apply per unit pricing to each dimension value + */ + unit_amounts: Array; + } + + export namespace MatrixWithDisplayNameConfig { + /** + * Configuration for a unit amount item + */ + export interface UnitAmount { + /** + * The dimension value + */ + dimension_value: string; + + /** + * Display name for this dimension value + */ + display_name: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered_package pricing + */ + grouped_tiered_package_config: NewLicenseAllocationGroupedTieredPackagePrice.GroupedTieredPackageConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPackagePrice { + /** + * Configuration for grouped_tiered_package pricing + */ + export interface GroupedTieredPackageConfig { + /** + * The event property used to group before tiering + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace GroupedTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + /** + * Per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationMaxGroupTieredPackagePrice { + /** + * 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; + + /** + * Configuration for max_group_tiered_package pricing + */ + max_group_tiered_package_config: NewLicenseAllocationMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig; + + /** + * The pricing model type + */ + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationMaxGroupTieredPackagePrice { + export 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 max_group_tiered_package pricing + */ + export interface MaxGroupTieredPackageConfig { + /** + * The event property used to group before tiering the group with the highest value + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing to the largest group after grouping with the provided key. + */ + tiers: Array; + } + + export namespace MaxGroupTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_unit_pricing pricing + */ + scalable_matrix_with_unit_pricing_config: NewLicenseAllocationScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + export 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 scalable_matrix_with_unit_pricing pricing + */ + export interface ScalableMatrixWithUnitPricingConfig { + /** + * Used to determine the unit rate + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + /** + * The final unit price to rate against the output of the matrix + */ + unit_price: string; + + /** + * The property used to group this price + */ + grouping_key?: string | null; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + + /** + * Used to determine the unit rate (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithUnitPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_tiered_pricing pricing + */ + scalable_matrix_with_tiered_pricing_config: NewLicenseAllocationScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + export 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 scalable_matrix_with_tiered_pricing pricing + */ + export interface ScalableMatrixWithTieredPricingConfig { + /** + * Used for the scalable matrix first dimension + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + tiers: Array; + + /** + * Used for the scalable matrix second dimension (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithTieredPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + + /** + * Configuration for a single tier entry with business logic + */ + export interface Tier { + tier_lower_bound: string; + + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_bulk pricing + */ + cumulative_grouped_bulk_config: NewLicenseAllocationCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * Configuration for cumulative_grouped_bulk pricing + */ + export interface CumulativeGroupedBulkConfig { + /** + * Each tier lower bound must have the same group of values. + */ + dimension_values: Array; + + group: string; + } + + export namespace CumulativeGroupedBulkConfig { + /** + * Configuration for a dimension value entry + */ + export interface DimensionValue { + /** + * Grouping key value + */ + grouping_key: string; + + /** + * Tier lower bound + */ + tier_lower_bound: string; + + /** + * Unit amount for this combination + */ + unit_amount: string; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewLicenseAllocationCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'cumulative_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?: 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; + } + + export namespace NewLicenseAllocationCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations + */ + grouping_key: string; + + /** + * The amount to charge for each unit outside of the allocation + */ + unit_amount: string; + } + + export 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; + } + } + + export interface NewLicenseAllocationMinimumCompositePrice { + /** + * 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; + + /** + * Configuration for minimum_composite pricing + */ + minimum_composite_config: NewLicenseAllocationMinimumCompositePrice.MinimumCompositeConfig; + + /** + * The pricing model type + */ + model_type: 'minimum_composite'; + + /** + * 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; + } + + export namespace NewLicenseAllocationMinimumCompositePrice { + export 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 minimum_composite pricing + */ + export interface MinimumCompositeConfig { + /** + * The minimum amount to apply + */ + minimum_amount: string; + + /** + * If true, subtotals from this price are prorated based on the service period + */ + prorated?: boolean; + } + } + + export interface NewLicenseAllocationPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewLicenseAllocationPercentCompositePrice.PercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPercentCompositePrice { + export 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 percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewLicenseAllocationEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewLicenseAllocationEventOutputPrice.EventOutputConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + } + + export namespace NewLicenseAllocationEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * If provided, this amount will be used as the unit rate when an event does not + * have a value for the `unit_rating_key`. If not provided, events missing a unit + * rate will be ignored. + */ + default_unit_rate?: string | null; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + + export 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; + } + } + + export interface NewPlanBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + bulk_with_filters_config: NewPlanBulkWithFiltersPrice.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; + + /** + * 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; + } + + export namespace NewPlanBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + } + + export interface NewPlanTieredWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewPlanTieredWithProrationPrice { + /** + * Configuration for tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewPlanGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * 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; + } + + export namespace NewPlanGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + } + + export interface NewPlanCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewPlanCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'cumulative_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?: 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; + } + + export namespace NewPlanCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations + */ + grouping_key: string; + + /** + * The amount to charge for each unit outside of the allocation + */ + unit_amount: string; + } + } + + export interface NewPlanPercentCompositePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + } + + export namespace NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + } + + export namespace NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * If provided, this amount will be used as the unit rate when an event does not + * have a value for the `unit_rating_key`. If not provided, events missing a unit + * rate will be ignored. + */ + default_unit_rate?: string | null; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } + } + + export interface RemoveAdjustment { + /** + * The id of the adjustment to remove from on the plan. + */ + adjustment_id: string; + + /** + * The phase to remove this adjustment from. + */ + plan_phase_order?: number | null; + } + + export interface RemovePrice { + /** + * The id of the price to remove from the plan. + */ + price_id: string; + + /** + * The phase to remove this price from. + */ + plan_phase_order?: number | null; + } + + export interface ReplaceAdjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; + + /** + * The id of the adjustment on the plan to replace in the plan. + */ + replaces_adjustment_id: string; + + /** + * The phase to replace this adjustment from. + */ + plan_phase_order?: number | null; + } + + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the plan. + */ + replaces_price_id: string; + + /** + * The allocation price to add to the plan. + */ + allocation_price?: Shared.NewAllocationPrice | null; + + /** + * The license allocation price to add to the plan. + */ + license_allocation_price?: + | ReplacePrice.NewLicenseAllocationUnitPrice + | ReplacePrice.NewLicenseAllocationTieredPrice + | ReplacePrice.NewLicenseAllocationBulkPrice + | ReplacePrice.NewLicenseAllocationBulkWithFiltersPrice + | ReplacePrice.NewLicenseAllocationPackagePrice + | ReplacePrice.NewLicenseAllocationMatrixPrice + | ReplacePrice.NewLicenseAllocationThresholdTotalAmountPrice + | ReplacePrice.NewLicenseAllocationTieredPackagePrice + | ReplacePrice.NewLicenseAllocationTieredWithMinimumPrice + | ReplacePrice.NewLicenseAllocationGroupedTieredPrice + | ReplacePrice.NewLicenseAllocationTieredPackageWithMinimumPrice + | ReplacePrice.NewLicenseAllocationPackageWithAllocationPrice + | ReplacePrice.NewLicenseAllocationUnitWithPercentPrice + | ReplacePrice.NewLicenseAllocationMatrixWithAllocationPrice + | ReplacePrice.NewLicenseAllocationTieredWithProrationPrice + | ReplacePrice.NewLicenseAllocationUnitWithProrationPrice + | ReplacePrice.NewLicenseAllocationGroupedAllocationPrice + | ReplacePrice.NewLicenseAllocationBulkWithProrationPrice + | ReplacePrice.NewLicenseAllocationGroupedWithProratedMinimumPrice + | ReplacePrice.NewLicenseAllocationGroupedWithMeteredMinimumPrice + | ReplacePrice.NewLicenseAllocationGroupedWithMinMaxThresholdsPrice + | ReplacePrice.NewLicenseAllocationMatrixWithDisplayNamePrice + | ReplacePrice.NewLicenseAllocationGroupedTieredPackagePrice + | ReplacePrice.NewLicenseAllocationMaxGroupTieredPackagePrice + | ReplacePrice.NewLicenseAllocationScalableMatrixWithUnitPricingPrice + | ReplacePrice.NewLicenseAllocationScalableMatrixWithTieredPricingPrice + | ReplacePrice.NewLicenseAllocationCumulativeGroupedBulkPrice + | ReplacePrice.NewLicenseAllocationCumulativeGroupedAllocationPrice + | ReplacePrice.NewLicenseAllocationMinimumCompositePrice + | ReplacePrice.NewLicenseAllocationPercentCompositePrice + | ReplacePrice.NewLicenseAllocationEventOutputPrice + | null; + + /** + * The phase to replace this price from. + */ + plan_phase_order?: number | null; + + /** + * New plan price request body params. + */ + price?: + | Shared.NewPlanUnitPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanBulkPrice + | ReplacePrice.NewPlanBulkWithFiltersPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanGroupedTieredPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanMatrixWithAllocationPrice + | ReplacePrice.NewPlanTieredWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | ReplacePrice.NewPlanCumulativeGroupedAllocationPrice + | Shared.NewPlanMinimumCompositePrice + | ReplacePrice.NewPlanPercentCompositePrice + | ReplacePrice.NewPlanEventOutputPrice + | null; + } + + export namespace ReplacePrice { + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationBulkPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackagePrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationThresholdTotalAmountPrice { + export 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 + */ + export interface ThresholdTotalAmountConfig { + /** + * When the quantity consumed passes a provided threshold, the configured total + * will be charged + */ + consumption_table: Array; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + } + + export namespace ThresholdTotalAmountConfig { + /** + * Configuration for a single threshold + */ + export interface ConsumptionTable { + threshold: string; + + /** + * Total amount for this threshold + */ + total_amount: string; + } + } + } + + export 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; + + /** + * 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. + */ + 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; + } + + export namespace NewLicenseAllocationTieredPackagePrice { + export 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 tiered_package pricing + */ + export interface TieredPackageConfig { + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. The tier bounds are defined based on + * the total quantity rather than the number of packages, so they must be multiples + * of the package size. + */ + tiers: Array; + } + + export namespace TieredPackageConfig { + /** + * Configuration for a single tier with business logic + */ + export interface Tier { + /** + * Price per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationTieredWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_minimum pricing + */ + tiered_with_minimum_config: NewLicenseAllocationTieredWithMinimumPrice.TieredWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithMinimumPrice { + export 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 tiered_with_minimum pricing + */ + export interface TieredWithMinimumConfig { + /** + * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + * defined using exclusive lower bounds. + */ + tiers: Array; + + /** + * If true, tiers with an accrued amount of 0 will not be included in the rating. + */ + hide_zero_amount_tiers?: boolean; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean; + } + + export namespace TieredWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered pricing + */ + grouped_tiered_config: NewLicenseAllocationGroupedTieredPrice.GroupedTieredConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPrice { + /** + * Configuration for grouped_tiered pricing + */ + export interface GroupedTieredConfig { + /** + * The billable metric property used to group before tiering + */ + grouping_key: string; + + /** + * Apply tiered pricing to each segment generated after grouping with the provided + * key + */ + tiers: Array; + } + + export namespace GroupedTieredConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationTieredPackageWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_package_with_minimum pricing + */ + tiered_package_with_minimum_config: NewLicenseAllocationTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPackageWithMinimumPrice { + export 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 tiered_package_with_minimum pricing + */ + export interface TieredPackageWithMinimumConfig { + package_size: number; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace TieredPackageWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationPackageWithAllocationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for package_with_allocation pricing + */ + package_with_allocation_config: NewLicenseAllocationPackageWithAllocationPrice.PackageWithAllocationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackageWithAllocationPrice { + export 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 package_with_allocation pricing + */ + export interface PackageWithAllocationConfig { + allocation: string; + + package_amount: string; + + package_size: string; + } + } + + export interface NewLicenseAllocationUnitWithPercentPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_percent pricing + */ + unit_with_percent_config: NewLicenseAllocationUnitWithPercentPrice.UnitWithPercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithPercentPrice { + export 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 unit_with_percent pricing + */ + export interface UnitWithPercentConfig { + /** + * What percent, out of 100, of the calculated total to charge + */ + percent: string; + + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationMatrixWithAllocationPrice { + /** + * 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; + + /** + * Configuration for matrix_with_allocation pricing + */ + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixWithAllocationPrice { + export 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; + } + } + + export interface NewLicenseAllocationTieredWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewLicenseAllocationTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithProrationPrice { + export 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 tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationUnitWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_proration pricing + */ + unit_with_proration_config: NewLicenseAllocationUnitWithProrationPrice.UnitWithProrationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithProrationPrice { + export 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 unit_with_proration pricing + */ + export interface UnitWithProrationConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_allocation pricing + */ + grouped_allocation_config: NewLicenseAllocationGroupedAllocationPrice.GroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedAllocationPrice { + /** + * Configuration for grouped_allocation pricing + */ + export interface GroupedAllocationConfig { + /** + * Usage allocation per group + */ + allocation: string; + + /** + * How to determine the groups that should each be allocated some quantity + */ + grouping_key: string; + + /** + * Unit rate for post-allocation + */ + overage_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + bulk_with_proration_config: NewLicenseAllocationBulkWithProrationPrice.BulkWithProrationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + export interface BulkWithProrationConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithProrationConfig { + /** + * Configuration for a single bulk pricing tier with proration + */ + export interface Tier { + /** + * Cost per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + grouped_with_prorated_minimum_config: NewLicenseAllocationGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + export interface GroupedWithProratedMinimumConfig { + /** + * How to determine the groups that should each have a minimum + */ + grouping_key: string; + + /** + * The minimum amount to charge per group + */ + minimum: string; + + /** + * The amount to charge per unit + */ + unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_metered_minimum pricing + */ + grouped_with_metered_minimum_config: NewLicenseAllocationGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * Configuration for grouped_with_metered_minimum pricing + */ + export interface GroupedWithMeteredMinimumConfig { + /** + * Used to partition the usage into groups. The minimum amount is applied to each + * group. + */ + grouping_key: string; + + /** + * The minimum amount to charge per group per unit + */ + minimum_unit_amount: string; + + /** + * Used to determine the unit rate + */ + pricing_key: string; + + /** + * Scale the unit rates by the scaling factor. + */ + scaling_factors: Array; + + /** + * Used to determine the unit rate scaling factor + */ + scaling_key: string; + + /** + * Apply per unit pricing to each pricing value. The minimum amount is applied any + * unmatched usage. + */ + unit_amounts: Array; + } + + export namespace GroupedWithMeteredMinimumConfig { + /** + * Configuration for a scaling factor + */ + export interface ScalingFactor { + scaling_factor: string; + + scaling_value: string; + } + + /** + * Configuration for a unit amount + */ + export interface UnitAmount { + pricing_value: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewLicenseAllocationGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationMatrixWithDisplayNamePrice { + /** + * 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; + + /** + * Configuration for matrix_with_display_name pricing + */ + matrix_with_display_name_config: NewLicenseAllocationMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationMatrixWithDisplayNamePrice { + export 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 matrix_with_display_name pricing + */ + export interface MatrixWithDisplayNameConfig { + /** + * Used to determine the unit rate + */ + dimension: string; + + /** + * Apply per unit pricing to each dimension value + */ + unit_amounts: Array; + } + + export namespace MatrixWithDisplayNameConfig { + /** + * Configuration for a unit amount item + */ + export interface UnitAmount { + /** + * The dimension value + */ + dimension_value: string; + + /** + * Display name for this dimension value + */ + display_name: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered_package pricing + */ + grouped_tiered_package_config: NewLicenseAllocationGroupedTieredPackagePrice.GroupedTieredPackageConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPackagePrice { + /** + * Configuration for grouped_tiered_package pricing + */ + export interface GroupedTieredPackageConfig { + /** + * The event property used to group before tiering + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace GroupedTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + /** + * Per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationMaxGroupTieredPackagePrice { + /** + * 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; + + /** + * Configuration for max_group_tiered_package pricing + */ + max_group_tiered_package_config: NewLicenseAllocationMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig; + + /** + * The pricing model type + */ + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationMaxGroupTieredPackagePrice { + export 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 max_group_tiered_package pricing + */ + export interface MaxGroupTieredPackageConfig { + /** + * The event property used to group before tiering the group with the highest value + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing to the largest group after grouping with the provided key. + */ + tiers: Array; + } + + export namespace MaxGroupTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_unit_pricing pricing + */ + scalable_matrix_with_unit_pricing_config: NewLicenseAllocationScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + export 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 scalable_matrix_with_unit_pricing pricing + */ + export interface ScalableMatrixWithUnitPricingConfig { + /** + * Used to determine the unit rate + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + /** + * The final unit price to rate against the output of the matrix + */ + unit_price: string; + + /** + * The property used to group this price + */ + grouping_key?: string | null; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + + /** + * Used to determine the unit rate (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithUnitPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_tiered_pricing pricing + */ + scalable_matrix_with_tiered_pricing_config: NewLicenseAllocationScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + export 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 scalable_matrix_with_tiered_pricing pricing + */ + export interface ScalableMatrixWithTieredPricingConfig { + /** + * Used for the scalable matrix first dimension + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + tiers: Array; + + /** + * Used for the scalable matrix second dimension (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithTieredPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + + /** + * Configuration for a single tier entry with business logic + */ + export interface Tier { + tier_lower_bound: string; + + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_bulk pricing + */ + cumulative_grouped_bulk_config: NewLicenseAllocationCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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 @@ -447,6 +10136,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -461,56 +10155,86 @@ export namespace BetaCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanTieredWithProrationPrice { + export namespace NewLicenseAllocationCumulativeGroupedBulkPrice { /** - * Configuration for tiered_with_proration pricing + * Configuration for cumulative_grouped_bulk pricing */ - export interface TieredWithProrationConfig { + export interface CumulativeGroupedBulkConfig { /** - * Tiers for rating based on total usage quantities into the specified tier with - * proration + * Each tier lower bound must have the same group of values. */ - tiers: Array; + dimension_values: Array; + + group: string; } - export namespace TieredWithProrationConfig { + export namespace CumulativeGroupedBulkConfig { /** - * Configuration for a single tiered with proration tier + * Configuration for a dimension value entry */ - export interface Tier { + export interface DimensionValue { /** - * Inclusive tier starting value + * Grouping key value + */ + grouping_key: string; + + /** + * Tier lower bound */ tier_lower_bound: string; /** - * Amount per unit + * Unit amount for this combination */ unit_amount: string; } } + + export 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; + } } - export interface NewPlanGroupedWithMinMaxThresholdsPrice { + export interface NewLicenseAllocationCumulativeGroupedAllocationPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for cumulative_grouped_allocation pricing */ - grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + cumulative_grouped_allocation_config: NewLicenseAllocationCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; /** * 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; + /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'cumulative_grouped_allocation'; /** * The name of the price. @@ -578,6 +10302,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -592,53 +10321,77 @@ export namespace BetaCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanGroupedWithMinMaxThresholdsPrice { + export namespace NewLicenseAllocationCumulativeGroupedAllocationPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for cumulative_grouped_allocation pricing */ - export interface GroupedWithMinMaxThresholdsConfig { + export interface CumulativeGroupedAllocationConfig { /** - * The event property used to group before applying thresholds + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations */ grouping_key: string; /** - * The maximum amount to charge each group + * The amount to charge for each unit outside of the allocation */ - maximum_charge: string; + unit_amount: string; + } + export interface LicenseAllocation { /** - * The minimum amount to charge each group, regardless of usage + * The amount of credits granted per active license per cadence. */ - minimum_charge: string; + amount: string; /** - * The base price charged per group + * The currency of the license allocation. */ - per_unit_rate: string; + currency: string; + + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; } } - export interface NewPlanCumulativeGroupedAllocationPrice { + export interface NewLicenseAllocationMinimumCompositePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for cumulative_grouped_allocation pricing + * The id of the item the price will be associated with. */ - cumulative_grouped_allocation_config: NewPlanCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + item_id: string; /** - * The id of the item the price will be associated with. + * 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. */ - item_id: string; + license_allocations: Array; + + /** + * Configuration for minimum_composite pricing + */ + minimum_composite_config: NewLicenseAllocationMinimumCompositePrice.MinimumCompositeConfig; /** * The pricing model type */ - model_type: 'cumulative_grouped_allocation'; + model_type: 'minimum_composite'; /** * The name of the price. @@ -706,6 +10459,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -720,34 +10478,41 @@ export namespace BetaCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanCumulativeGroupedAllocationPrice { - /** - * Configuration for cumulative_grouped_allocation pricing - */ - export interface CumulativeGroupedAllocationConfig { + export namespace NewLicenseAllocationMinimumCompositePrice { + export interface LicenseAllocation { /** - * The overall allocation across all groups + * The amount of credits granted per active license per cadence. */ - cumulative_allocation: string; + amount: string; /** - * The allocation per individual group + * The currency of the license allocation. */ - group_allocation: string; + currency: string; /** - * The event property used to group usage before applying allocations + * When True, overage beyond the allocation is written off. */ - grouping_key: string; + write_off_overage?: boolean | null; + } + + /** + * Configuration for minimum_composite pricing + */ + export interface MinimumCompositeConfig { + /** + * The minimum amount to apply + */ + minimum_amount: string; /** - * The amount to charge for each unit outside of the allocation + * If true, subtotals from this price are prorated based on the service period */ - unit_amount: string; + prorated?: boolean; } } - export interface NewPlanPercentCompositePrice { + export interface NewLicenseAllocationPercentCompositePrice { /** * The cadence to bill for this price on. */ @@ -758,6 +10523,13 @@ export namespace BetaCreatePlanVersionParams { */ 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; + /** * The pricing model type */ @@ -771,7 +10543,7 @@ export namespace BetaCreatePlanVersionParams { /** * Configuration for percent pricing */ - percent_config: NewPlanPercentCompositePrice.PercentConfig; + percent_config: NewLicenseAllocationPercentCompositePrice.PercentConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -834,6 +10606,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -848,7 +10625,24 @@ export namespace BetaCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanPercentCompositePrice { + export namespace NewLicenseAllocationPercentCompositePrice { + export 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 percent pricing */ @@ -860,7 +10654,7 @@ export namespace BetaCreatePlanVersionParams { } } - export interface NewPlanEventOutputPrice { + export interface NewLicenseAllocationEventOutputPrice { /** * The cadence to bill for this price on. */ @@ -869,13 +10663,20 @@ export namespace BetaCreatePlanVersionParams { /** * Configuration for event_output pricing */ - event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + event_output_config: NewLicenseAllocationEventOutputPrice.EventOutputConfig; /** * 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; + /** * The pricing model type */ @@ -947,6 +10748,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -961,7 +10767,7 @@ export namespace BetaCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanEventOutputPrice { + export namespace NewLicenseAllocationEventOutputPrice { /** * Configuration for event_output pricing */ @@ -984,110 +10790,25 @@ export namespace BetaCreatePlanVersionParams { */ grouping_key?: string | null; } - } - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove from on the plan. - */ - adjustment_id: string; - - /** - * The phase to remove this adjustment from. - */ - plan_phase_order?: number | null; - } - - export interface RemovePrice { - /** - * The id of the price to remove from the plan. - */ - price_id: string; - - /** - * The phase to remove this price from. - */ - plan_phase_order?: number | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the plan. - */ - adjustment: - | Shared.NewPercentageDiscount - | Shared.NewUsageDiscount - | Shared.NewAmountDiscount - | Shared.NewMinimum - | Shared.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the plan. - */ - replaces_adjustment_id: string; - - /** - * The phase to replace this adjustment from. - */ - plan_phase_order?: number | null; - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the plan. - */ - replaces_price_id: string; - /** - * The allocation price to add to the plan. - */ - allocation_price?: Shared.NewAllocationPrice | null; + export interface LicenseAllocation { + /** + * The amount of credits granted per active license per cadence. + */ + amount: string; - /** - * The phase to replace this price from. - */ - plan_phase_order?: number | null; + /** + * The currency of the license allocation. + */ + currency: string; - /** - * New plan price request body params. - */ - price?: - | Shared.NewPlanUnitPrice - | Shared.NewPlanTieredPrice - | Shared.NewPlanBulkPrice - | ReplacePrice.NewPlanBulkWithFiltersPrice - | Shared.NewPlanPackagePrice - | Shared.NewPlanMatrixPrice - | Shared.NewPlanThresholdTotalAmountPrice - | Shared.NewPlanTieredPackagePrice - | Shared.NewPlanTieredWithMinimumPrice - | Shared.NewPlanGroupedTieredPrice - | Shared.NewPlanTieredPackageWithMinimumPrice - | Shared.NewPlanPackageWithAllocationPrice - | Shared.NewPlanUnitWithPercentPrice - | Shared.NewPlanMatrixWithAllocationPrice - | ReplacePrice.NewPlanTieredWithProrationPrice - | Shared.NewPlanUnitWithProrationPrice - | Shared.NewPlanGroupedAllocationPrice - | Shared.NewPlanBulkWithProrationPrice - | Shared.NewPlanGroupedWithProratedMinimumPrice - | Shared.NewPlanGroupedWithMeteredMinimumPrice - | ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice - | Shared.NewPlanMatrixWithDisplayNamePrice - | Shared.NewPlanGroupedTieredPackagePrice - | Shared.NewPlanMaxGroupTieredPackagePrice - | Shared.NewPlanScalableMatrixWithUnitPricingPrice - | Shared.NewPlanScalableMatrixWithTieredPricingPrice - | Shared.NewPlanCumulativeGroupedBulkPrice - | ReplacePrice.NewPlanCumulativeGroupedAllocationPrice - | Shared.NewPlanMinimumCompositePrice - | ReplacePrice.NewPlanPercentCompositePrice - | ReplacePrice.NewPlanEventOutputPrice - | null; - } + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; + } + } - export namespace ReplacePrice { export interface NewPlanBulkWithFiltersPrice { /** * Configuration for bulk_with_filters pricing @@ -1175,6 +10896,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -1325,6 +11051,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -1456,6 +11187,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -1584,6 +11320,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -1712,6 +11453,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 @@ -1825,6 +11571,11 @@ export namespace BetaCreatePlanVersionParams { */ 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 diff --git a/src/resources/beta/external-plan-id.ts b/src/resources/beta/external-plan-id.ts index d33ee80b..07c872de 100644 --- a/src/resources/beta/external-plan-id.ts +++ b/src/resources/beta/external-plan-id.ts @@ -6,6 +6,11 @@ import * as Shared from '../shared'; import * as BetaAPI from './beta'; import * as PlansAPI from '../plans/plans'; +/** + * 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 class ExternalPlanID extends APIResource { /** * This endpoint allows the creation of a new plan version for an existing plan. @@ -111,6 +116,43 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ allocation_price?: Shared.NewAllocationPrice | null; + /** + * The license allocation price to add to the plan. + */ + license_allocation_price?: + | AddPrice.NewLicenseAllocationUnitPrice + | AddPrice.NewLicenseAllocationTieredPrice + | AddPrice.NewLicenseAllocationBulkPrice + | AddPrice.NewLicenseAllocationBulkWithFiltersPrice + | AddPrice.NewLicenseAllocationPackagePrice + | AddPrice.NewLicenseAllocationMatrixPrice + | AddPrice.NewLicenseAllocationThresholdTotalAmountPrice + | AddPrice.NewLicenseAllocationTieredPackagePrice + | AddPrice.NewLicenseAllocationTieredWithMinimumPrice + | AddPrice.NewLicenseAllocationGroupedTieredPrice + | AddPrice.NewLicenseAllocationTieredPackageWithMinimumPrice + | AddPrice.NewLicenseAllocationPackageWithAllocationPrice + | AddPrice.NewLicenseAllocationUnitWithPercentPrice + | AddPrice.NewLicenseAllocationMatrixWithAllocationPrice + | AddPrice.NewLicenseAllocationTieredWithProrationPrice + | AddPrice.NewLicenseAllocationUnitWithProrationPrice + | AddPrice.NewLicenseAllocationGroupedAllocationPrice + | AddPrice.NewLicenseAllocationBulkWithProrationPrice + | AddPrice.NewLicenseAllocationGroupedWithProratedMinimumPrice + | AddPrice.NewLicenseAllocationGroupedWithMeteredMinimumPrice + | AddPrice.NewLicenseAllocationGroupedWithMinMaxThresholdsPrice + | AddPrice.NewLicenseAllocationMatrixWithDisplayNamePrice + | AddPrice.NewLicenseAllocationGroupedTieredPackagePrice + | AddPrice.NewLicenseAllocationMaxGroupTieredPackagePrice + | AddPrice.NewLicenseAllocationScalableMatrixWithUnitPricingPrice + | AddPrice.NewLicenseAllocationScalableMatrixWithTieredPricingPrice + | AddPrice.NewLicenseAllocationCumulativeGroupedBulkPrice + | AddPrice.NewLicenseAllocationCumulativeGroupedAllocationPrice + | AddPrice.NewLicenseAllocationMinimumCompositePrice + | AddPrice.NewLicenseAllocationPercentCompositePrice + | AddPrice.NewLicenseAllocationEventOutputPrice + | null; + /** * The phase to add this price to. */ @@ -155,12 +197,7 @@ export namespace ExternalPlanIDCreatePlanVersionParams { } export namespace AddPrice { - export interface NewPlanBulkWithFiltersPrice { - /** - * Configuration for bulk_with_filters pricing - */ - bulk_with_filters_config: NewPlanBulkWithFiltersPrice.BulkWithFiltersConfig; - + export interface NewLicenseAllocationUnitPrice { /** * The cadence to bill for this price on. */ @@ -171,16 +208,28 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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; + /** * The pricing model type */ - model_type: 'bulk_with_filters'; + 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. @@ -242,6 +291,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -256,56 +310,163 @@ export namespace ExternalPlanIDCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanBulkWithFiltersPrice { - /** - * Configuration for bulk_with_filters pricing - */ - export interface BulkWithFiltersConfig { + export namespace NewLicenseAllocationUnitPrice { + export interface LicenseAllocation { /** - * Property filters to apply (all must match) + * The amount of credits granted per active license per cadence. */ - filters: Array; + amount: string; /** - * Bulk tiers for rating based on total usage volume + * The currency of the license allocation. */ - tiers: Array; - } + currency: string; - export namespace BulkWithFiltersConfig { /** - * Configuration for a single property filter + * When True, overage beyond the allocation is written off. */ - export interface Filter { - /** - * Event property key to filter on - */ - property_key: string; + write_off_overage?: boolean | null; + } + } - /** - * Event property value to match - */ - property_value: string; - } + export 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; + + /** + * 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; + } + export namespace NewLicenseAllocationTieredPrice { + export interface LicenseAllocation { /** - * Configuration for a single bulk pricing tier + * The amount of credits granted per active license per cadence. */ - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; + amount: string; - /** - * The lower bound for this tier - */ - tier_lower_bound?: string | null; - } + /** + * The currency of the license allocation. + */ + currency: string; + + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; } } - export interface NewPlanTieredWithProrationPrice { + export interface NewLicenseAllocationBulkPrice { + /** + * Configuration for bulk pricing + */ + bulk_config: Shared.BulkConfig; + /** * The cadence to bill for this price on. */ @@ -316,10 +477,17 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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; + /** * The pricing model type */ - model_type: 'tiered_with_proration'; + model_type: 'bulk'; /** * The name of the price. @@ -327,9 +495,9530 @@ export namespace ExternalPlanIDCreatePlanVersionParams { name: string; /** - * Configuration for tiered_with_proration pricing + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig; + 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; + } + + export namespace NewLicenseAllocationBulkPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackagePrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationThresholdTotalAmountPrice { + export 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 + */ + export interface ThresholdTotalAmountConfig { + /** + * When the quantity consumed passes a provided threshold, the configured total + * will be charged + */ + consumption_table: Array; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + } + + export namespace ThresholdTotalAmountConfig { + /** + * Configuration for a single threshold + */ + export interface ConsumptionTable { + threshold: string; + + /** + * Total amount for this threshold + */ + total_amount: string; + } + } + } + + export 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; + + /** + * 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. + */ + 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; + } + + export namespace NewLicenseAllocationTieredPackagePrice { + export 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 tiered_package pricing + */ + export interface TieredPackageConfig { + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. The tier bounds are defined based on + * the total quantity rather than the number of packages, so they must be multiples + * of the package size. + */ + tiers: Array; + } + + export namespace TieredPackageConfig { + /** + * Configuration for a single tier with business logic + */ + export interface Tier { + /** + * Price per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationTieredWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_minimum pricing + */ + tiered_with_minimum_config: NewLicenseAllocationTieredWithMinimumPrice.TieredWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithMinimumPrice { + export 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 tiered_with_minimum pricing + */ + export interface TieredWithMinimumConfig { + /** + * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + * defined using exclusive lower bounds. + */ + tiers: Array; + + /** + * If true, tiers with an accrued amount of 0 will not be included in the rating. + */ + hide_zero_amount_tiers?: boolean; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean; + } + + export namespace TieredWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered pricing + */ + grouped_tiered_config: NewLicenseAllocationGroupedTieredPrice.GroupedTieredConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPrice { + /** + * Configuration for grouped_tiered pricing + */ + export interface GroupedTieredConfig { + /** + * The billable metric property used to group before tiering + */ + grouping_key: string; + + /** + * Apply tiered pricing to each segment generated after grouping with the provided + * key + */ + tiers: Array; + } + + export namespace GroupedTieredConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationTieredPackageWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_package_with_minimum pricing + */ + tiered_package_with_minimum_config: NewLicenseAllocationTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPackageWithMinimumPrice { + export 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 tiered_package_with_minimum pricing + */ + export interface TieredPackageWithMinimumConfig { + package_size: number; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace TieredPackageWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationPackageWithAllocationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for package_with_allocation pricing + */ + package_with_allocation_config: NewLicenseAllocationPackageWithAllocationPrice.PackageWithAllocationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackageWithAllocationPrice { + export 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 package_with_allocation pricing + */ + export interface PackageWithAllocationConfig { + allocation: string; + + package_amount: string; + + package_size: string; + } + } + + export interface NewLicenseAllocationUnitWithPercentPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_percent pricing + */ + unit_with_percent_config: NewLicenseAllocationUnitWithPercentPrice.UnitWithPercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithPercentPrice { + export 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 unit_with_percent pricing + */ + export interface UnitWithPercentConfig { + /** + * What percent, out of 100, of the calculated total to charge + */ + percent: string; + + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationMatrixWithAllocationPrice { + /** + * 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; + + /** + * Configuration for matrix_with_allocation pricing + */ + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixWithAllocationPrice { + export 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; + } + } + + export interface NewLicenseAllocationTieredWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewLicenseAllocationTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithProrationPrice { + export 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 tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationUnitWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_proration pricing + */ + unit_with_proration_config: NewLicenseAllocationUnitWithProrationPrice.UnitWithProrationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithProrationPrice { + export 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 unit_with_proration pricing + */ + export interface UnitWithProrationConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_allocation pricing + */ + grouped_allocation_config: NewLicenseAllocationGroupedAllocationPrice.GroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedAllocationPrice { + /** + * Configuration for grouped_allocation pricing + */ + export interface GroupedAllocationConfig { + /** + * Usage allocation per group + */ + allocation: string; + + /** + * How to determine the groups that should each be allocated some quantity + */ + grouping_key: string; + + /** + * Unit rate for post-allocation + */ + overage_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + bulk_with_proration_config: NewLicenseAllocationBulkWithProrationPrice.BulkWithProrationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + export interface BulkWithProrationConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithProrationConfig { + /** + * Configuration for a single bulk pricing tier with proration + */ + export interface Tier { + /** + * Cost per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + grouped_with_prorated_minimum_config: NewLicenseAllocationGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + export interface GroupedWithProratedMinimumConfig { + /** + * How to determine the groups that should each have a minimum + */ + grouping_key: string; + + /** + * The minimum amount to charge per group + */ + minimum: string; + + /** + * The amount to charge per unit + */ + unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_metered_minimum pricing + */ + grouped_with_metered_minimum_config: NewLicenseAllocationGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * Configuration for grouped_with_metered_minimum pricing + */ + export interface GroupedWithMeteredMinimumConfig { + /** + * Used to partition the usage into groups. The minimum amount is applied to each + * group. + */ + grouping_key: string; + + /** + * The minimum amount to charge per group per unit + */ + minimum_unit_amount: string; + + /** + * Used to determine the unit rate + */ + pricing_key: string; + + /** + * Scale the unit rates by the scaling factor. + */ + scaling_factors: Array; + + /** + * Used to determine the unit rate scaling factor + */ + scaling_key: string; + + /** + * Apply per unit pricing to each pricing value. The minimum amount is applied any + * unmatched usage. + */ + unit_amounts: Array; + } + + export namespace GroupedWithMeteredMinimumConfig { + /** + * Configuration for a scaling factor + */ + export interface ScalingFactor { + scaling_factor: string; + + scaling_value: string; + } + + /** + * Configuration for a unit amount + */ + export interface UnitAmount { + pricing_value: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewLicenseAllocationGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationMatrixWithDisplayNamePrice { + /** + * 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; + + /** + * Configuration for matrix_with_display_name pricing + */ + matrix_with_display_name_config: NewLicenseAllocationMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationMatrixWithDisplayNamePrice { + export 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 matrix_with_display_name pricing + */ + export interface MatrixWithDisplayNameConfig { + /** + * Used to determine the unit rate + */ + dimension: string; + + /** + * Apply per unit pricing to each dimension value + */ + unit_amounts: Array; + } + + export namespace MatrixWithDisplayNameConfig { + /** + * Configuration for a unit amount item + */ + export interface UnitAmount { + /** + * The dimension value + */ + dimension_value: string; + + /** + * Display name for this dimension value + */ + display_name: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered_package pricing + */ + grouped_tiered_package_config: NewLicenseAllocationGroupedTieredPackagePrice.GroupedTieredPackageConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPackagePrice { + /** + * Configuration for grouped_tiered_package pricing + */ + export interface GroupedTieredPackageConfig { + /** + * The event property used to group before tiering + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace GroupedTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + /** + * Per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationMaxGroupTieredPackagePrice { + /** + * 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; + + /** + * Configuration for max_group_tiered_package pricing + */ + max_group_tiered_package_config: NewLicenseAllocationMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig; + + /** + * The pricing model type + */ + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationMaxGroupTieredPackagePrice { + export 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 max_group_tiered_package pricing + */ + export interface MaxGroupTieredPackageConfig { + /** + * The event property used to group before tiering the group with the highest value + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing to the largest group after grouping with the provided key. + */ + tiers: Array; + } + + export namespace MaxGroupTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_unit_pricing pricing + */ + scalable_matrix_with_unit_pricing_config: NewLicenseAllocationScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + export 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 scalable_matrix_with_unit_pricing pricing + */ + export interface ScalableMatrixWithUnitPricingConfig { + /** + * Used to determine the unit rate + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + /** + * The final unit price to rate against the output of the matrix + */ + unit_price: string; + + /** + * The property used to group this price + */ + grouping_key?: string | null; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + + /** + * Used to determine the unit rate (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithUnitPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_tiered_pricing pricing + */ + scalable_matrix_with_tiered_pricing_config: NewLicenseAllocationScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + export 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 scalable_matrix_with_tiered_pricing pricing + */ + export interface ScalableMatrixWithTieredPricingConfig { + /** + * Used for the scalable matrix first dimension + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + tiers: Array; + + /** + * Used for the scalable matrix second dimension (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithTieredPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + + /** + * Configuration for a single tier entry with business logic + */ + export interface Tier { + tier_lower_bound: string; + + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_bulk pricing + */ + cumulative_grouped_bulk_config: NewLicenseAllocationCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * Configuration for cumulative_grouped_bulk pricing + */ + export interface CumulativeGroupedBulkConfig { + /** + * Each tier lower bound must have the same group of values. + */ + dimension_values: Array; + + group: string; + } + + export namespace CumulativeGroupedBulkConfig { + /** + * Configuration for a dimension value entry + */ + export interface DimensionValue { + /** + * Grouping key value + */ + grouping_key: string; + + /** + * Tier lower bound + */ + tier_lower_bound: string; + + /** + * Unit amount for this combination + */ + unit_amount: string; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewLicenseAllocationCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'cumulative_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?: 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; + } + + export namespace NewLicenseAllocationCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations + */ + grouping_key: string; + + /** + * The amount to charge for each unit outside of the allocation + */ + unit_amount: string; + } + + export 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; + } + } + + export interface NewLicenseAllocationMinimumCompositePrice { + /** + * 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; + + /** + * Configuration for minimum_composite pricing + */ + minimum_composite_config: NewLicenseAllocationMinimumCompositePrice.MinimumCompositeConfig; + + /** + * The pricing model type + */ + model_type: 'minimum_composite'; + + /** + * 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; + } + + export namespace NewLicenseAllocationMinimumCompositePrice { + export 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 minimum_composite pricing + */ + export interface MinimumCompositeConfig { + /** + * The minimum amount to apply + */ + minimum_amount: string; + + /** + * If true, subtotals from this price are prorated based on the service period + */ + prorated?: boolean; + } + } + + export interface NewLicenseAllocationPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewLicenseAllocationPercentCompositePrice.PercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPercentCompositePrice { + export 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 percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewLicenseAllocationEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewLicenseAllocationEventOutputPrice.EventOutputConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + } + + export namespace NewLicenseAllocationEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * If provided, this amount will be used as the unit rate when an event does not + * have a value for the `unit_rating_key`. If not provided, events missing a unit + * rate will be ignored. + */ + default_unit_rate?: string | null; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + + export 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; + } + } + + export interface NewPlanBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + bulk_with_filters_config: NewPlanBulkWithFiltersPrice.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; + + /** + * 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; + } + + export namespace NewPlanBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + } + + export interface NewPlanTieredWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewPlanTieredWithProrationPrice { + /** + * Configuration for tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewPlanGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * 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; + } + + export namespace NewPlanGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + } + + export interface NewPlanCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewPlanCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'cumulative_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?: 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; + } + + export namespace NewPlanCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations + */ + grouping_key: string; + + /** + * The amount to charge for each unit outside of the allocation + */ + unit_amount: string; + } + } + + export interface NewPlanPercentCompositePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + } + + export namespace NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + } + + export namespace NewPlanEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * If provided, this amount will be used as the unit rate when an event does not + * have a value for the `unit_rating_key`. If not provided, events missing a unit + * rate will be ignored. + */ + default_unit_rate?: string | null; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + } + } + + export interface RemoveAdjustment { + /** + * The id of the adjustment to remove from on the plan. + */ + adjustment_id: string; + + /** + * The phase to remove this adjustment from. + */ + plan_phase_order?: number | null; + } + + export interface RemovePrice { + /** + * The id of the price to remove from the plan. + */ + price_id: string; + + /** + * The phase to remove this price from. + */ + plan_phase_order?: number | null; + } + + export interface ReplaceAdjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; + + /** + * The id of the adjustment on the plan to replace in the plan. + */ + replaces_adjustment_id: string; + + /** + * The phase to replace this adjustment from. + */ + plan_phase_order?: number | null; + } + + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the plan. + */ + replaces_price_id: string; + + /** + * The allocation price to add to the plan. + */ + allocation_price?: Shared.NewAllocationPrice | null; + + /** + * The license allocation price to add to the plan. + */ + license_allocation_price?: + | ReplacePrice.NewLicenseAllocationUnitPrice + | ReplacePrice.NewLicenseAllocationTieredPrice + | ReplacePrice.NewLicenseAllocationBulkPrice + | ReplacePrice.NewLicenseAllocationBulkWithFiltersPrice + | ReplacePrice.NewLicenseAllocationPackagePrice + | ReplacePrice.NewLicenseAllocationMatrixPrice + | ReplacePrice.NewLicenseAllocationThresholdTotalAmountPrice + | ReplacePrice.NewLicenseAllocationTieredPackagePrice + | ReplacePrice.NewLicenseAllocationTieredWithMinimumPrice + | ReplacePrice.NewLicenseAllocationGroupedTieredPrice + | ReplacePrice.NewLicenseAllocationTieredPackageWithMinimumPrice + | ReplacePrice.NewLicenseAllocationPackageWithAllocationPrice + | ReplacePrice.NewLicenseAllocationUnitWithPercentPrice + | ReplacePrice.NewLicenseAllocationMatrixWithAllocationPrice + | ReplacePrice.NewLicenseAllocationTieredWithProrationPrice + | ReplacePrice.NewLicenseAllocationUnitWithProrationPrice + | ReplacePrice.NewLicenseAllocationGroupedAllocationPrice + | ReplacePrice.NewLicenseAllocationBulkWithProrationPrice + | ReplacePrice.NewLicenseAllocationGroupedWithProratedMinimumPrice + | ReplacePrice.NewLicenseAllocationGroupedWithMeteredMinimumPrice + | ReplacePrice.NewLicenseAllocationGroupedWithMinMaxThresholdsPrice + | ReplacePrice.NewLicenseAllocationMatrixWithDisplayNamePrice + | ReplacePrice.NewLicenseAllocationGroupedTieredPackagePrice + | ReplacePrice.NewLicenseAllocationMaxGroupTieredPackagePrice + | ReplacePrice.NewLicenseAllocationScalableMatrixWithUnitPricingPrice + | ReplacePrice.NewLicenseAllocationScalableMatrixWithTieredPricingPrice + | ReplacePrice.NewLicenseAllocationCumulativeGroupedBulkPrice + | ReplacePrice.NewLicenseAllocationCumulativeGroupedAllocationPrice + | ReplacePrice.NewLicenseAllocationMinimumCompositePrice + | ReplacePrice.NewLicenseAllocationPercentCompositePrice + | ReplacePrice.NewLicenseAllocationEventOutputPrice + | null; + + /** + * The phase to replace this price from. + */ + plan_phase_order?: number | null; + + /** + * New plan price request body params. + */ + price?: + | Shared.NewPlanUnitPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanBulkPrice + | ReplacePrice.NewPlanBulkWithFiltersPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanGroupedTieredPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanMatrixWithAllocationPrice + | ReplacePrice.NewPlanTieredWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | ReplacePrice.NewPlanCumulativeGroupedAllocationPrice + | Shared.NewPlanMinimumCompositePrice + | ReplacePrice.NewPlanPercentCompositePrice + | ReplacePrice.NewPlanEventOutputPrice + | null; + } + + export namespace ReplacePrice { + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationBulkPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackagePrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationThresholdTotalAmountPrice { + export 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 + */ + export interface ThresholdTotalAmountConfig { + /** + * When the quantity consumed passes a provided threshold, the configured total + * will be charged + */ + consumption_table: Array; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + } + + export namespace ThresholdTotalAmountConfig { + /** + * Configuration for a single threshold + */ + export interface ConsumptionTable { + threshold: string; + + /** + * Total amount for this threshold + */ + total_amount: string; + } + } + } + + export 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; + + /** + * 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. + */ + 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; + } + + export namespace NewLicenseAllocationTieredPackagePrice { + export 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 tiered_package pricing + */ + export interface TieredPackageConfig { + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. The tier bounds are defined based on + * the total quantity rather than the number of packages, so they must be multiples + * of the package size. + */ + tiers: Array; + } + + export namespace TieredPackageConfig { + /** + * Configuration for a single tier with business logic + */ + export interface Tier { + /** + * Price per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationTieredWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_minimum pricing + */ + tiered_with_minimum_config: NewLicenseAllocationTieredWithMinimumPrice.TieredWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithMinimumPrice { + export 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 tiered_with_minimum pricing + */ + export interface TieredWithMinimumConfig { + /** + * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + * defined using exclusive lower bounds. + */ + tiers: Array; + + /** + * If true, tiers with an accrued amount of 0 will not be included in the rating. + */ + hide_zero_amount_tiers?: boolean; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean; + } + + export namespace TieredWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered pricing + */ + grouped_tiered_config: NewLicenseAllocationGroupedTieredPrice.GroupedTieredConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPrice { + /** + * Configuration for grouped_tiered pricing + */ + export interface GroupedTieredConfig { + /** + * The billable metric property used to group before tiering + */ + grouping_key: string; + + /** + * Apply tiered pricing to each segment generated after grouping with the provided + * key + */ + tiers: Array; + } + + export namespace GroupedTieredConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationTieredPackageWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_package_with_minimum pricing + */ + tiered_package_with_minimum_config: NewLicenseAllocationTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPackageWithMinimumPrice { + export 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 tiered_package_with_minimum pricing + */ + export interface TieredPackageWithMinimumConfig { + package_size: number; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace TieredPackageWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationPackageWithAllocationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for package_with_allocation pricing + */ + package_with_allocation_config: NewLicenseAllocationPackageWithAllocationPrice.PackageWithAllocationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackageWithAllocationPrice { + export 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 package_with_allocation pricing + */ + export interface PackageWithAllocationConfig { + allocation: string; + + package_amount: string; + + package_size: string; + } + } + + export interface NewLicenseAllocationUnitWithPercentPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_percent pricing + */ + unit_with_percent_config: NewLicenseAllocationUnitWithPercentPrice.UnitWithPercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithPercentPrice { + export 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 unit_with_percent pricing + */ + export interface UnitWithPercentConfig { + /** + * What percent, out of 100, of the calculated total to charge + */ + percent: string; + + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationMatrixWithAllocationPrice { + /** + * 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; + + /** + * Configuration for matrix_with_allocation pricing + */ + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixWithAllocationPrice { + export 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; + } + } + + export interface NewLicenseAllocationTieredWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewLicenseAllocationTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithProrationPrice { + export 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 tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationUnitWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_proration pricing + */ + unit_with_proration_config: NewLicenseAllocationUnitWithProrationPrice.UnitWithProrationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithProrationPrice { + export 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 unit_with_proration pricing + */ + export interface UnitWithProrationConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_allocation pricing + */ + grouped_allocation_config: NewLicenseAllocationGroupedAllocationPrice.GroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedAllocationPrice { + /** + * Configuration for grouped_allocation pricing + */ + export interface GroupedAllocationConfig { + /** + * Usage allocation per group + */ + allocation: string; + + /** + * How to determine the groups that should each be allocated some quantity + */ + grouping_key: string; + + /** + * Unit rate for post-allocation + */ + overage_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + bulk_with_proration_config: NewLicenseAllocationBulkWithProrationPrice.BulkWithProrationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + export interface BulkWithProrationConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithProrationConfig { + /** + * Configuration for a single bulk pricing tier with proration + */ + export interface Tier { + /** + * Cost per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + grouped_with_prorated_minimum_config: NewLicenseAllocationGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + export interface GroupedWithProratedMinimumConfig { + /** + * How to determine the groups that should each have a minimum + */ + grouping_key: string; + + /** + * The minimum amount to charge per group + */ + minimum: string; + + /** + * The amount to charge per unit + */ + unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_metered_minimum pricing + */ + grouped_with_metered_minimum_config: NewLicenseAllocationGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * Configuration for grouped_with_metered_minimum pricing + */ + export interface GroupedWithMeteredMinimumConfig { + /** + * Used to partition the usage into groups. The minimum amount is applied to each + * group. + */ + grouping_key: string; + + /** + * The minimum amount to charge per group per unit + */ + minimum_unit_amount: string; + + /** + * Used to determine the unit rate + */ + pricing_key: string; + + /** + * Scale the unit rates by the scaling factor. + */ + scaling_factors: Array; + + /** + * Used to determine the unit rate scaling factor + */ + scaling_key: string; + + /** + * Apply per unit pricing to each pricing value. The minimum amount is applied any + * unmatched usage. + */ + unit_amounts: Array; + } + + export namespace GroupedWithMeteredMinimumConfig { + /** + * Configuration for a scaling factor + */ + export interface ScalingFactor { + scaling_factor: string; + + scaling_value: string; + } + + /** + * Configuration for a unit amount + */ + export interface UnitAmount { + pricing_value: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewLicenseAllocationGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationMatrixWithDisplayNamePrice { + /** + * 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; + + /** + * Configuration for matrix_with_display_name pricing + */ + matrix_with_display_name_config: NewLicenseAllocationMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationMatrixWithDisplayNamePrice { + export 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 matrix_with_display_name pricing + */ + export interface MatrixWithDisplayNameConfig { + /** + * Used to determine the unit rate + */ + dimension: string; + + /** + * Apply per unit pricing to each dimension value + */ + unit_amounts: Array; + } + + export namespace MatrixWithDisplayNameConfig { + /** + * Configuration for a unit amount item + */ + export interface UnitAmount { + /** + * The dimension value + */ + dimension_value: string; + + /** + * Display name for this dimension value + */ + display_name: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered_package pricing + */ + grouped_tiered_package_config: NewLicenseAllocationGroupedTieredPackagePrice.GroupedTieredPackageConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPackagePrice { + /** + * Configuration for grouped_tiered_package pricing + */ + export interface GroupedTieredPackageConfig { + /** + * The event property used to group before tiering + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace GroupedTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + /** + * Per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationMaxGroupTieredPackagePrice { + /** + * 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; + + /** + * Configuration for max_group_tiered_package pricing + */ + max_group_tiered_package_config: NewLicenseAllocationMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig; + + /** + * The pricing model type + */ + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationMaxGroupTieredPackagePrice { + export 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 max_group_tiered_package pricing + */ + export interface MaxGroupTieredPackageConfig { + /** + * The event property used to group before tiering the group with the highest value + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing to the largest group after grouping with the provided key. + */ + tiers: Array; + } + + export namespace MaxGroupTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_unit_pricing pricing + */ + scalable_matrix_with_unit_pricing_config: NewLicenseAllocationScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + export 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 scalable_matrix_with_unit_pricing pricing + */ + export interface ScalableMatrixWithUnitPricingConfig { + /** + * Used to determine the unit rate + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + /** + * The final unit price to rate against the output of the matrix + */ + unit_price: string; + + /** + * The property used to group this price + */ + grouping_key?: string | null; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + + /** + * Used to determine the unit rate (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithUnitPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_tiered_pricing pricing + */ + scalable_matrix_with_tiered_pricing_config: NewLicenseAllocationScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + export 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 scalable_matrix_with_tiered_pricing pricing + */ + export interface ScalableMatrixWithTieredPricingConfig { + /** + * Used for the scalable matrix first dimension + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + tiers: Array; + + /** + * Used for the scalable matrix second dimension (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithTieredPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + + /** + * Configuration for a single tier entry with business logic + */ + export interface Tier { + tier_lower_bound: string; + + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_bulk pricing + */ + cumulative_grouped_bulk_config: NewLicenseAllocationCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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 @@ -392,6 +10081,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -406,56 +10100,86 @@ export namespace ExternalPlanIDCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanTieredWithProrationPrice { + export namespace NewLicenseAllocationCumulativeGroupedBulkPrice { /** - * Configuration for tiered_with_proration pricing + * Configuration for cumulative_grouped_bulk pricing */ - export interface TieredWithProrationConfig { + export interface CumulativeGroupedBulkConfig { /** - * Tiers for rating based on total usage quantities into the specified tier with - * proration + * Each tier lower bound must have the same group of values. */ - tiers: Array; + dimension_values: Array; + + group: string; } - export namespace TieredWithProrationConfig { + export namespace CumulativeGroupedBulkConfig { /** - * Configuration for a single tiered with proration tier + * Configuration for a dimension value entry */ - export interface Tier { + export interface DimensionValue { /** - * Inclusive tier starting value + * Grouping key value + */ + grouping_key: string; + + /** + * Tier lower bound */ tier_lower_bound: string; /** - * Amount per unit + * Unit amount for this combination */ unit_amount: string; } } + + export 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; + } } - export interface NewPlanGroupedWithMinMaxThresholdsPrice { + export interface NewLicenseAllocationCumulativeGroupedAllocationPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for cumulative_grouped_allocation pricing */ - grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + cumulative_grouped_allocation_config: NewLicenseAllocationCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; /** * 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; + /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'cumulative_grouped_allocation'; /** * The name of the price. @@ -523,6 +10247,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -537,53 +10266,77 @@ export namespace ExternalPlanIDCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanGroupedWithMinMaxThresholdsPrice { + export namespace NewLicenseAllocationCumulativeGroupedAllocationPrice { /** - * Configuration for grouped_with_min_max_thresholds pricing + * Configuration for cumulative_grouped_allocation pricing */ - export interface GroupedWithMinMaxThresholdsConfig { + export interface CumulativeGroupedAllocationConfig { /** - * The event property used to group before applying thresholds + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations */ grouping_key: string; /** - * The maximum amount to charge each group + * The amount to charge for each unit outside of the allocation */ - maximum_charge: string; + unit_amount: string; + } + export interface LicenseAllocation { /** - * The minimum amount to charge each group, regardless of usage + * The amount of credits granted per active license per cadence. */ - minimum_charge: string; + amount: string; /** - * The base price charged per group + * The currency of the license allocation. */ - per_unit_rate: string; + currency: string; + + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; } } - export interface NewPlanCumulativeGroupedAllocationPrice { + export interface NewLicenseAllocationMinimumCompositePrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for cumulative_grouped_allocation pricing + * The id of the item the price will be associated with. */ - cumulative_grouped_allocation_config: NewPlanCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + item_id: string; /** - * The id of the item the price will be associated with. + * 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. */ - item_id: string; + license_allocations: Array; + + /** + * Configuration for minimum_composite pricing + */ + minimum_composite_config: NewLicenseAllocationMinimumCompositePrice.MinimumCompositeConfig; /** * The pricing model type */ - model_type: 'cumulative_grouped_allocation'; + model_type: 'minimum_composite'; /** * The name of the price. @@ -651,6 +10404,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -665,34 +10423,41 @@ export namespace ExternalPlanIDCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanCumulativeGroupedAllocationPrice { - /** - * Configuration for cumulative_grouped_allocation pricing - */ - export interface CumulativeGroupedAllocationConfig { + export namespace NewLicenseAllocationMinimumCompositePrice { + export interface LicenseAllocation { /** - * The overall allocation across all groups + * The amount of credits granted per active license per cadence. */ - cumulative_allocation: string; + amount: string; /** - * The allocation per individual group + * The currency of the license allocation. */ - group_allocation: string; + currency: string; /** - * The event property used to group usage before applying allocations + * When True, overage beyond the allocation is written off. */ - grouping_key: string; + write_off_overage?: boolean | null; + } + + /** + * Configuration for minimum_composite pricing + */ + export interface MinimumCompositeConfig { + /** + * The minimum amount to apply + */ + minimum_amount: string; /** - * The amount to charge for each unit outside of the allocation + * If true, subtotals from this price are prorated based on the service period */ - unit_amount: string; + prorated?: boolean; } } - export interface NewPlanPercentCompositePrice { + export interface NewLicenseAllocationPercentCompositePrice { /** * The cadence to bill for this price on. */ @@ -703,6 +10468,13 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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; + /** * The pricing model type */ @@ -716,7 +10488,7 @@ export namespace ExternalPlanIDCreatePlanVersionParams { /** * Configuration for percent pricing */ - percent_config: NewPlanPercentCompositePrice.PercentConfig; + percent_config: NewLicenseAllocationPercentCompositePrice.PercentConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -779,6 +10551,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -793,7 +10570,24 @@ export namespace ExternalPlanIDCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanPercentCompositePrice { + export namespace NewLicenseAllocationPercentCompositePrice { + export 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 percent pricing */ @@ -805,7 +10599,7 @@ export namespace ExternalPlanIDCreatePlanVersionParams { } } - export interface NewPlanEventOutputPrice { + export interface NewLicenseAllocationEventOutputPrice { /** * The cadence to bill for this price on. */ @@ -814,13 +10608,20 @@ export namespace ExternalPlanIDCreatePlanVersionParams { /** * Configuration for event_output pricing */ - event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + event_output_config: NewLicenseAllocationEventOutputPrice.EventOutputConfig; /** * 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; + /** * The pricing model type */ @@ -892,6 +10693,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -906,7 +10712,7 @@ export namespace ExternalPlanIDCreatePlanVersionParams { reference_id?: string | null; } - export namespace NewPlanEventOutputPrice { + export namespace NewLicenseAllocationEventOutputPrice { /** * Configuration for event_output pricing */ @@ -929,110 +10735,25 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ grouping_key?: string | null; } - } - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove from on the plan. - */ - adjustment_id: string; - - /** - * The phase to remove this adjustment from. - */ - plan_phase_order?: number | null; - } - - export interface RemovePrice { - /** - * The id of the price to remove from the plan. - */ - price_id: string; - - /** - * The phase to remove this price from. - */ - plan_phase_order?: number | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the plan. - */ - adjustment: - | Shared.NewPercentageDiscount - | Shared.NewUsageDiscount - | Shared.NewAmountDiscount - | Shared.NewMinimum - | Shared.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the plan. - */ - replaces_adjustment_id: string; - - /** - * The phase to replace this adjustment from. - */ - plan_phase_order?: number | null; - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the plan. - */ - replaces_price_id: string; - /** - * The allocation price to add to the plan. - */ - allocation_price?: Shared.NewAllocationPrice | null; + export interface LicenseAllocation { + /** + * The amount of credits granted per active license per cadence. + */ + amount: string; - /** - * The phase to replace this price from. - */ - plan_phase_order?: number | null; + /** + * The currency of the license allocation. + */ + currency: string; - /** - * New plan price request body params. - */ - price?: - | Shared.NewPlanUnitPrice - | Shared.NewPlanTieredPrice - | Shared.NewPlanBulkPrice - | ReplacePrice.NewPlanBulkWithFiltersPrice - | Shared.NewPlanPackagePrice - | Shared.NewPlanMatrixPrice - | Shared.NewPlanThresholdTotalAmountPrice - | Shared.NewPlanTieredPackagePrice - | Shared.NewPlanTieredWithMinimumPrice - | Shared.NewPlanGroupedTieredPrice - | Shared.NewPlanTieredPackageWithMinimumPrice - | Shared.NewPlanPackageWithAllocationPrice - | Shared.NewPlanUnitWithPercentPrice - | Shared.NewPlanMatrixWithAllocationPrice - | ReplacePrice.NewPlanTieredWithProrationPrice - | Shared.NewPlanUnitWithProrationPrice - | Shared.NewPlanGroupedAllocationPrice - | Shared.NewPlanBulkWithProrationPrice - | Shared.NewPlanGroupedWithProratedMinimumPrice - | Shared.NewPlanGroupedWithMeteredMinimumPrice - | ReplacePrice.NewPlanGroupedWithMinMaxThresholdsPrice - | Shared.NewPlanMatrixWithDisplayNamePrice - | Shared.NewPlanGroupedTieredPackagePrice - | Shared.NewPlanMaxGroupTieredPackagePrice - | Shared.NewPlanScalableMatrixWithUnitPricingPrice - | Shared.NewPlanScalableMatrixWithTieredPricingPrice - | Shared.NewPlanCumulativeGroupedBulkPrice - | ReplacePrice.NewPlanCumulativeGroupedAllocationPrice - | Shared.NewPlanMinimumCompositePrice - | ReplacePrice.NewPlanPercentCompositePrice - | ReplacePrice.NewPlanEventOutputPrice - | null; - } + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; + } + } - export namespace ReplacePrice { export interface NewPlanBulkWithFiltersPrice { /** * Configuration for bulk_with_filters pricing @@ -1120,6 +10841,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -1270,6 +10996,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -1401,6 +11132,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -1529,6 +11265,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -1657,6 +11398,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 @@ -1770,6 +11516,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { */ 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 diff --git a/src/resources/coupons/coupons.ts b/src/resources/coupons/coupons.ts index 98d9bf38..fad6e8ca 100644 --- a/src/resources/coupons/coupons.ts +++ b/src/resources/coupons/coupons.ts @@ -8,6 +8,9 @@ import * as SubscriptionsAPI from './subscriptions'; import { SubscriptionListParams, Subscriptions } from './subscriptions'; import { Page, type PageParams } from '../../pagination'; +/** + * A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users. + */ export class Coupons extends APIResource { subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this._client); diff --git a/src/resources/coupons/subscriptions.ts b/src/resources/coupons/subscriptions.ts index cdb02554..a9328087 100644 --- a/src/resources/coupons/subscriptions.ts +++ b/src/resources/coupons/subscriptions.ts @@ -7,6 +7,9 @@ import * as SubscriptionsAPI from '../subscriptions'; import { SubscriptionsPage } from '../subscriptions'; import { type PageParams } from '../../pagination'; +/** + * A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users. + */ export class Subscriptions extends APIResource { /** * This endpoint returns a list of all subscriptions that have redeemed a given diff --git a/src/resources/credit-blocks.ts b/src/resources/credit-blocks.ts index ac8a8e9c..1af96b1f 100644 --- a/src/resources/credit-blocks.ts +++ b/src/resources/credit-blocks.ts @@ -2,7 +2,11 @@ import { APIResource } from '../resource'; import * as Core from '../core'; +import * as Shared from './shared'; +/** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + */ export class CreditBlocks extends APIResource { /** * This endpoint returns a credit block identified by its block_id. @@ -34,6 +38,29 @@ export class CreditBlocks extends APIResource { headers: { Accept: '*/*', ...options?.headers }, }); } + + /** + * This endpoint returns the credit block and its associated purchasing invoices. + * + * If a credit block was purchased (as opposed to being manually added or allocated + * from a subscription), this endpoint returns the invoices that were created to + * charge the customer for the credit block. For credit blocks with payment + * schedules spanning multiple periods (e.g., monthly payments over 12 months), + * multiple invoices will be returned. + * + * If the credit block was not purchased (e.g., manual increment, allocation), an + * empty invoices list is returned. + * + * **Note: This endpoint is currently experimental and its interface may change in + * future releases. Please contact support before building production integrations + * against this endpoint.** + */ + listInvoices( + blockId: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get(`/credit_blocks/${blockId}/invoices`, options); + } } /** @@ -52,6 +79,14 @@ export interface CreditBlockRetrieveResponse { maximum_initial_balance: number | 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 }; + per_unit_cost_basis: string | null; status: 'active' | 'pending_payment'; @@ -76,6 +111,80 @@ export namespace CreditBlockRetrieveResponse { } } +export interface CreditBlockListInvoicesResponse { + /** + * The Credit Block resource models prepaid credits within Orb. + */ + block: CreditBlockListInvoicesResponse.Block; + + invoices: Array; +} + +export namespace CreditBlockListInvoicesResponse { + /** + * The Credit Block resource models prepaid credits within Orb. + */ + export interface Block { + id: string; + + balance: number; + + effective_date: string | null; + + expiry_date: string | null; + + filters: Array; + + maximum_initial_balance: number | 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 }; + + per_unit_cost_basis: string | null; + + status: 'active' | 'pending_payment'; + } + + export namespace Block { + export interface Filter { + /** + * The property of the price to filter on. + */ + field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + + /** + * Should prices that match the filter be included or excluded. + */ + operator: 'includes' | 'excludes'; + + /** + * The IDs or values that match this filter. + */ + values: Array; + } + } + + export interface Invoice { + id: string; + + customer: Shared.CustomerMinified; + + invoice_number: string; + + status: 'issued' | 'paid' | 'synced' | 'void' | 'draft'; + + subscription: Shared.SubscriptionMinified | null; + } +} + export declare namespace CreditBlocks { - export { type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse }; + export { + type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse, + type CreditBlockListInvoicesResponse as CreditBlockListInvoicesResponse, + }; } diff --git a/src/resources/credit-notes.ts b/src/resources/credit-notes.ts index 1b2467ea..2563ce7b 100644 --- a/src/resources/credit-notes.ts +++ b/src/resources/credit-notes.ts @@ -7,6 +7,10 @@ import * as Shared from './shared'; import { CreditNotesPage } from './shared'; import { type PageParams } from '../pagination'; +/** + * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + * particular invoice. + */ export class CreditNotes extends APIResource { /** * This endpoint is used to create a single diff --git a/src/resources/customers/balance-transactions.ts b/src/resources/customers/balance-transactions.ts index 2e78634f..769b5c07 100644 --- a/src/resources/customers/balance-transactions.ts +++ b/src/resources/customers/balance-transactions.ts @@ -6,6 +6,22 @@ import * as Core from '../../core'; import * as Shared from '../shared'; import { Page, type PageParams } from '../../pagination'; +/** + * A customer is a buyer of your products, and the other party to the billing relationship. + * + * In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these + * match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an + * `external_customer_id` with your own identifier. See + * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these + * aliases work in Orb. + * + * In addition to having an identifier in your system, a customer may exist in a payment provider solution like + * Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping. + * + * A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which + * defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for + * information on what this timezone parameter influences within Orb. + */ export class BalanceTransactions extends APIResource { /** * Creates an immutable balance transaction that updates the customer's balance and diff --git a/src/resources/customers/costs.ts b/src/resources/customers/costs.ts index b7a76c00..37b65b5c 100644 --- a/src/resources/customers/costs.ts +++ b/src/resources/customers/costs.ts @@ -5,6 +5,22 @@ import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as Shared from '../shared'; +/** + * A customer is a buyer of your products, and the other party to the billing relationship. + * + * In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these + * match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an + * `external_customer_id` with your own identifier. See + * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these + * aliases work in Orb. + * + * In addition to having an identifier in your system, a customer may exist in a payment provider solution like + * Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping. + * + * A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which + * defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for + * information on what this timezone parameter influences within Orb. + */ export class Costs extends APIResource { /** * This endpoint is used to fetch a day-by-day snapshot of a customer's costs in diff --git a/src/resources/customers/credits/credits.ts b/src/resources/customers/credits/credits.ts index 6e031476..45fe2561 100644 --- a/src/resources/customers/credits/credits.ts +++ b/src/resources/customers/credits/credits.ts @@ -42,6 +42,9 @@ import { } from './top-ups'; import { Page, type PageParams } from '../../../pagination'; +/** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + */ export class Credits extends APIResource { ledger: LedgerAPI.Ledger = new LedgerAPI.Ledger(this._client); topUps: TopUpsAPI.TopUps = new TopUpsAPI.TopUps(this._client); @@ -54,6 +57,11 @@ export class Credits extends APIResource { * * Note that `currency` defaults to credits if not specified. To use a real world * currency, set `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the + * `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and + * `effective_date[lte]` query parameters. This filters on when the credit block + * becomes effective, which may differ from creation time for backdated credits. */ list( customerId: string, @@ -86,6 +94,11 @@ export class Credits extends APIResource { * * Note that `currency` defaults to credits if not specified. To use a real world * currency, set `currency` to an ISO 4217 string. + * + * Results can be filtered by the block's `effective_date` using the + * `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and + * `effective_date[lte]` query parameters. This filters on when the credit block + * becomes effective, which may differ from creation time for backdated credits. */ listByExternalId( externalCustomerId: string, @@ -129,6 +142,14 @@ export interface CreditListResponse { maximum_initial_balance: number | 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 }; + per_unit_cost_basis: string | null; status: 'active' | 'pending_payment'; @@ -169,6 +190,14 @@ export interface CreditListByExternalIDResponse { maximum_initial_balance: number | 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 }; + per_unit_cost_basis: string | null; status: 'active' | 'pending_payment'; @@ -202,6 +231,14 @@ export interface CreditListParams extends PageParams { */ currency?: string | null; + 'effective_date[gt]'?: string | null; + + 'effective_date[gte]'?: string | null; + + 'effective_date[lt]'?: string | null; + + 'effective_date[lte]'?: string | null; + /** * If set to True, all expired and depleted blocks, as well as active block will be * returned. @@ -215,6 +252,14 @@ export interface CreditListByExternalIDParams extends PageParams { */ currency?: string | null; + 'effective_date[gt]'?: string | null; + + 'effective_date[gte]'?: string | null; + + 'effective_date[lt]'?: string | null; + + 'effective_date[lte]'?: string | null; + /** * If set to True, all expired and depleted blocks, as well as active block will be * returned. diff --git a/src/resources/customers/credits/ledger.ts b/src/resources/customers/credits/ledger.ts index 88692464..8ec352fd 100644 --- a/src/resources/customers/credits/ledger.ts +++ b/src/resources/customers/credits/ledger.ts @@ -6,6 +6,9 @@ import * as Core from '../../../core'; import * as Shared from '../../shared'; import { Page, type PageParams } from '../../../pagination'; +/** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + */ export class Ledger extends APIResource { /** * The credits ledger provides _auditing_ functionality over Orb's credits system @@ -162,7 +165,14 @@ export class Ledger extends APIResource { * also generate a one-off invoice for the customer for the credits pre-purchase. * Note that you _must_ provide the `per_unit_cost_basis`, since the total charges * on the invoice are calculated by multiplying the cost basis with the number of - * credit units added. + * credit units added. If you invoice or handle payment of credits outside of Orb + * (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + * `true` to prevent duplicate invoicing effects. + * + * - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + * and `invoice_settings` must be included + * - if `invoice_settings` is passed, one of either `custom_due_date` or + * `net_terms` is required to determine the due date * * ## Deducting Credits * @@ -282,7 +292,14 @@ export class Ledger extends APIResource { * also generate a one-off invoice for the customer for the credits pre-purchase. * Note that you _must_ provide the `per_unit_cost_basis`, since the total charges * on the invoice are calculated by multiplying the cost basis with the number of - * credit units added. + * credit units added. If you invoice or handle payment of credits outside of Orb + * (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + * `true` to prevent duplicate invoicing effects. + * + * - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + * and `invoice_settings` must be included + * - if `invoice_settings` is passed, one of either `custom_due_date` or + * `net_terms` is required to determine the due date * * ## Deducting Credits * @@ -957,6 +974,11 @@ export declare namespace LedgerCreateEntryParams { */ item_id?: string | null; + /** + * If true, the new credits purchase invoice will be marked as paid. + */ + mark_as_paid?: boolean; + /** * An optional memo to display on the invoice. */ @@ -967,7 +989,8 @@ export declare namespace LedgerCreateEntryParams { * based on the invoice or issuance date, depending on the account's configured due * date calculation method. A value of '0' here represents that the invoice is due * on issue, whereas a value of '30' represents that the customer has 30 days to - * pay the invoice. Do not set this field if you want to set a custom due date. + * pay the invoice. You must set either `net_terms` or `custom_due_date`, but not + * both. */ net_terms?: number | null; @@ -1255,6 +1278,11 @@ export declare namespace LedgerCreateEntryByExternalIDParams { */ item_id?: string | null; + /** + * If true, the new credits purchase invoice will be marked as paid. + */ + mark_as_paid?: boolean; + /** * An optional memo to display on the invoice. */ @@ -1265,7 +1293,8 @@ export declare namespace LedgerCreateEntryByExternalIDParams { * based on the invoice or issuance date, depending on the account's configured due * date calculation method. A value of '0' here represents that the invoice is due * on issue, whereas a value of '30' represents that the customer has 30 days to - * pay the invoice. Do not set this field if you want to set a custom due date. + * pay the invoice. You must set either `net_terms` or `custom_due_date`, but not + * both. */ net_terms?: number | null; diff --git a/src/resources/customers/credits/top-ups.ts b/src/resources/customers/credits/top-ups.ts index e3f5db40..1b05bfa0 100644 --- a/src/resources/customers/credits/top-ups.ts +++ b/src/resources/customers/credits/top-ups.ts @@ -5,6 +5,9 @@ import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import { Page, type PageParams } from '../../../pagination'; +/** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + */ export class TopUps extends APIResource { /** * This endpoint allows you to create a new top-up for a specified customer's diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts index e1e99e73..be649d74 100644 --- a/src/resources/customers/customers.ts +++ b/src/resources/customers/customers.ts @@ -33,6 +33,22 @@ import { } from './credits/credits'; import { Page, type PageParams } from '../../pagination'; +/** + * A customer is a buyer of your products, and the other party to the billing relationship. + * + * In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these + * match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an + * `external_customer_id` with your own identifier. See + * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these + * aliases work in Orb. + * + * In addition to having an identifier in your system, a customer may exist in a payment provider solution like + * Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping. + * + * A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which + * defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for + * information on what this timezone parameter influences within Orb. + */ export class Customers extends APIResource { costs: CostsAPI.Costs = new CostsAPI.Costs(this._client); credits: CreditsAPI.Credits = new CreditsAPI.Credits(this._client); @@ -60,9 +76,10 @@ export class Customers extends APIResource { /** * This endpoint can be used to update the `payment_provider`, * `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, - * `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and - * `additional_emails` of an existing customer. Other fields on a customer are - * currently immutable. + * `auto_collection`, `metadata`, `shipping_address`, `billing_address`, + * `additional_emails`, and `currency` of an existing customer. `currency` can only + * be set if it has not already been set on the customer. Other fields on a + * customer are currently immutable. */ update( customerId: string, @@ -947,8 +964,10 @@ export interface CustomerUpdateParams { billing_address?: AddressInput | null; /** - * An ISO 4217 currency string used for the customer's invoices and balance. If not - * set at creation time, will be set at subscription creation time. + * An ISO 4217 currency string used for the customer's invoices and balance. This + * can only be set if the customer does not already have a currency configured. If + * not set at creation or update time, it will be set at subscription creation + * time. */ currency?: string | null; @@ -1276,8 +1295,10 @@ export interface CustomerUpdateByExternalIDParams { billing_address?: AddressInput | null; /** - * An ISO 4217 currency string used for the customer's invoices and balance. If not - * set at creation time, will be set at subscription creation time. + * An ISO 4217 currency string used for the customer's invoices and balance. This + * can only be set if the customer does not already have a currency configured. If + * not set at creation or update time, it will be set at subscription creation + * time. */ currency?: string | null; diff --git a/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts b/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts index 0250df26..f720a9bd 100644 --- a/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +++ b/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts @@ -42,7 +42,7 @@ export interface ExternalDimensionalPriceGroupIDUpdateParams { * field to identify a dimensional price group by an existing identifier in your * system. */ - body_external_dimensional_price_group_id?: string | null; + external_dimensional_price_group_id?: string | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed diff --git a/src/resources/events/backfills.ts b/src/resources/events/backfills.ts index 093ec5ff..9a2cc8c7 100644 --- a/src/resources/events/backfills.ts +++ b/src/resources/events/backfills.ts @@ -5,6 +5,11 @@ import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import { Page, type PageParams } from '../../pagination'; +/** + * The [Event](/core-concepts#event) resource represents a usage event that has been created for a + * customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for + * a given billing period. + */ export class Backfills extends APIResource { /** * Creating the backfill enables adding or replacing past events, even those that diff --git a/src/resources/events/events.ts b/src/resources/events/events.ts index 6f2ba833..eda982d8 100644 --- a/src/resources/events/events.ts +++ b/src/resources/events/events.ts @@ -17,6 +17,11 @@ import { import * as VolumeAPI from './volume'; import { EventVolumes, Volume, VolumeListParams } from './volume'; +/** + * The [Event](/core-concepts#event) resource represents a usage event that has been created for a + * customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for + * a given billing period. + */ export class Events extends APIResource { backfills: BackfillsAPI.Backfills = new BackfillsAPI.Backfills(this._client); volume: VolumeAPI.Volume = new VolumeAPI.Volume(this._client); diff --git a/src/resources/events/volume.ts b/src/resources/events/volume.ts index 6440ca6e..b70b7646 100644 --- a/src/resources/events/volume.ts +++ b/src/resources/events/volume.ts @@ -3,6 +3,11 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +/** + * The [Event](/core-concepts#event) resource represents a usage event that has been created for a + * customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for + * a given billing period. + */ export class Volume extends APIResource { /** * This endpoint returns the event volume for an account in a diff --git a/src/resources/index.ts b/src/resources/index.ts index ee5da84b..bf4c7f46 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -36,7 +36,11 @@ export { type CouponCreateParams, type CouponListParams, } from './coupons/coupons'; -export { CreditBlocks, type CreditBlockRetrieveResponse } from './credit-blocks'; +export { + CreditBlocks, + type CreditBlockRetrieveResponse, + type CreditBlockListInvoicesResponse, +} from './credit-blocks'; export { CreditNotes, type CreditNoteCreateParams, type CreditNoteListParams } from './credit-notes'; export { CustomersPage, @@ -82,12 +86,14 @@ export { InvoiceListSummaryResponsesPage, Invoices, type InvoiceFetchUpcomingResponse, + type InvoiceIssueSummaryResponse, type InvoiceListSummaryResponse, type InvoiceCreateParams, type InvoiceUpdateParams, type InvoiceListParams, type InvoiceFetchUpcomingParams, type InvoiceIssueParams, + type InvoiceIssueSummaryParams, type InvoiceListSummaryParams, type InvoiceMarkPaidParams, } from './invoices'; @@ -99,6 +105,28 @@ export { type ItemUpdateParams, type ItemListParams, } from './items'; +export { + LicenseListResponsesPage, + Licenses, + type LicenseCreateResponse, + type LicenseRetrieveResponse, + type LicenseListResponse, + type LicenseDeactivateResponse, + type LicenseRetrieveByExternalIDResponse, + type LicenseCreateParams, + type LicenseListParams, + type LicenseDeactivateParams, + type LicenseRetrieveByExternalIDParams, +} from './licenses/licenses'; +export { + LicenseTypeListResponsesPage, + LicenseTypes, + type LicenseTypeCreateResponse, + type LicenseTypeRetrieveResponse, + type LicenseTypeListResponse, + type LicenseTypeCreateParams, + type LicenseTypeListParams, +} from './license-types'; export { PlansPage, Plans, diff --git a/src/resources/invoice-line-items.ts b/src/resources/invoice-line-items.ts index 7fabadec..bc7b1917 100644 --- a/src/resources/invoice-line-items.ts +++ b/src/resources/invoice-line-items.ts @@ -4,6 +4,12 @@ import { APIResource } from '../resource'; import * as Core from '../core'; import * as Shared from './shared'; +/** + * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for + * a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and + * can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as + * the result of an action, such as a cancellation. + */ export class InvoiceLineItems extends APIResource { /** * This creates a one-off fixed fee invoice line item on an Invoice. This can only diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts index 8f4aa068..206df383 100644 --- a/src/resources/invoices.ts +++ b/src/resources/invoices.ts @@ -7,6 +7,12 @@ import * as Shared from './shared'; import { InvoicesPage } from './shared'; import { Page, type PageParams } from '../pagination'; +/** + * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for + * a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and + * can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as + * the result of an action, such as a cancellation. + */ export class Invoices extends APIResource { /** * This endpoint is used to create a one-off invoice for a customer. @@ -16,13 +22,14 @@ export class Invoices extends APIResource { } /** - * This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and - * `invoice_date` properties on an invoice. If you pass null for the metadata - * value, it will clear any existing metadata for that invoice. + * This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, + * `invoice_date`, and `auto_collection` properties on an invoice. If you pass null + * for the metadata value, it will clear any existing metadata for that invoice. * * `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`, - * and `invoice_date` can only be modified if the invoice is in a `draft` state. - * `invoice_date` can only be modified for non-subscription invoices. + * `invoice_date`, and `auto_collection` can only be modified if the invoice is in + * a `draft` state. `invoice_date` can only be modified for non-subscription + * invoices. */ update( invoiceId: string, @@ -125,6 +132,37 @@ export class Invoices extends APIResource { return this._client.post(`/invoices/${invoiceId}/issue`, { body, ...options }); } + /** + * This endpoint allows an eligible invoice to be issued manually. This is only + * possible with invoices where status is `draft`, `will_auto_issue` is false, and + * an `eligible_to_issue_at` is a time in the past. Issuing an invoice could + * possibly trigger side effects, some of which could be customer-visible (e.g. + * sending emails, auto-collecting payment, syncing the invoice to external + * providers, etc). + * + * This is a lighter-weight alternative to the issue invoice endpoint, returning an + * invoice summary without any line item details. + */ + issueSummary( + invoiceId: string, + body?: InvoiceIssueSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + issueSummary( + invoiceId: string, + options?: Core.RequestOptions, + ): Core.APIPromise; + issueSummary( + invoiceId: string, + body: InvoiceIssueSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(body)) { + return this.issueSummary(invoiceId, {}, body); + } + return this._client.post(`/invoices/summary/${invoiceId}/issue`, { body, ...options }); + } + /** * This is a lighter-weight endpoint that returns a list of all * [`Invoice`](/core-concepts#invoice) summaries for an account in a list format. @@ -789,6 +827,458 @@ export namespace InvoiceFetchUpcomingResponse { } } +/** + * #InvoiceApiResourceWithoutLineItems + */ +export interface InvoiceIssueSummaryResponse { + id: string; + + /** + * This is the final amount required to be charged to the customer and reflects the + * application of the customer balance to the `total` of the invoice. + */ + amount_due: string; + + auto_collection: InvoiceIssueSummaryResponse.AutoCollection; + + billing_address: Shared.Address | null; + + /** + * The creation time of the resource in Orb. + */ + created_at: string; + + /** + * A list of credit notes associated with the invoice + */ + credit_notes: Array; + + /** + * An ISO 4217 currency string or `credits` + */ + currency: string; + + customer: Shared.CustomerMinified; + + customer_balance_transactions: Array; + + /** + * Tax IDs are commonly required to be displayed on customer invoices, which are + * added to the headers of invoices. + * + * ### Supported Tax ID Countries and Types + * + * | Country | Type | Description | + * | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + * | Albania | `al_tin` | Albania Tax Identification Number | + * | Andorra | `ad_nrt` | Andorran NRT Number | + * | Angola | `ao_tin` | Angola Tax Identification Number | + * | Argentina | `ar_cuit` | Argentinian Tax ID Number | + * | Armenia | `am_tin` | Armenia Tax Identification Number | + * | Aruba | `aw_tin` | Aruba Tax Identification Number | + * | Australia | `au_abn` | Australian Business Number (AU ABN) | + * | Australia | `au_arn` | Australian Taxation Office Reference Number | + * | Austria | `eu_vat` | European VAT Number | + * | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + * | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + * | Bahrain | `bh_vat` | Bahraini VAT Number | + * | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + * | Barbados | `bb_tin` | Barbados Tax Identification Number | + * | Belarus | `by_tin` | Belarus TIN Number | + * | Belgium | `eu_vat` | European VAT Number | + * | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + * | Bolivia | `bo_tin` | Bolivian Tax ID | + * | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + * | Brazil | `br_cnpj` | Brazilian CNPJ Number | + * | Brazil | `br_cpf` | Brazilian CPF Number | + * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + * | Bulgaria | `eu_vat` | European VAT Number | + * | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + * | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + * | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + * | Canada | `ca_bn` | Canadian BN | + * | Canada | `ca_gst_hst` | Canadian GST/HST Number | + * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + * | Canada | `ca_qst` | Canadian QST Number (Québec) | + * | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + * | Chile | `cl_tin` | Chilean TIN | + * | China | `cn_tin` | Chinese Tax ID | + * | Colombia | `co_nit` | Colombian NIT Number | + * | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + * | Costa Rica | `cr_tin` | Costa Rican Tax ID | + * | Croatia | `eu_vat` | European VAT Number | + * | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + * | Cyprus | `eu_vat` | European VAT Number | + * | Czech Republic | `eu_vat` | European VAT Number | + * | Denmark | `eu_vat` | European VAT Number | + * | Dominican Republic | `do_rcn` | Dominican RCN Number | + * | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + * | Egypt | `eg_tin` | Egyptian Tax Identification Number | + * | El Salvador | `sv_nit` | El Salvadorian NIT Number | + * | Estonia | `eu_vat` | European VAT Number | + * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + * | Finland | `eu_vat` | European VAT Number | + * | France | `eu_vat` | European VAT Number | + * | Georgia | `ge_vat` | Georgian VAT | + * | Germany | `de_stn` | German Tax Number (Steuernummer) | + * | Germany | `eu_vat` | European VAT Number | + * | Greece | `eu_vat` | European VAT Number | + * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + * | Hong Kong | `hk_br` | Hong Kong BR Number | + * | Hungary | `eu_vat` | European VAT Number | + * | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + * | Iceland | `is_vat` | Icelandic VAT | + * | India | `in_gst` | Indian GST Number | + * | Indonesia | `id_npwp` | Indonesian NPWP Number | + * | Ireland | `eu_vat` | European VAT Number | + * | Israel | `il_vat` | Israel VAT | + * | Italy | `eu_vat` | European VAT Number | + * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + * | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + * | Laos | `la_tin` | Laos Tax Identification Number | + * | Latvia | `eu_vat` | European VAT Number | + * | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + * | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + * | Lithuania | `eu_vat` | European VAT Number | + * | Luxembourg | `eu_vat` | European VAT Number | + * | Malaysia | `my_frp` | Malaysian FRP Number | + * | Malaysia | `my_itn` | Malaysian ITN | + * | Malaysia | `my_sst` | Malaysian SST Number | + * | Malta | `eu_vat` | European VAT Number | + * | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + * | Mexico | `mx_rfc` | Mexican RFC Number | + * | Moldova | `md_vat` | Moldova VAT Number | + * | Montenegro | `me_pib` | Montenegro PIB Number | + * | Morocco | `ma_vat` | Morocco VAT Number | + * | Nepal | `np_pan` | Nepal PAN Number | + * | Netherlands | `eu_vat` | European VAT Number | + * | New Zealand | `nz_gst` | New Zealand GST Number | + * | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + * | North Macedonia | `mk_vat` | North Macedonia VAT Number | + * | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + * | Norway | `no_vat` | Norwegian VAT Number | + * | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + * | Oman | `om_vat` | Omani VAT Number | + * | Peru | `pe_ruc` | Peruvian RUC Number | + * | Philippines | `ph_tin` | Philippines Tax Identification Number | + * | Poland | `eu_vat` | European VAT Number | + * | Poland | `pl_nip` | Polish Tax ID Number | + * | Portugal | `eu_vat` | European VAT Number | + * | Romania | `eu_vat` | European VAT Number | + * | Romania | `ro_tin` | Romanian Tax ID Number | + * | Russia | `ru_inn` | Russian INN | + * | Russia | `ru_kpp` | Russian KPP | + * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + * | Senegal | `sn_ninea` | Senegal NINEA Number | + * | Serbia | `rs_pib` | Serbian PIB Number | + * | Singapore | `sg_gst` | Singaporean GST | + * | Singapore | `sg_uen` | Singaporean UEN | + * | Slovakia | `eu_vat` | European VAT Number | + * | Slovenia | `eu_vat` | European VAT Number | + * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + * | South Africa | `za_vat` | South African VAT Number | + * | South Korea | `kr_brn` | Korean BRN | + * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + * | Spain | `eu_vat` | European VAT Number | + * | Suriname | `sr_fin` | Suriname FIN Number | + * | Sweden | `eu_vat` | European VAT Number | + * | Switzerland | `ch_uid` | Switzerland UID Number | + * | Switzerland | `ch_vat` | Switzerland VAT Number | + * | Taiwan | `tw_vat` | Taiwanese VAT | + * | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + * | Tanzania | `tz_vat` | Tanzania VAT Number | + * | Thailand | `th_vat` | Thai VAT | + * | Turkey | `tr_tin` | Turkish Tax Identification Number | + * | Uganda | `ug_tin` | Uganda Tax Identification Number | + * | Ukraine | `ua_vat` | Ukrainian VAT | + * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + * | United Kingdom | `gb_vat` | United Kingdom VAT Number | + * | United States | `us_ein` | United States EIN | + * | Uruguay | `uy_ruc` | Uruguayan RUC Number | + * | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + * | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + * | Venezuela | `ve_rif` | Venezuelan RIF Number | + * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + * | Zambia | `zm_tin` | Zambia Tax Identification Number | + * | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + */ + customer_tax_id: Shared.CustomerTaxID | null; + + /** + * When the invoice payment is due. The due date is null if the invoice is not yet + * finalized. + */ + due_date: string | null; + + /** + * If the invoice has a status of `draft`, this will be the time that the invoice + * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + * true, the invoice will automatically begin issuing at this time. + */ + eligible_to_issue_at: string | null; + + /** + * A URL for the customer-facing invoice portal. This URL expires 30 days after the + * invoice's due date, or 60 days after being re-generated through the UI. + */ + hosted_invoice_url: string | null; + + /** + * The scheduled date of the invoice + */ + invoice_date: string; + + /** + * Automatically generated invoice number to help track and reconcile invoices. + * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + * account or customer. + */ + invoice_number: string; + + /** + * The link to download the PDF representation of the `Invoice`. + */ + invoice_pdf: string | null; + + invoice_source: 'subscription' | 'partial' | 'one_off'; + + /** + * If the invoice failed to issue, this will be the last time it failed to issue + * (even if it is now in a different state.) + */ + issue_failed_at: string | null; + + /** + * If the invoice has been issued, this will be the time it transitioned to + * `issued` (even if it is now in a different state.) + */ + issued_at: string | null; + + /** + * Free-form text which is available on the invoice PDF and the Orb invoice portal. + */ + memo: 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 }; + + /** + * If the invoice has a status of `paid`, this gives a timestamp when the invoice + * was paid. + */ + paid_at: string | null; + + /** + * A list of payment attempts associated with the invoice + */ + payment_attempts: Array; + + /** + * If payment was attempted on this invoice but failed, this will be the time of + * the most recent attempt. + */ + payment_failed_at: string | null; + + /** + * If payment was attempted on this invoice, this will be the start time of the + * most recent attempt. This field is especially useful for delayed-notification + * payment mechanisms (like bank transfers), where payment can take 3 days or more. + */ + payment_started_at: string | null; + + /** + * If the invoice is in draft, this timestamp will reflect when the invoice is + * scheduled to be issued. + */ + scheduled_issue_at: string | null; + + shipping_address: Shared.Address | null; + + status: 'issued' | 'paid' | 'synced' | 'void' | 'draft'; + + subscription: Shared.SubscriptionMinified | null; + + /** + * If the invoice failed to sync, this will be the last time an external invoicing + * provider sync was attempted. This field will always be `null` for invoices using + * Orb Invoicing. + */ + sync_failed_at: string | null; + + /** + * The total after any minimums and discounts have been applied. + */ + total: string; + + /** + * If the invoice has a status of `void`, this gives a timestamp when the invoice + * was voided. + */ + voided_at: string | null; + + /** + * This is true if the invoice will be automatically issued in the future, and + * false otherwise. + */ + will_auto_issue: boolean; +} + +export namespace InvoiceIssueSummaryResponse { + export interface AutoCollection { + /** + * True only if auto-collection is enabled for this invoice. + */ + enabled: boolean | null; + + /** + * If the invoice is scheduled for auto-collection, this field will reflect when + * the next attempt will occur. If dunning has been exhausted, or auto-collection + * is not enabled for this invoice, this field will be `null`. + */ + next_attempt_at: string | null; + + /** + * Number of auto-collection payment attempts. + */ + num_attempts: number | null; + + /** + * If Orb has ever attempted payment auto-collection for this invoice, this field + * will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + * this can be used to tell whether the invoice is currently in dunning (that is, + * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + * if dunning has been exhausted (`previously_attempted_at` is non-null, but + * `next_attempt_time` is null). + */ + previously_attempted_at: string | null; + } + + export interface CreditNote { + id: string; + + credit_note_number: string; + + /** + * An optional memo supplied on the credit note. + */ + memo: string | null; + + reason: string; + + total: string; + + type: string; + + /** + * If the credit note has a status of `void`, this gives a timestamp when the + * credit note was voided. + */ + voided_at: string | null; + } + + export interface CustomerBalanceTransaction { + /** + * A unique id for this transaction. + */ + id: string; + + action: + | 'applied_to_invoice' + | 'manual_adjustment' + | 'prorated_refund' + | 'revert_prorated_refund' + | 'return_from_voiding' + | 'credit_note_applied' + | 'credit_note_voided' + | 'overpayment_refund' + | 'external_payment' + | 'small_invoice_carryover'; + + /** + * The value of the amount changed in the transaction. + */ + amount: string; + + /** + * The creation time of this transaction. + */ + created_at: string; + + credit_note: Shared.CreditNoteTiny | null; + + /** + * An optional description provided for manual customer balance adjustments. + */ + description: string | null; + + /** + * The new value of the customer's balance prior to the transaction, in the + * customer's currency. + */ + ending_balance: string; + + invoice: Shared.InvoiceTiny | null; + + /** + * The original value of the customer's balance prior to the transaction, in the + * customer's currency. + */ + starting_balance: string; + + type: 'increment' | 'decrement'; + } + + export interface PaymentAttempt { + /** + * The ID of the payment attempt. + */ + id: string; + + /** + * The amount of the payment attempt. + */ + amount: string; + + /** + * The time at which the payment attempt was created. + */ + created_at: string; + + /** + * The payment provider that attempted to collect the payment. + */ + payment_provider: 'stripe' | null; + + /** + * The ID of the payment attempt in the payment provider. + */ + payment_provider_id: string | null; + + /** + * URL to the downloadable PDF version of the receipt. This field will be `null` + * for payment attempts that did not succeed. + */ + receipt_pdf: string | null; + + /** + * Whether the payment attempt succeeded. + */ + succeeded: boolean; + } +} + /** * #InvoiceApiResourceWithoutLineItems */ @@ -1256,6 +1746,13 @@ export interface InvoiceCreateParams { line_items: Array; + /** + * Determines whether this invoice will automatically attempt to charge a saved + * payment method, if any. If not specified, the invoice inherits the customer's + * auto_collection setting. + */ + auto_collection?: boolean | null; + /** * The id of the `Customer` to create this invoice for. One of `customer_id` and * `external_customer_id` are required. @@ -1343,6 +1840,13 @@ export namespace InvoiceCreateParams { } export interface InvoiceUpdateParams { + /** + * Determines whether this invoice will automatically attempt to charge a saved + * payment method, if any. Can only be modified on draft invoices. If not + * specified, the invoice's existing setting is unchanged. + */ + auto_collection?: boolean | null; + /** * An optional custom due date for the invoice. If not set, the due date will be * calculated based on the `net_terms` value. @@ -1428,6 +1932,17 @@ export interface InvoiceIssueParams { synchronous?: boolean; } +export interface InvoiceIssueSummaryParams { + /** + * If true, the invoice will be issued synchronously. If false, the invoice will be + * issued asynchronously. The synchronous option is only available for invoices + * that have no usage fees. If the invoice is configured to sync to an external + * provider, a successful response from this endpoint guarantees the invoice is + * present in the provider. + */ + synchronous?: boolean; +} + export interface InvoiceListSummaryParams extends PageParams { amount?: string | null; @@ -1465,7 +1980,7 @@ export interface InvoiceListSummaryParams extends PageParams { is_recurring?: boolean | null; - status?: Array<'draft' | 'issued' | 'paid' | 'synced' | 'void'> | null; + status?: 'draft' | 'issued' | 'paid' | 'synced' | 'void' | null; subscription_id?: string | null; } @@ -1492,6 +2007,7 @@ Invoices.InvoiceListSummaryResponsesPage = InvoiceListSummaryResponsesPage; export declare namespace Invoices { export { type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, + type InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse, type InvoiceListSummaryResponse as InvoiceListSummaryResponse, InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage, type InvoiceCreateParams as InvoiceCreateParams, @@ -1499,6 +2015,7 @@ export declare namespace Invoices { type InvoiceListParams as InvoiceListParams, type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams, type InvoiceIssueParams as InvoiceIssueParams, + type InvoiceIssueSummaryParams as InvoiceIssueSummaryParams, type InvoiceListSummaryParams as InvoiceListSummaryParams, type InvoiceMarkPaidParams as InvoiceMarkPaidParams, }; diff --git a/src/resources/items.ts b/src/resources/items.ts index 65ea0ca3..5d42e7e2 100644 --- a/src/resources/items.ts +++ b/src/resources/items.ts @@ -5,6 +5,10 @@ import { isRequestOptions } from '../core'; import * as Core from '../core'; import { Page, type PageParams } from '../pagination'; +/** + * The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics, + * and prices and are used for defining external sync behavior for invoices and tax calculation purposes. + */ export class Items extends APIResource { /** * This endpoint is used to create an [Item](/core-concepts#item). @@ -111,7 +115,8 @@ export namespace Item { | 'taxjar' | 'avalara' | 'anrok' - | 'numeral'; + | 'numeral' + | 'stripe_tax'; /** * The identifier of this item in the external system. @@ -164,7 +169,8 @@ export namespace ItemUpdateParams { | 'taxjar' | 'avalara' | 'anrok' - | 'numeral'; + | 'numeral' + | 'stripe_tax'; /** * The identifier of this item in the external system. diff --git a/src/resources/license-types.ts b/src/resources/license-types.ts new file mode 100644 index 00000000..d5fc4035 --- /dev/null +++ b/src/resources/license-types.ts @@ -0,0 +1,163 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../resource'; +import { isRequestOptions } from '../core'; +import * as Core from '../core'; +import { Page, type PageParams } from '../pagination'; + +/** + * The LicenseType resource represents a type of license that can be assigned to users. + * License types are used during billing by grouping metrics on the configured grouping key. + */ +export class LicenseTypes extends APIResource { + /** + * This endpoint is used to create a new license type. + * + * License types are used to group licenses and define billing behavior. Each + * license type has a name and a grouping key that determines how metrics are + * aggregated for billing purposes. + */ + create( + body: LicenseTypeCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post('/license_types', { body, ...options }); + } + + /** + * This endpoint returns a license type identified by its license_type_id. + * + * Use this endpoint to retrieve details about a specific license type, including + * its name and grouping key. + */ + retrieve( + licenseTypeId: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get(`/license_types/${licenseTypeId}`, options); + } + + /** + * This endpoint returns a list of all license types configured for the account, + * ordered in ascending order by creation time. + * + * License types are used to group licenses and define billing behavior. Each + * license type has a name and a grouping key that determines how metrics are + * aggregated for billing purposes. + */ + list( + query?: LicenseTypeListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + query: LicenseTypeListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.PagePromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return this._client.getAPIList('/license_types', LicenseTypeListResponsesPage, { query, ...options }); + } +} + +export class LicenseTypeListResponsesPage extends Page {} + +/** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ +export interface LicenseTypeCreateResponse { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; +} + +/** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ +export interface LicenseTypeRetrieveResponse { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; +} + +/** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ +export interface LicenseTypeListResponse { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; +} + +export interface LicenseTypeCreateParams { + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; +} + +export interface LicenseTypeListParams extends PageParams {} + +LicenseTypes.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage; + +export declare namespace LicenseTypes { + export { + type LicenseTypeCreateResponse as LicenseTypeCreateResponse, + type LicenseTypeRetrieveResponse as LicenseTypeRetrieveResponse, + type LicenseTypeListResponse as LicenseTypeListResponse, + LicenseTypeListResponsesPage as LicenseTypeListResponsesPage, + type LicenseTypeCreateParams as LicenseTypeCreateParams, + type LicenseTypeListParams as LicenseTypeListParams, + }; +} diff --git a/src/resources/licenses.ts b/src/resources/licenses.ts new file mode 100644 index 00000000..0bfd54db --- /dev/null +++ b/src/resources/licenses.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './licenses/index'; diff --git a/src/resources/licenses/external-licenses.ts b/src/resources/licenses/external-licenses.ts new file mode 100644 index 00000000..6b3f7e88 --- /dev/null +++ b/src/resources/licenses/external-licenses.ts @@ -0,0 +1,147 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; + +export class ExternalLicenses extends APIResource { + /** + * Returns usage and remaining credits for a license identified by its external + * license ID. + * + * Date range defaults to the current billing period if not specified. + */ + getUsage( + externalLicenseId: string, + query: ExternalLicenseGetUsageParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get(`/licenses/external_licenses/${externalLicenseId}/usage`, { query, ...options }); + } +} + +export interface ExternalLicenseGetUsageResponse { + data: Array; + + pagination_metadata: Shared.PaginationMetadata; +} + +export namespace ExternalLicenseGetUsageResponse { + /** + * The LicenseUsage resource represents usage and remaining credits for a license + * over a date range. + * + * When grouped by 'day' only, license_id and external_license_id will be null as + * the data is aggregated across all licenses. + */ + export interface Data { + /** + * The total credits allocated to this license for the period. + */ + allocated_credits: number; + + /** + * The credits consumed by this license for the period. + */ + consumed_credits: number; + + /** + * The end date of the usage period. + */ + end_date: string; + + /** + * The unique identifier for the license type. + */ + license_type_id: string; + + /** + * The pricing unit for the credits (e.g., 'credits'). + */ + pricing_unit: string; + + /** + * The remaining credits available for this license (allocated - consumed). + */ + remaining_credits: number; + + /** + * The start date of the usage period. + */ + start_date: string; + + /** + * The unique identifier for the subscription. + */ + subscription_id: string; + + /** + * Credits consumed while the license was active (eligible for individual + * allocation deduction). + */ + allocation_eligible_credits?: number | null; + + /** + * The external identifier for the license. Null when grouped by day only. + */ + external_license_id?: string | null; + + /** + * The unique identifier for the license. Null when grouped by day only. + */ + license_id?: string | null; + + /** + * Credits consumed while the license was inactive (draws from shared pool, not + * individual allocation). + */ + shared_pool_credits?: number | null; + } +} + +export interface ExternalLicenseGetUsageParams { + /** + * The license type ID to filter licenses by. + */ + license_type_id: string; + + /** + * The subscription ID to get license usage for. + */ + subscription_id: string; + + /** + * Pagination cursor from a previous request. + */ + cursor?: string | null; + + /** + * End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + * period. + */ + end_date?: string | null; + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + group_by?: Array | null; + + /** + * Maximum number of rows in the response data (default 20, max 100). + */ + limit?: number; + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current + * billing period. + */ + start_date?: string | null; +} + +export declare namespace ExternalLicenses { + export { + type ExternalLicenseGetUsageResponse as ExternalLicenseGetUsageResponse, + type ExternalLicenseGetUsageParams as ExternalLicenseGetUsageParams, + }; +} diff --git a/src/resources/licenses/index.ts b/src/resources/licenses/index.ts new file mode 100644 index 00000000..516a55d6 --- /dev/null +++ b/src/resources/licenses/index.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + ExternalLicenses, + type ExternalLicenseGetUsageResponse, + type ExternalLicenseGetUsageParams, +} from './external-licenses'; +export { + LicenseListResponsesPage, + Licenses, + type LicenseCreateResponse, + type LicenseRetrieveResponse, + type LicenseListResponse, + type LicenseDeactivateResponse, + type LicenseRetrieveByExternalIDResponse, + type LicenseCreateParams, + type LicenseListParams, + type LicenseDeactivateParams, + type LicenseRetrieveByExternalIDParams, +} from './licenses'; +export { + Usage, + type UsageGetAllUsageResponse, + type UsageGetUsageResponse, + type UsageGetAllUsageParams, + type UsageGetUsageParams, +} from './usage'; diff --git a/src/resources/licenses/licenses.ts b/src/resources/licenses/licenses.ts new file mode 100644 index 00000000..885bd221 --- /dev/null +++ b/src/resources/licenses/licenses.ts @@ -0,0 +1,248 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as ExternalLicensesAPI from './external-licenses'; +import { + ExternalLicenseGetUsageParams, + ExternalLicenseGetUsageResponse, + ExternalLicenses, +} from './external-licenses'; +import * as UsageAPI from './usage'; +import { + Usage, + UsageGetAllUsageParams, + UsageGetAllUsageResponse, + UsageGetUsageParams, + UsageGetUsageResponse, +} from './usage'; +import { Page, type PageParams } from '../../pagination'; + +export class Licenses extends APIResource { + externalLicenses: ExternalLicensesAPI.ExternalLicenses = new ExternalLicensesAPI.ExternalLicenses( + this._client, + ); + usage: UsageAPI.Usage = new UsageAPI.Usage(this._client); + + /** + * This endpoint is used to create a new license for a user. + * + * If a start date is provided, the license will be activated at the **start** of + * the specified date in the customer's timezone. Otherwise, the activation time + * will default to the **start** of the current day in the customer's timezone. + */ + create(body: LicenseCreateParams, options?: Core.RequestOptions): Core.APIPromise { + return this._client.post('/licenses', { body, ...options }); + } + + /** + * This endpoint is used to fetch a license given an identifier. + */ + retrieve(licenseId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.get(`/licenses/${licenseId}`, options); + } + + /** + * This endpoint returns a list of all licenses for a subscription. + */ + list( + query: LicenseListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + return this._client.getAPIList('/licenses', LicenseListResponsesPage, { query, ...options }); + } + + /** + * This endpoint is used to deactivate an existing license. + * + * If an end date is provided, the license will be deactivated at the **start** of + * the specified date in the customer's timezone. Otherwise, the deactivation time + * will default to the **end** of the current day in the customer's timezone. + */ + deactivate( + licenseId: string, + body: LicenseDeactivateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/licenses/${licenseId}/deactivate`, { body, ...options }); + } + + /** + * This endpoint is used to fetch a license given an external license identifier. + */ + retrieveByExternalId( + externalLicenseId: string, + query: LicenseRetrieveByExternalIDParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get(`/licenses/external_license_id/${externalLicenseId}`, { query, ...options }); + } +} + +export class LicenseListResponsesPage extends Page {} + +export interface LicenseCreateResponse { + id: string; + + end_date: string | null; + + external_license_id: string; + + license_type_id: string; + + start_date: string; + + status: 'active' | 'inactive'; + + subscription_id: string; +} + +export interface LicenseRetrieveResponse { + id: string; + + end_date: string | null; + + external_license_id: string; + + license_type_id: string; + + start_date: string; + + status: 'active' | 'inactive'; + + subscription_id: string; +} + +export interface LicenseListResponse { + id: string; + + end_date: string | null; + + external_license_id: string; + + license_type_id: string; + + start_date: string; + + status: 'active' | 'inactive'; + + subscription_id: string; +} + +export interface LicenseDeactivateResponse { + id: string; + + end_date: string | null; + + external_license_id: string; + + license_type_id: string; + + start_date: string; + + status: 'active' | 'inactive'; + + subscription_id: string; +} + +export interface LicenseRetrieveByExternalIDResponse { + id: string; + + end_date: string | null; + + external_license_id: string; + + license_type_id: string; + + start_date: string; + + status: 'active' | 'inactive'; + + subscription_id: string; +} + +export interface LicenseCreateParams { + /** + * The external identifier for the license. + */ + external_license_id: string; + + license_type_id: string; + + subscription_id: string; + + /** + * The end date of the license. If not provided, the license will remain active + * until deactivated. + */ + end_date?: string | null; + + /** + * The start date of the license. If not provided, defaults to start of day today + * in the customer's timezone. + */ + start_date?: string | null; +} + +export interface LicenseListParams extends PageParams { + subscription_id: string; + + external_license_id?: string | null; + + license_type_id?: string | null; + + status?: 'active' | 'inactive' | null; +} + +export interface LicenseDeactivateParams { + /** + * The date to deactivate the license. If not provided, defaults to end of day + * today in the customer's timezone. + */ + end_date?: string | null; +} + +export interface LicenseRetrieveByExternalIDParams { + /** + * The ID of the license type to fetch the license for. + */ + license_type_id: string; + + /** + * The ID of the subscription to fetch the license for. + */ + subscription_id: string; +} + +Licenses.LicenseListResponsesPage = LicenseListResponsesPage; +Licenses.ExternalLicenses = ExternalLicenses; +Licenses.Usage = Usage; + +export declare namespace Licenses { + export { + type LicenseCreateResponse as LicenseCreateResponse, + type LicenseRetrieveResponse as LicenseRetrieveResponse, + type LicenseListResponse as LicenseListResponse, + type LicenseDeactivateResponse as LicenseDeactivateResponse, + type LicenseRetrieveByExternalIDResponse as LicenseRetrieveByExternalIDResponse, + LicenseListResponsesPage as LicenseListResponsesPage, + type LicenseCreateParams as LicenseCreateParams, + type LicenseListParams as LicenseListParams, + type LicenseDeactivateParams as LicenseDeactivateParams, + type LicenseRetrieveByExternalIDParams as LicenseRetrieveByExternalIDParams, + }; + + export { + ExternalLicenses as ExternalLicenses, + type ExternalLicenseGetUsageResponse as ExternalLicenseGetUsageResponse, + type ExternalLicenseGetUsageParams as ExternalLicenseGetUsageParams, + }; + + export { + Usage as Usage, + type UsageGetAllUsageResponse as UsageGetAllUsageResponse, + type UsageGetUsageResponse as UsageGetUsageResponse, + type UsageGetAllUsageParams as UsageGetAllUsageParams, + type UsageGetUsageParams as UsageGetUsageParams, + }; +} diff --git a/src/resources/licenses/usage.ts b/src/resources/licenses/usage.ts new file mode 100644 index 00000000..f3230fe9 --- /dev/null +++ b/src/resources/licenses/usage.ts @@ -0,0 +1,280 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; +import * as Shared from '../shared'; + +export class Usage extends APIResource { + /** + * Returns usage and remaining credits for all licenses of a given type on a + * subscription. + * + * Date range defaults to the current billing period if not specified. + */ + getAllUsage( + query: UsageGetAllUsageParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get('/licenses/usage', { query, ...options }); + } + + /** + * Returns usage and remaining credits for a specific license over a date range. + * + * Date range defaults to the current billing period if not specified. + */ + getUsage( + licenseId: string, + query?: UsageGetUsageParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + getUsage(licenseId: string, options?: Core.RequestOptions): Core.APIPromise; + getUsage( + licenseId: string, + query: UsageGetUsageParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.getUsage(licenseId, {}, query); + } + return this._client.get(`/licenses/${licenseId}/usage`, { query, ...options }); + } +} + +export interface UsageGetAllUsageResponse { + data: Array; + + pagination_metadata: Shared.PaginationMetadata; +} + +export namespace UsageGetAllUsageResponse { + /** + * The LicenseUsage resource represents usage and remaining credits for a license + * over a date range. + * + * When grouped by 'day' only, license_id and external_license_id will be null as + * the data is aggregated across all licenses. + */ + export interface Data { + /** + * The total credits allocated to this license for the period. + */ + allocated_credits: number; + + /** + * The credits consumed by this license for the period. + */ + consumed_credits: number; + + /** + * The end date of the usage period. + */ + end_date: string; + + /** + * The unique identifier for the license type. + */ + license_type_id: string; + + /** + * The pricing unit for the credits (e.g., 'credits'). + */ + pricing_unit: string; + + /** + * The remaining credits available for this license (allocated - consumed). + */ + remaining_credits: number; + + /** + * The start date of the usage period. + */ + start_date: string; + + /** + * The unique identifier for the subscription. + */ + subscription_id: string; + + /** + * Credits consumed while the license was active (eligible for individual + * allocation deduction). + */ + allocation_eligible_credits?: number | null; + + /** + * The external identifier for the license. Null when grouped by day only. + */ + external_license_id?: string | null; + + /** + * The unique identifier for the license. Null when grouped by day only. + */ + license_id?: string | null; + + /** + * Credits consumed while the license was inactive (draws from shared pool, not + * individual allocation). + */ + shared_pool_credits?: number | null; + } +} + +export interface UsageGetUsageResponse { + data: Array; + + pagination_metadata: Shared.PaginationMetadata; +} + +export namespace UsageGetUsageResponse { + /** + * The LicenseUsage resource represents usage and remaining credits for a license + * over a date range. + * + * When grouped by 'day' only, license_id and external_license_id will be null as + * the data is aggregated across all licenses. + */ + export interface Data { + /** + * The total credits allocated to this license for the period. + */ + allocated_credits: number; + + /** + * The credits consumed by this license for the period. + */ + consumed_credits: number; + + /** + * The end date of the usage period. + */ + end_date: string; + + /** + * The unique identifier for the license type. + */ + license_type_id: string; + + /** + * The pricing unit for the credits (e.g., 'credits'). + */ + pricing_unit: string; + + /** + * The remaining credits available for this license (allocated - consumed). + */ + remaining_credits: number; + + /** + * The start date of the usage period. + */ + start_date: string; + + /** + * The unique identifier for the subscription. + */ + subscription_id: string; + + /** + * Credits consumed while the license was active (eligible for individual + * allocation deduction). + */ + allocation_eligible_credits?: number | null; + + /** + * The external identifier for the license. Null when grouped by day only. + */ + external_license_id?: string | null; + + /** + * The unique identifier for the license. Null when grouped by day only. + */ + license_id?: string | null; + + /** + * Credits consumed while the license was inactive (draws from shared pool, not + * individual allocation). + */ + shared_pool_credits?: number | null; + } +} + +export interface UsageGetAllUsageParams { + /** + * The license type ID to filter licenses by. + */ + license_type_id: string; + + /** + * The subscription ID to get license usage for. + */ + subscription_id: string; + + /** + * Pagination cursor from a previous request. + */ + cursor?: string | null; + + /** + * End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + * period. + */ + end_date?: string | null; + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + group_by?: Array | null; + + /** + * Maximum number of rows in the response data (default 20, max 100). + */ + limit?: number; + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current + * billing period. + */ + start_date?: string | null; +} + +export interface UsageGetUsageParams { + /** + * Pagination cursor from a previous request. + */ + cursor?: string | null; + + /** + * End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + * period. + */ + end_date?: string | null; + + /** + * How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + * 'license,day'). + */ + group_by?: Array | null; + + /** + * Maximum number of rows in the response data (default 20, max 100). + */ + limit?: number; + + /** + * Start date for the usage period (YYYY-MM-DD). Defaults to start of current + * billing period. + */ + start_date?: string | null; +} + +export declare namespace Usage { + export { + type UsageGetAllUsageResponse as UsageGetAllUsageResponse, + type UsageGetUsageResponse as UsageGetUsageResponse, + type UsageGetAllUsageParams as UsageGetAllUsageParams, + type UsageGetUsageParams as UsageGetUsageParams, + }; +} diff --git a/src/resources/metrics.ts b/src/resources/metrics.ts index 47662568..3a7b2c58 100644 --- a/src/resources/metrics.ts +++ b/src/resources/metrics.ts @@ -6,6 +6,10 @@ import * as Core from '../core'; import * as ItemsAPI from './items'; import { Page, type PageParams } from '../pagination'; +/** + * The Metric resource represents a calculation of a quantity based on events. + * Metrics are defined by the query that transforms raw usage events into meaningful values for your customers. + */ export class Metrics extends APIResource { /** * This endpoint is used to create a [metric](/core-concepts###metric) using a SQL @@ -88,6 +92,8 @@ export interface BillableMetric { name: string; status: 'active' | 'draft' | 'archived'; + + parameter_definitions?: Array<{ [key: string]: unknown }> | null; } export interface MetricCreateParams { diff --git a/src/resources/plans/external-plan-id.ts b/src/resources/plans/external-plan-id.ts index e936d0f7..41d8a161 100644 --- a/src/resources/plans/external-plan-id.ts +++ b/src/resources/plans/external-plan-id.ts @@ -4,6 +4,11 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; import * as PlansAPI from './plans'; +/** + * 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 class ExternalPlanID extends APIResource { /** * This endpoint can be used to update the `external_plan_id`, and `metadata` of an diff --git a/src/resources/plans/migrations.ts b/src/resources/plans/migrations.ts index 7940ab4c..31ec755a 100644 --- a/src/resources/plans/migrations.ts +++ b/src/resources/plans/migrations.ts @@ -5,6 +5,11 @@ import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import { Page, type PageParams } from '../../pagination'; +/** + * 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 class Migrations extends APIResource { /** * Fetch migration diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index b684caa9..b9bf250b 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -17,6 +17,11 @@ import { } from './migrations'; import { Page, type PageParams } from '../../pagination'; +/** + * 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 class Plans extends APIResource { externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client); migrations: MigrationsAPI.Migrations = new MigrationsAPI.Migrations(this._client); @@ -332,6 +337,43 @@ export namespace PlanCreateParams { */ 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. */ @@ -376,12 +418,7 @@ export namespace PlanCreateParams { } export namespace Price { - export interface NewPlanBulkWithFiltersPrice { - /** - * Configuration for bulk_with_filters pricing - */ - bulk_with_filters_config: NewPlanBulkWithFiltersPrice.BulkWithFiltersConfig; - + export interface NewLicenseAllocationUnitPrice { /** * The cadence to bill for this price on. */ @@ -392,16 +429,28 @@ export namespace PlanCreateParams { */ 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; + /** * The pricing model type */ - model_type: 'bulk_with_filters'; + 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. @@ -463,6 +512,11 @@ export namespace PlanCreateParams { */ 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 @@ -477,56 +531,26 @@ export namespace PlanCreateParams { reference_id?: string | null; } - export namespace NewPlanBulkWithFiltersPrice { - /** - * Configuration for bulk_with_filters pricing - */ - export interface BulkWithFiltersConfig { - /** - * Property filters to apply (all must match) - */ - filters: Array; - + export namespace NewLicenseAllocationUnitPrice { + export interface LicenseAllocation { /** - * Bulk tiers for rating based on total usage volume + * The amount of credits granted per active license per cadence. */ - tiers: Array; - } + amount: string; - export namespace BulkWithFiltersConfig { /** - * Configuration for a single property filter + * The currency of the license allocation. */ - export interface Filter { - /** - * Event property key to filter on - */ - property_key: string; - - /** - * Event property value to match - */ - property_value: string; - } + currency: string; /** - * Configuration for a single bulk pricing tier + * When True, overage beyond the allocation is written off. */ - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * The lower bound for this tier - */ - tier_lower_bound?: string | null; - } + write_off_overage?: boolean | null; } } - export interface NewPlanTieredWithProrationPrice { + export interface NewLicenseAllocationTieredPrice { /** * The cadence to bill for this price on. */ @@ -537,10 +561,17 @@ export namespace PlanCreateParams { */ 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; + /** * The pricing model type */ - model_type: 'tiered_with_proration'; + model_type: 'tiered'; /** * The name of the price. @@ -548,9 +579,9 @@ export namespace PlanCreateParams { name: string; /** - * Configuration for tiered_with_proration pricing + * Configuration for tiered pricing */ - tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig; + tiered_config: Shared.TieredConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -613,6 +644,11 @@ export namespace PlanCreateParams { */ 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 @@ -627,56 +663,52 @@ export namespace PlanCreateParams { reference_id?: string | null; } - export namespace NewPlanTieredWithProrationPrice { - /** - * Configuration for tiered_with_proration pricing - */ - export interface TieredWithProrationConfig { + export namespace NewLicenseAllocationTieredPrice { + export interface LicenseAllocation { /** - * Tiers for rating based on total usage quantities into the specified tier with - * proration + * The amount of credits granted per active license per cadence. */ - tiers: Array; - } + amount: string; - export namespace TieredWithProrationConfig { /** - * Configuration for a single tiered with proration tier + * The currency of the license allocation. */ - export interface Tier { - /** - * Inclusive tier starting value - */ - tier_lower_bound: string; + currency: string; - /** - * Amount per unit - */ - unit_amount: string; - } + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; } } - export interface NewPlanGroupedWithMinMaxThresholdsPrice { + export interface NewLicenseAllocationBulkPrice { /** - * The cadence to bill for this price on. + * Configuration for bulk pricing */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + bulk_config: Shared.BulkConfig; /** - * Configuration for grouped_with_min_max_thresholds pricing + * The cadence to bill for this price on. */ - grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + 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; + /** * The pricing model type */ - model_type: 'grouped_with_min_max_thresholds'; + model_type: 'bulk'; /** * The name of the price. @@ -744,6 +776,11 @@ export namespace PlanCreateParams { */ 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 @@ -758,53 +795,52 @@ export namespace PlanCreateParams { reference_id?: string | null; } - export namespace NewPlanGroupedWithMinMaxThresholdsPrice { - /** - * Configuration for grouped_with_min_max_thresholds pricing - */ - export interface GroupedWithMinMaxThresholdsConfig { - /** - * The event property used to group before applying thresholds - */ - grouping_key: string; - + export namespace NewLicenseAllocationBulkPrice { + export interface LicenseAllocation { /** - * The maximum amount to charge each group + * The amount of credits granted per active license per cadence. */ - maximum_charge: string; + amount: string; /** - * The minimum amount to charge each group, regardless of usage + * The currency of the license allocation. */ - minimum_charge: string; + currency: string; /** - * The base price charged per group + * When True, overage beyond the allocation is written off. */ - per_unit_rate: string; + write_off_overage?: boolean | null; } } - export interface NewPlanCumulativeGroupedAllocationPrice { + export interface NewLicenseAllocationBulkWithFiltersPrice { /** - * The cadence to bill for this price on. + * Configuration for bulk_with_filters pricing */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + bulk_with_filters_config: NewLicenseAllocationBulkWithFiltersPrice.BulkWithFiltersConfig; /** - * Configuration for cumulative_grouped_allocation pricing + * The cadence to bill for this price on. */ - cumulative_grouped_allocation_config: NewPlanCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + 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; + /** * The pricing model type */ - model_type: 'cumulative_grouped_allocation'; + model_type: 'bulk_with_filters'; /** * The name of the price. @@ -872,6 +908,11 @@ export namespace PlanCreateParams { */ 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 @@ -886,34 +927,73 @@ export namespace PlanCreateParams { reference_id?: string | null; } - export namespace NewPlanCumulativeGroupedAllocationPrice { + export namespace NewLicenseAllocationBulkWithFiltersPrice { /** - * Configuration for cumulative_grouped_allocation pricing + * Configuration for bulk_with_filters pricing */ - export interface CumulativeGroupedAllocationConfig { + export interface BulkWithFiltersConfig { /** - * The overall allocation across all groups + * Property filters to apply (all must match) */ - cumulative_allocation: string; + filters: Array; /** - * The allocation per individual group + * Bulk tiers for rating based on total usage volume */ - group_allocation: string; + tiers: Array; + } + export namespace BulkWithFiltersConfig { /** - * The event property used to group usage before applying allocations + * Configuration for a single property filter */ - grouping_key: string; + export interface Filter { + /** + * Event property key to filter on + */ + property_key: string; + + /** + * Event property value to match + */ + property_value: string; + } /** - * The amount to charge for each unit outside of the allocation + * Configuration for a single bulk pricing tier */ - unit_amount: string; + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export 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; } } - export interface NewPlanPercentCompositePrice { + export interface NewLicenseAllocationPackagePrice { /** * The cadence to bill for this price on. */ @@ -924,10 +1004,17 @@ export namespace PlanCreateParams { */ 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; + /** * The pricing model type */ - model_type: 'percent'; + model_type: 'package'; /** * The name of the price. @@ -935,9 +1022,9 @@ export namespace PlanCreateParams { name: string; /** - * Configuration for percent pricing + * Configuration for package pricing */ - percent_config: NewPlanPercentCompositePrice.PercentConfig; + package_config: Shared.PackageConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -1000,6 +1087,11 @@ export namespace PlanCreateParams { */ 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 @@ -1014,38 +1106,52 @@ export namespace PlanCreateParams { reference_id?: string | null; } - export namespace NewPlanPercentCompositePrice { - /** - * Configuration for percent pricing - */ - export interface PercentConfig { + export namespace NewLicenseAllocationPackagePrice { + export interface LicenseAllocation { /** - * What percent of the component subtotals to charge + * The amount of credits granted per active license per cadence. */ - percent: number; + amount: string; + + /** + * The currency of the license allocation. + */ + currency: string; + + /** + * When True, overage beyond the allocation is written off. + */ + write_off_overage?: boolean | null; } } - export interface NewPlanEventOutputPrice { + export interface NewLicenseAllocationMatrixPrice { /** * The cadence to bill for this price on. */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Configuration for event_output pricing + * The id of the item the price will be associated with. */ - event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + item_id: string; /** - * The id of the item the price will be associated with. + * 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. */ - item_id: string; + license_allocations: Array; + + /** + * Configuration for matrix pricing + */ + matrix_config: Shared.MatrixConfig; /** * The pricing model type */ - model_type: 'event_output'; + model_type: 'matrix'; /** * The name of the price. @@ -1113,6 +1219,4778 @@ export namespace PlanCreateParams { */ 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; + } + + export namespace NewLicenseAllocationMatrixPrice { + export 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; + } + } + + export 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; + + /** + * 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; + } + + export namespace NewLicenseAllocationThresholdTotalAmountPrice { + export 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 + */ + export interface ThresholdTotalAmountConfig { + /** + * When the quantity consumed passes a provided threshold, the configured total + * will be charged + */ + consumption_table: Array; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + } + + export namespace ThresholdTotalAmountConfig { + /** + * Configuration for a single threshold + */ + export interface ConsumptionTable { + threshold: string; + + /** + * Total amount for this threshold + */ + total_amount: string; + } + } + } + + export 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; + + /** + * 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. + */ + 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; + } + + export namespace NewLicenseAllocationTieredPackagePrice { + export 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 tiered_package pricing + */ + export interface TieredPackageConfig { + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. The tier bounds are defined based on + * the total quantity rather than the number of packages, so they must be multiples + * of the package size. + */ + tiers: Array; + } + + export namespace TieredPackageConfig { + /** + * Configuration for a single tier with business logic + */ + export interface Tier { + /** + * Price per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationTieredWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_minimum pricing + */ + tiered_with_minimum_config: NewLicenseAllocationTieredWithMinimumPrice.TieredWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithMinimumPrice { + export 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 tiered_with_minimum pricing + */ + export interface TieredWithMinimumConfig { + /** + * Tiered pricing with a minimum amount dependent on the volume tier. Tiers are + * defined using exclusive lower bounds. + */ + tiers: Array; + + /** + * If true, tiers with an accrued amount of 0 will not be included in the rating. + */ + hide_zero_amount_tiers?: boolean; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean; + } + + export namespace TieredWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered pricing + */ + grouped_tiered_config: NewLicenseAllocationGroupedTieredPrice.GroupedTieredConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPrice { + /** + * Configuration for grouped_tiered pricing + */ + export interface GroupedTieredConfig { + /** + * The billable metric property used to group before tiering + */ + grouping_key: string; + + /** + * Apply tiered pricing to each segment generated after grouping with the provided + * key + */ + tiers: Array; + } + + export namespace GroupedTieredConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationTieredPackageWithMinimumPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_package_with_minimum pricing + */ + tiered_package_with_minimum_config: NewLicenseAllocationTieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredPackageWithMinimumPrice { + export 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 tiered_package_with_minimum pricing + */ + export interface TieredPackageWithMinimumConfig { + package_size: number; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace TieredPackageWithMinimumConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + minimum_amount: string; + + per_unit: string; + + tier_lower_bound: string; + } + } + } + + export interface NewLicenseAllocationPackageWithAllocationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for package_with_allocation pricing + */ + package_with_allocation_config: NewLicenseAllocationPackageWithAllocationPrice.PackageWithAllocationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPackageWithAllocationPrice { + export 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 package_with_allocation pricing + */ + export interface PackageWithAllocationConfig { + allocation: string; + + package_amount: string; + + package_size: string; + } + } + + export interface NewLicenseAllocationUnitWithPercentPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_percent pricing + */ + unit_with_percent_config: NewLicenseAllocationUnitWithPercentPrice.UnitWithPercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithPercentPrice { + export 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 unit_with_percent pricing + */ + export interface UnitWithPercentConfig { + /** + * What percent, out of 100, of the calculated total to charge + */ + percent: string; + + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationMatrixWithAllocationPrice { + /** + * 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; + + /** + * Configuration for matrix_with_allocation pricing + */ + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; + + /** + * The pricing model type + */ + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * 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; + } + + export namespace NewLicenseAllocationMatrixWithAllocationPrice { + export 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; + } + } + + export interface NewLicenseAllocationTieredWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewLicenseAllocationTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationTieredWithProrationPrice { + export 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 tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationUnitWithProrationPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for unit_with_proration pricing + */ + unit_with_proration_config: NewLicenseAllocationUnitWithProrationPrice.UnitWithProrationConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationUnitWithProrationPrice { + export 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 unit_with_proration pricing + */ + export interface UnitWithProrationConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; + } + } + + export interface NewLicenseAllocationGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_allocation pricing + */ + grouped_allocation_config: NewLicenseAllocationGroupedAllocationPrice.GroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedAllocationPrice { + /** + * Configuration for grouped_allocation pricing + */ + export interface GroupedAllocationConfig { + /** + * Usage allocation per group + */ + allocation: string; + + /** + * How to determine the groups that should each be allocated some quantity + */ + grouping_key: string; + + /** + * Unit rate for post-allocation + */ + overage_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + bulk_with_proration_config: NewLicenseAllocationBulkWithProrationPrice.BulkWithProrationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationBulkWithProrationPrice { + /** + * Configuration for bulk_with_proration pricing + */ + export interface BulkWithProrationConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithProrationConfig { + /** + * Configuration for a single bulk pricing tier with proration + */ + export interface Tier { + /** + * Cost per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + grouped_with_prorated_minimum_config: NewLicenseAllocationGroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithProratedMinimumPrice { + /** + * Configuration for grouped_with_prorated_minimum pricing + */ + export interface GroupedWithProratedMinimumConfig { + /** + * How to determine the groups that should each have a minimum + */ + grouping_key: string; + + /** + * The minimum amount to charge per group + */ + minimum: string; + + /** + * The amount to charge per unit + */ + unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_metered_minimum pricing + */ + grouped_with_metered_minimum_config: NewLicenseAllocationGroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedWithMeteredMinimumPrice { + /** + * Configuration for grouped_with_metered_minimum pricing + */ + export interface GroupedWithMeteredMinimumConfig { + /** + * Used to partition the usage into groups. The minimum amount is applied to each + * group. + */ + grouping_key: string; + + /** + * The minimum amount to charge per group per unit + */ + minimum_unit_amount: string; + + /** + * Used to determine the unit rate + */ + pricing_key: string; + + /** + * Scale the unit rates by the scaling factor. + */ + scaling_factors: Array; + + /** + * Used to determine the unit rate scaling factor + */ + scaling_key: string; + + /** + * Apply per unit pricing to each pricing value. The minimum amount is applied any + * unmatched usage. + */ + unit_amounts: Array; + } + + export namespace GroupedWithMeteredMinimumConfig { + /** + * Configuration for a scaling factor + */ + export interface ScalingFactor { + scaling_factor: string; + + scaling_value: string; + } + + /** + * Configuration for a unit amount + */ + export interface UnitAmount { + pricing_value: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewLicenseAllocationGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewLicenseAllocationGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + + export interface 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; + } + } + + export interface NewLicenseAllocationMatrixWithDisplayNamePrice { + /** + * 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; + + /** + * Configuration for matrix_with_display_name pricing + */ + matrix_with_display_name_config: NewLicenseAllocationMatrixWithDisplayNamePrice.MatrixWithDisplayNameConfig; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationMatrixWithDisplayNamePrice { + export 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 matrix_with_display_name pricing + */ + export interface MatrixWithDisplayNameConfig { + /** + * Used to determine the unit rate + */ + dimension: string; + + /** + * Apply per unit pricing to each dimension value + */ + unit_amounts: Array; + } + + export namespace MatrixWithDisplayNameConfig { + /** + * Configuration for a unit amount item + */ + export interface UnitAmount { + /** + * The dimension value + */ + dimension_value: string; + + /** + * Display name for this dimension value + */ + display_name: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_tiered_package pricing + */ + grouped_tiered_package_config: NewLicenseAllocationGroupedTieredPackagePrice.GroupedTieredPackageConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationGroupedTieredPackagePrice { + /** + * Configuration for grouped_tiered_package pricing + */ + export interface GroupedTieredPackageConfig { + /** + * The event property used to group before tiering + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing after rounding up the quantity to the package size. Tiers + * are defined using exclusive lower bounds. + */ + tiers: Array; + } + + export namespace GroupedTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + /** + * Per package + */ + per_unit: string; + + tier_lower_bound: string; + } + } + + export 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; + } + } + + export interface NewLicenseAllocationMaxGroupTieredPackagePrice { + /** + * 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; + + /** + * Configuration for max_group_tiered_package pricing + */ + max_group_tiered_package_config: NewLicenseAllocationMaxGroupTieredPackagePrice.MaxGroupTieredPackageConfig; + + /** + * The pricing model type + */ + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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; + } + + export namespace NewLicenseAllocationMaxGroupTieredPackagePrice { + export 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 max_group_tiered_package pricing + */ + export interface MaxGroupTieredPackageConfig { + /** + * The event property used to group before tiering the group with the highest value + */ + grouping_key: string; + + package_size: string; + + /** + * Apply tiered pricing to the largest group after grouping with the provided key. + */ + tiers: Array; + } + + export namespace MaxGroupTieredPackageConfig { + /** + * Configuration for a single tier + */ + export interface Tier { + tier_lower_bound: string; + + /** + * Per unit amount + */ + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_unit_pricing pricing + */ + scalable_matrix_with_unit_pricing_config: NewLicenseAllocationScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithUnitPricingPrice { + export 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 scalable_matrix_with_unit_pricing pricing + */ + export interface ScalableMatrixWithUnitPricingConfig { + /** + * Used to determine the unit rate + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + /** + * The final unit price to rate against the output of the matrix + */ + unit_price: string; + + /** + * The property used to group this price + */ + grouping_key?: string | null; + + /** + * If true, the unit price will be prorated to the billing period + */ + prorate?: boolean | null; + + /** + * Used to determine the unit rate (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithUnitPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + } + } + + export interface NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for scalable_matrix_with_tiered_pricing pricing + */ + scalable_matrix_with_tiered_pricing_config: NewLicenseAllocationScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationScalableMatrixWithTieredPricingPrice { + export 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 scalable_matrix_with_tiered_pricing pricing + */ + export interface ScalableMatrixWithTieredPricingConfig { + /** + * Used for the scalable matrix first dimension + */ + first_dimension: string; + + /** + * Apply a scaling factor to each dimension + */ + matrix_scaling_factors: Array; + + tiers: Array; + + /** + * Used for the scalable matrix second dimension (optional) + */ + second_dimension?: string | null; + } + + export namespace ScalableMatrixWithTieredPricingConfig { + /** + * Configuration for a single matrix scaling factor + */ + export interface MatrixScalingFactor { + first_dimension_value: string; + + scaling_factor: string; + + second_dimension_value?: string | null; + } + + /** + * Configuration for a single tier entry with business logic + */ + export interface Tier { + tier_lower_bound: string; + + unit_amount: string; + } + } + } + + export interface NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_bulk pricing + */ + cumulative_grouped_bulk_config: NewLicenseAllocationCumulativeGroupedBulkPrice.CumulativeGroupedBulkConfig; + + /** + * 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; + + /** + * The pricing model type + */ + 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?: 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; + } + + export namespace NewLicenseAllocationCumulativeGroupedBulkPrice { + /** + * Configuration for cumulative_grouped_bulk pricing + */ + export interface CumulativeGroupedBulkConfig { + /** + * Each tier lower bound must have the same group of values. + */ + dimension_values: Array; + + group: string; + } + + export namespace CumulativeGroupedBulkConfig { + /** + * Configuration for a dimension value entry + */ + export interface DimensionValue { + /** + * Grouping key value + */ + grouping_key: string; + + /** + * Tier lower bound + */ + tier_lower_bound: string; + + /** + * Unit amount for this combination + */ + unit_amount: string; + } + } + + export interface 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; + } + } + + export interface NewLicenseAllocationCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewLicenseAllocationCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'cumulative_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?: 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; + } + + export namespace NewLicenseAllocationCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations + */ + grouping_key: string; + + /** + * The amount to charge for each unit outside of the allocation + */ + unit_amount: string; + } + + export 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; + } + } + + export interface NewLicenseAllocationMinimumCompositePrice { + /** + * 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; + + /** + * Configuration for minimum_composite pricing + */ + minimum_composite_config: NewLicenseAllocationMinimumCompositePrice.MinimumCompositeConfig; + + /** + * The pricing model type + */ + model_type: 'minimum_composite'; + + /** + * 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; + } + + export namespace NewLicenseAllocationMinimumCompositePrice { + export 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 minimum_composite pricing + */ + export interface MinimumCompositeConfig { + /** + * The minimum amount to apply + */ + minimum_amount: string; + + /** + * If true, subtotals from this price are prorated based on the service period + */ + prorated?: boolean; + } + } + + export interface NewLicenseAllocationPercentCompositePrice { + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewLicenseAllocationPercentCompositePrice.PercentConfig; + + /** + * 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; + } + + export namespace NewLicenseAllocationPercentCompositePrice { + export 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 percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewLicenseAllocationEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewLicenseAllocationEventOutputPrice.EventOutputConfig; + + /** + * 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; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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; + } + + export namespace NewLicenseAllocationEventOutputPrice { + /** + * Configuration for event_output pricing + */ + export interface EventOutputConfig { + /** + * The key in the event data to extract the unit rate from. + */ + unit_rating_key: string; + + /** + * If provided, this amount will be used as the unit rate when an event does not + * have a value for the `unit_rating_key`. If not provided, events missing a unit + * rate will be ignored. + */ + default_unit_rate?: string | null; + + /** + * An optional key in the event data to group by (e.g., event ID). All events will + * also be grouped by their unit rate. + */ + grouping_key?: string | null; + } + + export 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; + } + } + + export interface NewPlanBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + bulk_with_filters_config: NewPlanBulkWithFiltersPrice.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; + + /** + * 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; + } + + export namespace NewPlanBulkWithFiltersPrice { + /** + * Configuration for bulk_with_filters pricing + */ + export interface BulkWithFiltersConfig { + /** + * Property filters to apply (all must match) + */ + filters: Array; + + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; + } + + export namespace BulkWithFiltersConfig { + /** + * Configuration for a single property filter + */ + export 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 + */ + export interface Tier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * The lower bound for this tier + */ + tier_lower_bound?: string | null; + } + } + } + + export interface NewPlanTieredWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for tiered_with_proration pricing + */ + tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; + + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; + + /** + * An alias for the price. + */ + external_price_id?: string | null; + + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; + + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; + + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; + + /** + * 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; + } + + export namespace NewPlanTieredWithProrationPrice { + /** + * Configuration for tiered_with_proration pricing + */ + export interface TieredWithProrationConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier with + * proration + */ + tiers: Array; + } + + export namespace TieredWithProrationConfig { + /** + * Configuration for a single tiered with proration tier + */ + export interface Tier { + /** + * Inclusive tier starting value + */ + tier_lower_bound: string; + + /** + * Amount per unit + */ + unit_amount: string; + } + } + } + + export interface NewPlanGroupedWithMinMaxThresholdsPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'grouped_with_min_max_thresholds'; + + /** + * 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; + } + + export namespace NewPlanGroupedWithMinMaxThresholdsPrice { + /** + * Configuration for grouped_with_min_max_thresholds pricing + */ + export interface GroupedWithMinMaxThresholdsConfig { + /** + * The event property used to group before applying thresholds + */ + grouping_key: string; + + /** + * The maximum amount to charge each group + */ + maximum_charge: string; + + /** + * The minimum amount to charge each group, regardless of usage + */ + minimum_charge: string; + + /** + * The base price charged per group + */ + per_unit_rate: string; + } + } + + export interface NewPlanCumulativeGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for cumulative_grouped_allocation pricing + */ + cumulative_grouped_allocation_config: NewPlanCumulativeGroupedAllocationPrice.CumulativeGroupedAllocationConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'cumulative_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?: 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; + } + + export namespace NewPlanCumulativeGroupedAllocationPrice { + /** + * Configuration for cumulative_grouped_allocation pricing + */ + export interface CumulativeGroupedAllocationConfig { + /** + * The overall allocation across all groups + */ + cumulative_allocation: string; + + /** + * The allocation per individual group + */ + group_allocation: string; + + /** + * The event property used to group usage before applying allocations + */ + grouping_key: string; + + /** + * The amount to charge for each unit outside of the allocation + */ + unit_amount: string; + } + } + + export interface NewPlanPercentCompositePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'percent'; + + /** + * The name of the price. + */ + name: string; + + /** + * Configuration for percent pricing + */ + percent_config: NewPlanPercentCompositePrice.PercentConfig; + + /** + * 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; + } + + export namespace NewPlanPercentCompositePrice { + /** + * Configuration for percent pricing + */ + export interface PercentConfig { + /** + * What percent of the component subtotals to charge + */ + percent: number; + } + } + + export interface NewPlanEventOutputPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * Configuration for event_output pricing + */ + event_output_config: NewPlanEventOutputPrice.EventOutputConfig; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + /** + * The pricing model type + */ + model_type: 'event_output'; + + /** + * 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 diff --git a/src/resources/prices/external-price-id.ts b/src/resources/prices/external-price-id.ts index 89246196..22f3de47 100644 --- a/src/resources/prices/external-price-id.ts +++ b/src/resources/prices/external-price-id.ts @@ -4,6 +4,15 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; import * as Shared from '../shared'; +/** + * The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + * the form of an invoice line item. Prices take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + * given Price object. The model_type field determines the key for the configuration object that is present. + * + * For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + */ export class ExternalPriceID extends APIResource { /** * This endpoint allows you to update the `metadata` property on a price. If you diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index 1a743a86..65f8a8d6 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -10,6 +10,15 @@ import * as ExternalPriceIDAPI from './external-price-id'; import { ExternalPriceID, ExternalPriceIDUpdateParams } from './external-price-id'; import { type PageParams } from '../../pagination'; +/** + * The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + * the form of an invoice line item. Prices take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + * given Price object. The model_type field determines the key for the configuration object that is present. + * + * For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + */ export class Prices extends APIResource { externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this._client); @@ -373,6 +382,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -467,6 +481,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -561,6 +580,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -655,6 +679,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -798,6 +827,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -892,6 +926,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -986,6 +1025,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1112,6 +1156,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1237,6 +1286,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1370,6 +1424,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1496,6 +1555,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1618,6 +1682,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1725,6 +1794,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1836,6 +1910,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -1930,6 +2009,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2054,6 +2138,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2160,6 +2249,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2276,6 +2370,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2399,6 +2498,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2515,6 +2619,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2671,6 +2780,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2792,6 +2906,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -2925,6 +3044,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3053,6 +3177,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3180,6 +3309,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3208,6 +3342,11 @@ export declare namespace PriceCreateParams { */ unit_price: string; + /** + * The property used to group this price + */ + grouping_key?: string | null; + /** * If true, the unit price will be prorated to the billing period */ @@ -3319,6 +3458,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3459,6 +3603,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3589,6 +3738,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3710,6 +3864,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3821,6 +3980,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -3927,6 +4091,11 @@ export declare namespace PriceCreateParams { */ 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 @@ -4006,6 +4175,12 @@ export interface PriceEvaluateParams { * to group the underlying billable metric */ grouping_keys?: Array; + + /** + * Optional overrides for parameterized billable metric parameters. If the metric + * has parameter definitions and no overrides are provided, defaults will be used. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; } export interface PriceEvaluateMultipleParams { @@ -4056,6 +4231,12 @@ export namespace PriceEvaluateMultipleParams { */ grouping_keys?: Array; + /** + * Optional overrides for parameterized billable metric parameters. If the metric + * has parameter definitions and no overrides are provided, defaults will be used. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * New floating price request body params. */ @@ -4186,6 +4367,11 @@ export namespace PriceEvaluateMultipleParams { */ 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 @@ -4329,6 +4515,11 @@ export namespace PriceEvaluateMultipleParams { */ 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 @@ -4450,6 +4641,11 @@ export namespace PriceEvaluateMultipleParams { */ 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 @@ -4571,6 +4767,11 @@ export namespace PriceEvaluateMultipleParams { */ 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 @@ -4677,6 +4878,11 @@ export namespace PriceEvaluateMultipleParams { */ 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 @@ -4796,6 +5002,12 @@ export namespace PriceEvaluatePreviewEventsParams { */ grouping_keys?: Array; + /** + * Optional overrides for parameterized billable metric parameters. If the metric + * has parameter definitions and no overrides are provided, defaults will be used. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * New floating price request body params. */ @@ -4926,6 +5138,11 @@ export namespace PriceEvaluatePreviewEventsParams { */ 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 @@ -5069,6 +5286,11 @@ export namespace PriceEvaluatePreviewEventsParams { */ 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 @@ -5190,6 +5412,11 @@ export namespace PriceEvaluatePreviewEventsParams { */ 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 @@ -5311,6 +5538,11 @@ export namespace PriceEvaluatePreviewEventsParams { */ 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 @@ -5417,6 +5649,11 @@ export namespace PriceEvaluatePreviewEventsParams { */ 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 diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 5477f623..a42081fd 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -69,6 +69,8 @@ export interface Allocation { custom_expiration: CustomExpiration | null; filters?: Array; + + license_type_id?: string | null; } export namespace Allocation { @@ -2755,6 +2757,11 @@ export interface NewAllocationPrice { */ item_id?: string | null; + /** + * The license type ID to associate the price with license allocation. + */ + license_type_id?: string | null; + /** * The (per-unit) cost basis of each created block. If non-zero, a customer will be * invoiced according to the quantity and per unit cost basis specified for the @@ -2962,6 +2969,11 @@ export interface NewFloatingBulkPrice { */ invoicing_cycle_configuration?: 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 @@ -3056,6 +3068,11 @@ export interface NewFloatingBulkWithProrationPrice { */ invoicing_cycle_configuration?: 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 @@ -3179,6 +3196,11 @@ export interface NewFloatingCumulativeGroupedBulkPrice { */ invoicing_cycle_configuration?: 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 @@ -3309,6 +3331,11 @@ export interface NewFloatingGroupedAllocationPrice { */ invoicing_cycle_configuration?: 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 @@ -3425,6 +3452,11 @@ export interface NewFloatingGroupedTieredPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -3553,6 +3585,11 @@ export interface NewFloatingGroupedTieredPrice { */ invoicing_cycle_configuration?: 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 @@ -3679,6 +3716,11 @@ export interface NewFloatingGroupedWithMeteredMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -3835,6 +3877,11 @@ export interface NewFloatingGroupedWithProratedMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -3951,6 +3998,11 @@ export interface NewFloatingMatrixPrice { */ invoicing_cycle_configuration?: 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 @@ -4045,6 +4097,11 @@ export interface NewFloatingMatrixWithAllocationPrice { */ invoicing_cycle_configuration?: 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 @@ -4139,6 +4196,11 @@ export interface NewFloatingMatrixWithDisplayNamePrice { */ invoicing_cycle_configuration?: 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 @@ -4272,6 +4334,11 @@ export interface NewFloatingMaxGroupTieredPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -4399,6 +4466,11 @@ export interface NewFloatingMinimumCompositePrice { */ invoicing_cycle_configuration?: 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 @@ -4510,6 +4582,11 @@ export interface NewFloatingPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -4604,6 +4681,11 @@ export interface NewFloatingPackageWithAllocationPrice { */ invoicing_cycle_configuration?: 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 @@ -4711,6 +4793,11 @@ export interface NewFloatingScalableMatrixWithTieredPricingPrice { */ invoicing_cycle_configuration?: 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 @@ -4851,6 +4938,11 @@ export interface NewFloatingScalableMatrixWithUnitPricingPrice { */ invoicing_cycle_configuration?: 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 @@ -4879,6 +4971,11 @@ export namespace NewFloatingScalableMatrixWithUnitPricingPrice { */ unit_price: string; + /** + * The property used to group this price + */ + grouping_key?: string | null; + /** * If true, the unit price will be prorated to the billing period */ @@ -4990,6 +5087,11 @@ export interface NewFloatingThresholdTotalAmountPrice { */ invoicing_cycle_configuration?: 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 @@ -5116,6 +5218,11 @@ export interface NewFloatingTieredPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -5241,6 +5348,11 @@ export interface NewFloatingTieredPackageWithMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -5363,6 +5475,11 @@ export interface NewFloatingTieredPrice { */ invoicing_cycle_configuration?: 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 @@ -5457,6 +5574,11 @@ export interface NewFloatingTieredWithMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -5590,6 +5712,11 @@ export interface NewFloatingTieredWithProrationPrice { */ invoicing_cycle_configuration?: 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 @@ -5714,6 +5841,11 @@ export interface NewFloatingUnitPrice { */ invoicing_cycle_configuration?: 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 @@ -5808,6 +5940,11 @@ export interface NewFloatingUnitWithPercentPrice { */ invoicing_cycle_configuration?: 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 @@ -5919,6 +6056,11 @@ export interface NewFloatingUnitWithProrationPrice { */ invoicing_cycle_configuration?: 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 @@ -6214,6 +6356,11 @@ export interface NewPlanBulkPrice { */ invoicing_cycle_configuration?: 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 @@ -6315,6 +6462,11 @@ export interface NewPlanBulkWithProrationPrice { */ invoicing_cycle_configuration?: 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 @@ -6445,6 +6597,11 @@ export interface NewPlanCumulativeGroupedBulkPrice { */ invoicing_cycle_configuration?: 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 @@ -6582,6 +6739,11 @@ export interface NewPlanGroupedAllocationPrice { */ invoicing_cycle_configuration?: 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 @@ -6705,6 +6867,11 @@ export interface NewPlanGroupedTieredPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -6840,6 +7007,11 @@ export interface NewPlanGroupedTieredPrice { */ invoicing_cycle_configuration?: 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 @@ -6973,6 +7145,11 @@ export interface NewPlanGroupedWithMeteredMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -7136,6 +7313,11 @@ export interface NewPlanGroupedWithProratedMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -7259,6 +7441,11 @@ export interface NewPlanMatrixPrice { */ invoicing_cycle_configuration?: 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 @@ -7360,6 +7547,11 @@ export interface NewPlanMatrixWithAllocationPrice { */ invoicing_cycle_configuration?: 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 @@ -7461,6 +7653,11 @@ export interface NewPlanMatrixWithDisplayNamePrice { */ invoicing_cycle_configuration?: 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 @@ -7601,6 +7798,11 @@ export interface NewPlanMaxGroupTieredPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -7735,6 +7937,11 @@ export interface NewPlanMinimumCompositePrice { */ invoicing_cycle_configuration?: 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 @@ -7853,6 +8060,11 @@ export interface NewPlanPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -7954,6 +8166,11 @@ export interface NewPlanPackageWithAllocationPrice { */ invoicing_cycle_configuration?: 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 @@ -8068,6 +8285,11 @@ export interface NewPlanScalableMatrixWithTieredPricingPrice { */ invoicing_cycle_configuration?: 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 @@ -8215,6 +8437,11 @@ export interface NewPlanScalableMatrixWithUnitPricingPrice { */ invoicing_cycle_configuration?: 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 @@ -8249,6 +8476,11 @@ export namespace NewPlanScalableMatrixWithUnitPricingPrice { */ unit_price: string; + /** + * The property used to group this price + */ + grouping_key?: string | null; + /** * If true, the unit price will be prorated to the billing period */ @@ -8361,6 +8593,11 @@ export interface NewPlanThresholdTotalAmountPrice { */ invoicing_cycle_configuration?: 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 @@ -8494,6 +8731,11 @@ export interface NewPlanTieredPackagePrice { */ invoicing_cycle_configuration?: 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 @@ -8626,6 +8868,11 @@ export interface NewPlanTieredPackageWithMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -8755,6 +9002,11 @@ export interface NewPlanTieredPrice { */ invoicing_cycle_configuration?: 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 @@ -8856,6 +9108,11 @@ export interface NewPlanTieredWithMinimumPrice { */ invoicing_cycle_configuration?: 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 @@ -8996,6 +9253,11 @@ export interface NewPlanUnitPrice { */ invoicing_cycle_configuration?: 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 @@ -9097,6 +9359,11 @@ export interface NewPlanUnitWithPercentPrice { */ invoicing_cycle_configuration?: 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 @@ -9215,6 +9482,11 @@ export interface NewPlanUnitWithProrationPrice { */ invoicing_cycle_configuration?: 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 @@ -9914,6 +10186,13 @@ export namespace Price { unit_config: Shared.UnitConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: UnitPrice.LicenseType | null; } export namespace UnitPrice { @@ -9933,6 +10212,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface TieredPrice { @@ -10026,6 +10328,13 @@ export namespace Price { tiered_config: Shared.TieredConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: TieredPrice.LicenseType | null; } export namespace TieredPrice { @@ -10045,6 +10354,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface BulkPrice { @@ -10138,6 +10470,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: BulkPrice.LicenseType | null; } export namespace BulkPrice { @@ -10157,6 +10496,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface BulkWithFiltersPrice { @@ -10250,6 +10612,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: BulkWithFiltersPrice.LicenseType | null; } export namespace BulkWithFiltersPrice { @@ -10316,6 +10685,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface PackagePrice { @@ -10409,6 +10801,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: PackagePrice.LicenseType | null; } export namespace PackagePrice { @@ -10428,6 +10827,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface MatrixPrice { @@ -10521,6 +10943,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: MatrixPrice.LicenseType | null; } export namespace MatrixPrice { @@ -10540,6 +10969,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface ThresholdTotalAmountPrice { @@ -10633,6 +11085,13 @@ export namespace Price { threshold_total_amount_config: ThresholdTotalAmountPrice.ThresholdTotalAmountConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: ThresholdTotalAmountPrice.LicenseType | null; } export namespace ThresholdTotalAmountPrice { @@ -10682,6 +11141,29 @@ export namespace Price { total_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface TieredPackagePrice { @@ -10775,6 +11257,13 @@ export namespace Price { tiered_package_config: TieredPackagePrice.TieredPackageConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: TieredPackagePrice.LicenseType | null; } export namespace TieredPackagePrice { @@ -10823,6 +11312,29 @@ export namespace Price { tier_lower_bound: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface TieredWithMinimumPrice { @@ -10916,6 +11428,13 @@ export namespace Price { tiered_with_minimum_config: TieredWithMinimumPrice.TieredWithMinimumConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: TieredWithMinimumPrice.LicenseType | null; } export namespace TieredWithMinimumPrice { @@ -10972,6 +11491,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface GroupedTieredPrice { @@ -11065,6 +11607,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: GroupedTieredPrice.LicenseType | null; } export namespace GroupedTieredPrice { @@ -11114,6 +11663,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface TieredPackageWithMinimumPrice { @@ -11207,6 +11779,13 @@ export namespace Price { tiered_package_with_minimum_config: TieredPackageWithMinimumPrice.TieredPackageWithMinimumConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: TieredPackageWithMinimumPrice.LicenseType | null; } export namespace TieredPackageWithMinimumPrice { @@ -11252,6 +11831,29 @@ export namespace Price { tier_lower_bound: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface PackageWithAllocationPrice { @@ -11345,6 +11947,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: PackageWithAllocationPrice.LicenseType | null; } export namespace PackageWithAllocationPrice { @@ -11375,6 +11984,29 @@ export namespace Price { package_size: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface UnitWithPercentPrice { @@ -11468,6 +12100,13 @@ export namespace Price { unit_with_percent_config: UnitWithPercentPrice.UnitWithPercentConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: UnitWithPercentPrice.LicenseType | null; } export namespace UnitWithPercentPrice { @@ -11502,6 +12141,29 @@ export namespace Price { */ unit_amount: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface MatrixWithAllocationPrice { @@ -11595,6 +12257,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: MatrixWithAllocationPrice.LicenseType | null; } export namespace MatrixWithAllocationPrice { @@ -11614,6 +12283,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface TieredWithProrationPrice { @@ -11707,6 +12399,13 @@ export namespace Price { tiered_with_proration_config: TieredWithProrationPrice.TieredWithProrationConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: TieredWithProrationPrice.LicenseType | null; } export namespace TieredWithProrationPrice { @@ -11754,6 +12453,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface UnitWithProrationPrice { @@ -11847,6 +12569,13 @@ export namespace Price { unit_with_proration_config: UnitWithProrationPrice.UnitWithProrationConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: UnitWithProrationPrice.LicenseType | null; } export namespace UnitWithProrationPrice { @@ -11876,6 +12605,29 @@ export namespace Price { */ unit_amount: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface GroupedAllocationPrice { @@ -11969,6 +12721,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: GroupedAllocationPrice.LicenseType | null; } export namespace GroupedAllocationPrice { @@ -12008,6 +12767,29 @@ export namespace Price { */ overage_unit_rate: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface BulkWithProrationPrice { @@ -12101,6 +12883,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: BulkWithProrationPrice.LicenseType | null; } export namespace BulkWithProrationPrice { @@ -12147,6 +12936,29 @@ export namespace Price { */ values: Array; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface GroupedWithProratedMinimumPrice { @@ -12240,6 +13052,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: GroupedWithProratedMinimumPrice.LicenseType | null; } export namespace GroupedWithProratedMinimumPrice { @@ -12279,6 +13098,29 @@ export namespace Price { */ unit_rate: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface GroupedWithMeteredMinimumPrice { @@ -12372,6 +13214,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: GroupedWithMeteredMinimumPrice.LicenseType | null; } export namespace GroupedWithMeteredMinimumPrice { @@ -12451,6 +13300,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface GroupedWithMinMaxThresholdsPrice { @@ -12544,6 +13416,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: GroupedWithMinMaxThresholdsPrice.LicenseType | null; } export namespace GroupedWithMinMaxThresholdsPrice { @@ -12588,6 +13467,29 @@ export namespace Price { */ per_unit_rate: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface MatrixWithDisplayNamePrice { @@ -12681,6 +13583,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: MatrixWithDisplayNamePrice.LicenseType | null; } export namespace MatrixWithDisplayNamePrice { @@ -12737,6 +13646,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface GroupedTieredPackagePrice { @@ -12830,6 +13762,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: GroupedTieredPackagePrice.LicenseType | null; } export namespace GroupedTieredPackagePrice { @@ -12881,6 +13820,29 @@ export namespace Price { tier_lower_bound: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface MaxGroupTieredPackagePrice { @@ -12974,6 +13936,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: MaxGroupTieredPackagePrice.LicenseType | null; } export namespace MaxGroupTieredPackagePrice { @@ -13024,6 +13993,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface ScalableMatrixWithUnitPricingPrice { @@ -13117,6 +14109,13 @@ export namespace Price { scalable_matrix_with_unit_pricing_config: ScalableMatrixWithUnitPricingPrice.ScalableMatrixWithUnitPricingConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: ScalableMatrixWithUnitPricingPrice.LicenseType | null; } export namespace ScalableMatrixWithUnitPricingPrice { @@ -13156,6 +14155,11 @@ export namespace Price { */ unit_price: string; + /** + * The property used to group this price + */ + grouping_key?: string | null; + /** * If true, the unit price will be prorated to the billing period */ @@ -13179,6 +14183,29 @@ export namespace Price { second_dimension_value?: string | null; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface ScalableMatrixWithTieredPricingPrice { @@ -13272,6 +14299,13 @@ export namespace Price { scalable_matrix_with_tiered_pricing_config: ScalableMatrixWithTieredPricingPrice.ScalableMatrixWithTieredPricingConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: ScalableMatrixWithTieredPricingPrice.LicenseType | null; } export namespace ScalableMatrixWithTieredPricingPrice { @@ -13335,6 +14369,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface CumulativeGroupedBulkPrice { @@ -13428,6 +14485,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: CumulativeGroupedBulkPrice.LicenseType | null; } export namespace CumulativeGroupedBulkPrice { @@ -13481,6 +14545,29 @@ export namespace Price { unit_amount: string; } } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface CumulativeGroupedAllocationPrice { @@ -13574,6 +14661,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: CumulativeGroupedAllocationPrice.LicenseType | null; } export namespace CumulativeGroupedAllocationPrice { @@ -13618,6 +14712,29 @@ export namespace Price { */ unit_amount: string; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface MinimumCompositePrice { @@ -13711,6 +14828,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: MinimumCompositePrice.LicenseType | null; } export namespace MinimumCompositePrice { @@ -13745,6 +14869,29 @@ export namespace Price { */ prorated?: boolean; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface PercentCompositePrice { @@ -13838,6 +14985,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: PercentCompositePrice.LicenseType | null; } export namespace PercentCompositePrice { @@ -13867,6 +15021,29 @@ export namespace Price { */ percent: number; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } export interface EventOutputPrice { @@ -13960,6 +15137,13 @@ export namespace Price { replaces_price_id: string | null; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + license_type?: EventOutputPrice.LicenseType | null; } export namespace EventOutputPrice { @@ -14002,6 +15186,29 @@ export namespace Price { */ grouping_key?: string | null; } + + /** + * The LicenseType resource represents a type of license that can be assigned to + * users. License types are used during billing by grouping metrics on the + * configured grouping key. + */ + export interface LicenseType { + /** + * The Orb-assigned unique identifier for the license type. + */ + id: string; + + /** + * The key used for grouping licenses of this type. This is typically a user + * identifier field. + */ + grouping_key: string; + + /** + * The name of the license type. + */ + name: string; + } } } @@ -14081,6 +15288,12 @@ export interface PriceInterval { * this price interval. */ usage_customer_ids: Array | null; + + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; } export interface SubLineItemGrouping { diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index b4b019f0..a809acae 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -1183,6 +1183,11 @@ export interface NewSubscriptionBulkPrice { */ 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 @@ -1284,6 +1289,11 @@ export interface NewSubscriptionBulkWithProrationPrice { */ 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 @@ -1414,6 +1424,11 @@ export interface NewSubscriptionCumulativeGroupedBulkPrice { */ 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 @@ -1551,6 +1566,11 @@ export interface NewSubscriptionGroupedAllocationPrice { */ 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 @@ -1674,6 +1694,11 @@ export interface NewSubscriptionGroupedTieredPackagePrice { */ 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 @@ -1809,6 +1834,11 @@ export interface NewSubscriptionGroupedTieredPrice { */ 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 @@ -1942,6 +1972,11 @@ export interface NewSubscriptionGroupedWithMeteredMinimumPrice { */ 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 @@ -2105,6 +2140,11 @@ export interface NewSubscriptionGroupedWithProratedMinimumPrice { */ 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 @@ -2228,6 +2268,11 @@ export interface NewSubscriptionMatrixPrice { */ 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 @@ -2329,6 +2374,11 @@ export interface NewSubscriptionMatrixWithAllocationPrice { */ 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 @@ -2430,6 +2480,11 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice { */ 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 @@ -2570,6 +2625,11 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice { */ 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 @@ -2704,6 +2764,11 @@ export interface NewSubscriptionMinimumCompositePrice { */ 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 @@ -2822,6 +2887,11 @@ export interface NewSubscriptionPackagePrice { */ 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 @@ -2923,6 +2993,11 @@ export interface NewSubscriptionPackageWithAllocationPrice { */ 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 @@ -3037,6 +3112,11 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { */ 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 @@ -3184,6 +3264,11 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { */ 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 @@ -3218,6 +3303,11 @@ export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { */ unit_price: string; + /** + * The property used to group this price + */ + grouping_key?: string | null; + /** * If true, the unit price will be prorated to the billing period */ @@ -3330,6 +3420,11 @@ export interface NewSubscriptionThresholdTotalAmountPrice { */ 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 @@ -3463,6 +3558,11 @@ export interface NewSubscriptionTieredPackagePrice { */ 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 @@ -3595,6 +3695,11 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice { */ 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 @@ -3724,6 +3829,11 @@ export interface NewSubscriptionTieredPrice { */ 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 @@ -3825,6 +3935,11 @@ export interface NewSubscriptionTieredWithMinimumPrice { */ 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 @@ -3965,6 +4080,11 @@ export interface NewSubscriptionUnitPrice { */ 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 @@ -4066,6 +4186,11 @@ export interface NewSubscriptionUnitWithPercentPrice { */ 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 @@ -4184,6 +4309,11 @@ export interface NewSubscriptionUnitWithProrationPrice { */ 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 @@ -4741,6 +4871,12 @@ export namespace SubscriptionCreateParams { */ maximum_amount?: string | null; + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum * amount for this price. @@ -4890,6 +5026,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5040,6 +5181,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5171,6 +5317,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5299,6 +5450,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5427,6 +5583,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5540,6 +5701,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5649,6 +5815,12 @@ export namespace SubscriptionCreateParams { */ maximum_amount?: string | null; + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum * amount for the replacement price. @@ -5786,6 +5958,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -5936,6 +6113,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -6067,6 +6249,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -6195,6 +6382,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -6323,6 +6515,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -6436,6 +6633,11 @@ export namespace SubscriptionCreateParams { */ 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 @@ -6728,6 +6930,12 @@ export namespace SubscriptionPriceIntervalsParams { */ maximum_amount?: number | null; + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values (number or string). + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * The minimum amount that will be billed for this price interval for a given * billing period. @@ -6915,6 +7123,11 @@ export namespace SubscriptionPriceIntervalsParams { */ 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 @@ -7058,6 +7271,11 @@ export namespace SubscriptionPriceIntervalsParams { */ 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 @@ -7179,6 +7397,11 @@ export namespace SubscriptionPriceIntervalsParams { */ 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 @@ -7300,6 +7523,11 @@ export namespace SubscriptionPriceIntervalsParams { */ 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 @@ -7406,6 +7634,11 @@ export namespace SubscriptionPriceIntervalsParams { */ 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 @@ -7517,6 +7750,12 @@ export namespace SubscriptionPriceIntervalsParams { */ fixed_fee_quantity_transitions?: Array | null; + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values (number or string). + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * The updated start date of this price interval. If not specified, the start date * will not be updated. @@ -7816,6 +8055,12 @@ export namespace SubscriptionSchedulePlanChangeParams { */ maximum_amount?: string | null; + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum * amount for this price. @@ -7965,6 +8210,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -8115,6 +8365,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -8246,6 +8501,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -8374,6 +8634,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -8502,6 +8767,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -8615,6 +8885,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -8724,6 +8999,12 @@ export namespace SubscriptionSchedulePlanChangeParams { */ maximum_amount?: string | null; + /** + * Override values for parameterized billable metric variables. Keys are parameter + * names, values are the override values. + */ + metric_parameter_overrides?: { [key: string]: unknown } | null; + /** * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum * amount for the replacement price. @@ -8861,6 +9142,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -9011,6 +9297,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -9142,6 +9433,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -9270,6 +9566,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -9398,6 +9699,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 @@ -9511,6 +9817,11 @@ export namespace SubscriptionSchedulePlanChangeParams { */ 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 diff --git a/src/version.ts b/src/version.ts index 407974e3..b06325a3 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.44.0'; // x-release-please-version +export const VERSION = '5.45.0'; // x-release-please-version diff --git a/tests/api-resources/alerts.test.ts b/tests/api-resources/alerts.test.ts index 1d37b600..044a4011 100644 --- a/tests/api-resources/alerts.test.ts +++ b/tests/api-resources/alerts.test.ts @@ -143,7 +143,9 @@ describe('resource alerts', () => { const response = await client.alerts.createForSubscription('subscription_id', { thresholds: [{ value: 0 }], type: 'usage_exceeded', + grouping_keys: ['string'], metric_id: 'metric_id', + pricing_unit_id: 'pricing_unit_id', }); }); diff --git a/tests/api-resources/beta/beta.test.ts b/tests/api-resources/beta/beta.test.ts index 56735b6b..dd04e927 100644 --- a/tests/api-resources/beta/beta.test.ts +++ b/tests/api-resources/beta/beta.test.ts @@ -61,8 +61,44 @@ describe('resource beta', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, + license_allocation_price: { + cadence: 'annual', + item_id: 'item_id', + license_allocations: [ + { + amount: 'amount', + currency: 'currency', + write_off_overage: true, + }, + ], + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount', prorated: true }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', + metadata: { foo: 'string' }, + reference_id: 'reference_id', + }, plan_phase_order: 0, price: { cadence: 'annual', @@ -88,6 +124,7 @@ describe('resource beta', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, @@ -135,8 +172,44 @@ describe('resource beta', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, + license_allocation_price: { + cadence: 'annual', + item_id: 'item_id', + license_allocations: [ + { + amount: 'amount', + currency: 'currency', + write_off_overage: true, + }, + ], + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount', prorated: true }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', + metadata: { foo: 'string' }, + reference_id: 'reference_id', + }, plan_phase_order: 0, price: { cadence: 'annual', @@ -162,6 +235,7 @@ describe('resource beta', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, diff --git a/tests/api-resources/beta/external-plan-id.test.ts b/tests/api-resources/beta/external-plan-id.test.ts index a195222f..7ab33868 100644 --- a/tests/api-resources/beta/external-plan-id.test.ts +++ b/tests/api-resources/beta/external-plan-id.test.ts @@ -61,8 +61,44 @@ describe('resource externalPlanId', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, + license_allocation_price: { + cadence: 'annual', + item_id: 'item_id', + license_allocations: [ + { + amount: 'amount', + currency: 'currency', + write_off_overage: true, + }, + ], + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount', prorated: true }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', + metadata: { foo: 'string' }, + reference_id: 'reference_id', + }, plan_phase_order: 0, price: { cadence: 'annual', @@ -88,6 +124,7 @@ describe('resource externalPlanId', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, @@ -135,8 +172,44 @@ describe('resource externalPlanId', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, + license_allocation_price: { + cadence: 'annual', + item_id: 'item_id', + license_allocations: [ + { + amount: 'amount', + currency: 'currency', + write_off_overage: true, + }, + ], + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount', prorated: true }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', + metadata: { foo: 'string' }, + reference_id: 'reference_id', + }, plan_phase_order: 0, price: { cadence: 'annual', @@ -162,6 +235,7 @@ describe('resource externalPlanId', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, diff --git a/tests/api-resources/credit-blocks.test.ts b/tests/api-resources/credit-blocks.test.ts index 383764e7..a733b832 100644 --- a/tests/api-resources/credit-blocks.test.ts +++ b/tests/api-resources/credit-blocks.test.ts @@ -44,4 +44,22 @@ describe('resource creditBlocks', () => { client.creditBlocks.delete('block_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Orb.NotFoundError); }); + + test('listInvoices', async () => { + const responsePromise = client.creditBlocks.listInvoices('block_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('listInvoices: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.creditBlocks.listInvoices('block_id', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); }); diff --git a/tests/api-resources/customers/credits/credits.test.ts b/tests/api-resources/customers/credits/credits.test.ts index c834d2c0..220c7300 100644 --- a/tests/api-resources/customers/credits/credits.test.ts +++ b/tests/api-resources/customers/credits/credits.test.ts @@ -35,6 +35,10 @@ describe('resource credits', () => { { currency: 'currency', cursor: 'cursor', + 'effective_date[gt]': '2019-12-27T18:11:19.117Z', + 'effective_date[gte]': '2019-12-27T18:11:19.117Z', + 'effective_date[lt]': '2019-12-27T18:11:19.117Z', + 'effective_date[lte]': '2019-12-27T18:11:19.117Z', include_all_blocks: true, limit: 1, }, @@ -69,6 +73,10 @@ describe('resource credits', () => { { currency: 'currency', cursor: 'cursor', + 'effective_date[gt]': '2019-12-27T18:11:19.117Z', + 'effective_date[gte]': '2019-12-27T18:11:19.117Z', + 'effective_date[lt]': '2019-12-27T18:11:19.117Z', + 'effective_date[lte]': '2019-12-27T18:11:19.117Z', include_all_blocks: true, limit: 1, }, diff --git a/tests/api-resources/customers/credits/ledger.test.ts b/tests/api-resources/customers/credits/ledger.test.ts index f43bb1a8..004030ee 100644 --- a/tests/api-resources/customers/credits/ledger.test.ts +++ b/tests/api-resources/customers/credits/ledger.test.ts @@ -83,6 +83,7 @@ describe('resource ledger', () => { custom_due_date: '2019-12-27', invoice_date: '2019-12-27', item_id: 'item_id', + mark_as_paid: true, memo: 'memo', net_terms: 0, require_successful_payment: true, @@ -126,6 +127,7 @@ describe('resource ledger', () => { custom_due_date: '2019-12-27', invoice_date: '2019-12-27', item_id: 'item_id', + mark_as_paid: true, memo: 'memo', net_terms: 0, require_successful_payment: true, diff --git a/tests/api-resources/invoices.test.ts b/tests/api-resources/invoices.test.ts index 3294bbba..2234bf27 100644 --- a/tests/api-resources/invoices.test.ts +++ b/tests/api-resources/invoices.test.ts @@ -49,6 +49,7 @@ describe('resource invoices', () => { unit_config: { unit_amount: 'unit_amount', prorated: true }, }, ], + auto_collection: true, customer_id: '4khy3nwzktxv7', discount: { discount_type: 'percentage', @@ -207,6 +208,31 @@ describe('resource invoices', () => { ).rejects.toThrow(Orb.NotFoundError); }); + test('issueSummary', async () => { + const responsePromise = client.invoices.issueSummary('invoice_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('issueSummary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.invoices.issueSummary('invoice_id', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); + + test('issueSummary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.invoices.issueSummary('invoice_id', { synchronous: true }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); + test('listSummary', async () => { const responsePromise = client.invoices.listSummary(); const rawResponse = await responsePromise.asResponse(); @@ -247,7 +273,7 @@ describe('resource invoices', () => { 'invoice_date[lte]': '2019-12-27T18:11:19.117Z', is_recurring: true, limit: 1, - status: ['draft'], + status: 'draft', subscription_id: 'subscription_id', }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/license-types.test.ts b/tests/api-resources/license-types.test.ts new file mode 100644 index 00000000..7a16984f --- /dev/null +++ b/tests/api-resources/license-types.test.ts @@ -0,0 +1,69 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Orb from 'orb-billing'; +import { Response } from 'node-fetch'; + +const client = new Orb({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource licenseTypes', () => { + test('create: only required params', async () => { + const responsePromise = client.licenseTypes.create({ grouping_key: 'grouping_key', name: 'name' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.licenseTypes.create({ grouping_key: 'grouping_key', name: 'name' }); + }); + + test('retrieve', async () => { + const responsePromise = client.licenseTypes.retrieve('license_type_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('retrieve: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.licenseTypes.retrieve('license_type_id', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); + + test('list', async () => { + const responsePromise = client.licenseTypes.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.licenseTypes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Orb.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.licenseTypes.list({ cursor: 'cursor', limit: 1 }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); +}); diff --git a/tests/api-resources/licenses/external-licenses.test.ts b/tests/api-resources/licenses/external-licenses.test.ts new file mode 100644 index 00000000..379387e6 --- /dev/null +++ b/tests/api-resources/licenses/external-licenses.test.ts @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Orb from 'orb-billing'; +import { Response } from 'node-fetch'; + +const client = new Orb({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource externalLicenses', () => { + test('getUsage: only required params', async () => { + const responsePromise = client.licenses.externalLicenses.getUsage('external_license_id', { + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('getUsage: required and optional params', async () => { + const response = await client.licenses.externalLicenses.getUsage('external_license_id', { + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + cursor: 'cursor', + end_date: '2019-12-27', + group_by: ['string'], + limit: 1, + start_date: '2019-12-27', + }); + }); +}); diff --git a/tests/api-resources/licenses/licenses.test.ts b/tests/api-resources/licenses/licenses.test.ts new file mode 100644 index 00000000..b1db9682 --- /dev/null +++ b/tests/api-resources/licenses/licenses.test.ts @@ -0,0 +1,108 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Orb from 'orb-billing'; +import { Response } from 'node-fetch'; + +const client = new Orb({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource licenses', () => { + test('create: only required params', async () => { + const responsePromise = client.licenses.create({ + external_license_id: 'external_license_id', + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.licenses.create({ + external_license_id: 'external_license_id', + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + end_date: '2026-01-27', + start_date: '2026-01-27', + }); + }); + + test('retrieve', async () => { + const responsePromise = client.licenses.retrieve('license_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('retrieve: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.licenses.retrieve('license_id', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); + + test('list: only required params', async () => { + const responsePromise = client.licenses.list({ subscription_id: 'subscription_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.licenses.list({ + subscription_id: 'subscription_id', + cursor: 'cursor', + external_license_id: 'external_license_id', + license_type_id: 'license_type_id', + limit: 1, + status: 'active', + }); + }); + + test('deactivate', async () => { + const responsePromise = client.licenses.deactivate('license_id', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('retrieveByExternalId: only required params', async () => { + const responsePromise = client.licenses.retrieveByExternalId('external_license_id', { + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('retrieveByExternalId: required and optional params', async () => { + const response = await client.licenses.retrieveByExternalId('external_license_id', { + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + }); + }); +}); diff --git a/tests/api-resources/licenses/usage.test.ts b/tests/api-resources/licenses/usage.test.ts new file mode 100644 index 00000000..e44412ec --- /dev/null +++ b/tests/api-resources/licenses/usage.test.ts @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Orb from 'orb-billing'; +import { Response } from 'node-fetch'; + +const client = new Orb({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource usage', () => { + test('getAllUsage: only required params', async () => { + const responsePromise = client.licenses.usage.getAllUsage({ + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('getAllUsage: required and optional params', async () => { + const response = await client.licenses.usage.getAllUsage({ + license_type_id: 'license_type_id', + subscription_id: 'subscription_id', + cursor: 'cursor', + end_date: '2019-12-27', + group_by: ['string'], + limit: 1, + start_date: '2019-12-27', + }); + }); + + test('getUsage', async () => { + const responsePromise = client.licenses.usage.getUsage('license_id'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('getUsage: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.licenses.usage.getUsage('license_id', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Orb.NotFoundError); + }); + + test('getUsage: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.licenses.usage.getUsage( + 'license_id', + { + cursor: 'cursor', + end_date: '2019-12-27', + group_by: ['string'], + limit: 1, + start_date: '2019-12-27', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Orb.NotFoundError); + }); +}); diff --git a/tests/api-resources/plans/plans.test.ts b/tests/api-resources/plans/plans.test.ts index 73f759ee..72c331f9 100644 --- a/tests/api-resources/plans/plans.test.ts +++ b/tests/api-resources/plans/plans.test.ts @@ -44,8 +44,44 @@ describe('resource plans', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, + license_allocation_price: { + cadence: 'annual', + item_id: 'item_id', + license_allocations: [ + { + amount: 'amount', + currency: 'currency', + write_off_overage: true, + }, + ], + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount', prorated: true }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', + metadata: { foo: 'string' }, + reference_id: 'reference_id', + }, plan_phase_order: 0, price: { cadence: 'annual', @@ -71,6 +107,7 @@ describe('resource plans', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, diff --git a/tests/api-resources/prices/prices.test.ts b/tests/api-resources/prices/prices.test.ts index d936cc52..e0fa3de0 100644 --- a/tests/api-resources/prices/prices.test.ts +++ b/tests/api-resources/prices/prices.test.ts @@ -52,6 +52,7 @@ describe('resource prices', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, }); }); @@ -112,6 +113,7 @@ describe('resource prices', () => { external_customer_id: 'external_customer_id', filter: "my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys: ["case when my_event_type = 'foo' then true else false end"], + metric_parameter_overrides: { foo: 'bar' }, }); }); @@ -140,6 +142,7 @@ describe('resource prices', () => { external_price_id: 'external_price_id', filter: "my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys: ["case when my_event_type = 'foo' then true else false end"], + metric_parameter_overrides: { foo: 'bar' }, price: { cadence: 'annual', currency: 'currency', @@ -164,6 +167,7 @@ describe('resource prices', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, }, price_id: 'price_id', @@ -206,6 +210,7 @@ describe('resource prices', () => { external_price_id: 'external_price_id', filter: "my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys: ["case when my_event_type = 'foo' then true else false end"], + metric_parameter_overrides: { foo: 'bar' }, price: { cadence: 'annual', currency: 'currency', @@ -230,6 +235,7 @@ describe('resource prices', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, }, price_id: 'price_id', diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index ebb06899..a34f7b82 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -314,6 +314,7 @@ describe('resource subscriptions', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, discounts: [ @@ -327,6 +328,7 @@ describe('resource subscriptions', () => { end_date: '2019-12-27T18:11:19.117Z', external_price_id: 'external_price_id', maximum_amount: '1.23', + metric_parameter_overrides: { foo: 'bar' }, minimum_amount: '1.23', plan_phase_order: 0, price: { @@ -353,6 +355,7 @@ describe('resource subscriptions', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, @@ -422,6 +425,7 @@ describe('resource subscriptions', () => { }, ], item_id: 'item_id', + license_type_id: 'license_type_id', per_unit_cost_basis: 'per_unit_cost_basis', }, discounts: [ @@ -435,6 +439,7 @@ describe('resource subscriptions', () => { external_price_id: 'external_price_id', fixed_price_quantity: 2, maximum_amount: '1.23', + metric_parameter_overrides: { foo: 'bar' }, minimum_amount: '1.23', price: { cadence: 'annual', @@ -460,6 +465,7 @@ describe('resource subscriptions', () => { fixed_price_quantity: 0, invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + license_type_id: 'license_type_id', metadata: { foo: 'string' }, reference_id: 'reference_id', }, diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index c923026b..2a43ab83 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { Orb } from 'orb-billing'; - -const { stringifyQuery } = Orb.prototype as any; +import { stringifyQuery } from 'orb-billing/internal/utils/query'; describe(stringifyQuery, () => { for (const [input, expected] of [ @@ -15,7 +13,7 @@ describe(stringifyQuery, () => { 'e=f', )}=${encodeURIComponent('g&h')}`, ], - ]) { + ] as const) { it(`${JSON.stringify(input)} -> ${expected}`, () => { expect(stringifyQuery(input)).toEqual(expected); });